diff options
| author | Somhairle H. Marisol <[email protected]> | 2026-09-22 03:48:12 +0800 |
|---|---|---|
| committer | Somhairle H. Marisol <[email protected]> | 2026-09-22 03:48:12 +0800 |
| commit | b5a80f69cb2e2793e5134e23a0eb3e72cdbdbe0b (patch) | |
| tree | eeb22106ceb0d1eb0fe07b7bff18450af11e0d50 /qa/driver/browser-test.js | |
| parent | 7dd0e3f42105569b6e6ec02aeeec9b5a8bbd9dd3 (diff) | |
| download | fund-lab-b5a80f69cb2e2793e5134e23a0eb3e72cdbdbe0b.tar.gz | |
Add multi-source bond quote probe fields and daily fallback (3d-20)
Diffstat (limited to 'qa/driver/browser-test.js')
| -rw-r--r-- | qa/driver/browser-test.js | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/qa/driver/browser-test.js b/qa/driver/browser-test.js index 401cb78..22385f8 100644 --- a/qa/driver/browser-test.js +++ b/qa/driver/browser-test.js @@ -669,7 +669,7 @@ async function bondsScenario(page) { `quote=${JSON.stringify(quote).slice(0, 160)} result=${resultText.slice(0, 160)}` ); - await page.fill(".bond-code-input", "019547"); + await page.fill(".bond-code-input", "999997"); await page.click(".bond-quote-action"); await page.waitForFunction( () => { @@ -685,7 +685,7 @@ async function bondsScenario(page) { const token = process.env.QA_TOKEN || "qa-token"; const failure = await page.evaluate(async (token) => { - const response = await fetch("/api/market/bond-quote?code=019547", { + const response = await fetch("/api/market/bond-quote?code=999997", { headers: { Authorization: `Bearer ${token}` }, }); let body = null; @@ -705,6 +705,25 @@ async function bondsScenario(page) { `message=${unavailableText.slice(0, 200)} status=${failure.status}` ); + await page.fill(".bond-code-input", "019547"); + await page.click(".bond-quote-action"); + await page.waitForSelector(".bond-quote-result", { timeout: 10000 }); + + const dailyText = ((await page.textContent(".bond-quote-result")) || "").trim(); + const dailyQuote = lastBondQuoteResponse || {}; + + check( + "B3 国债日线路径返回行情日期与净价字符串", + dailyQuote.code === "019547" && + typeof dailyQuote.price === "string" && + dailyQuote.price.length > 0 && + typeof dailyQuote.date === "string" && + dailyQuote.date.length > 0 && + dailyText.includes(dailyQuote.price) && + dailyText.includes(dailyQuote.date), + `quote=${JSON.stringify(dailyQuote).slice(0, 200)}` + ); + await page.screenshot({ path: SHOTS + "/21-bonds.png" }); } |
