From b5a80f69cb2e2793e5134e23a0eb3e72cdbdbe0b Mon Sep 17 00:00:00 2001 From: "Somhairle H. Marisol" Date: Tue, 22 Sep 2026 03:48:12 +0800 Subject: Add multi-source bond quote probe fields and daily fallback (3d-20) --- qa/driver/browser-test.js | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) (limited to 'qa/driver') 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" }); } -- cgit v1.2.3