|
|
@@ -14,7 +14,9 @@ try {
|
|
|
const mutations = []
|
|
|
page.on('pageerror', e => errors.push(e.message))
|
|
|
page.on('request', r => { if (r.method() !== 'GET') mutations.push(r.url()) })
|
|
|
+ const reviewResponse = page.waitForResponse(response => new URL(response.url()).pathname === '/api/review' && response.status() === 200)
|
|
|
await page.goto(url)
|
|
|
+ const review = await (await reviewResponse).json()
|
|
|
await page.locator('#summary h1').waitFor()
|
|
|
await page.waitForFunction(() => document.querySelector('#sync').textContent.startsWith('已同步'))
|
|
|
assert.equal(await page.locator('.metric').count(), 4)
|
|
|
@@ -22,7 +24,12 @@ try {
|
|
|
await page.evaluate(() => window.scrollTo(0, 0))
|
|
|
await page.screenshot({ path: out + '/01-overview.png', fullPage: true })
|
|
|
await page.locator('nav [data-tab="impact"]').click()
|
|
|
- assert(await page.locator('svg[aria-label="候选的静态可达关联图"]').count())
|
|
|
+ const candidateID = await page.locator('#candidate').inputValue()
|
|
|
+ const candidate = review.candidates.find(item => item.id === candidateID)
|
|
|
+ assert(candidate, 'displayed candidate must belong to this review')
|
|
|
+ const paths = candidate.ontology_context?.impact_paths || []
|
|
|
+ assert.equal(await page.locator('svg[aria-label="候选的静态可达关联图"]').count(), paths.length ? 1 : 0)
|
|
|
+ if (!paths.length) await page.getByText('暂无可展示的关联路径;不表示不存在依赖。', { exact: true }).waitFor()
|
|
|
await page.locator('details').first().locator('summary').click()
|
|
|
assert(!(await page.locator('details').first().innerText()).includes('[object Object]'))
|
|
|
await page.evaluate(() => window.scrollTo(0, 0))
|