diff options
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" }); } |
