fix(tests): согласовать полную регрессию с фокусом выбранного сервера
This commit is contained in:
1 parent
c88d31fa45
commit
481688e72a
9 files changed
+1359
-9
No files matched your search
@@ -125,7 +125,7 @@ for (const theme of ["dark", "light"]) test(`Large server rail: URL, стран
|
||||
await expect(rail.getByText("951–1000 из 1001", { exact: true })).toBeVisible()
|
||||
expect(await rail.locator("*").count()).toBeLessThan(1200)
|
||||
await info.attach("large-rail-metrics", { body: JSON.stringify({ fixtureDevices: 1001, renderedOptions: await list.getByRole("option").count(), railNodes: await rail.locator("*").count(), domNodes: await page.locator("*").count() }), contentType: "application/json" })
|
||||
await list.focus()
|
||||
await list.getByRole("option", { selected: true }).focus()
|
||||
await page.keyboard.press("End")
|
||||
await expect(page).toHaveURL(url => url.searchParams.get("server") === "1001" && url.searchParams.get("keep") === "1")
|
||||
await expect(list.getByRole("option")).toHaveCount(1)
|
||||
@@ -155,7 +155,7 @@ for (const theme of ["dark", "light"]) test(`Large server rail: URL, стран
|
||||
await expect(sheet.getByRole("option", { selected: true })).toContainText("Источник 1000")
|
||||
expect(await page.evaluate(() => document.documentElement.scrollWidth <= innerWidth)).toBe(true)
|
||||
expect(await sheet.getByRole("button", { name: "Следующие устройства", exact: true }).evaluate(el => el.getBoundingClientRect().right <= innerWidth)).toBe(true)
|
||||
expect(await sheet.getByRole("listbox", { name: "Серверы", exact: true }).evaluate(el => { const id = el.getAttribute("aria-activedescendant"); return !!id && el.contains(document.getElementById(id)) })).toBe(true)
|
||||
await sheet.getByRole("option", { selected: true }).focus(); await expect(sheet.getByRole("option", { selected: true })).toBeFocused()
|
||||
await page.addScriptTag({ content: axe.source })
|
||||
const audit = await page.evaluate(async () => (window as unknown as { axe: typeof axe }).axe.run(document.querySelector('[role="dialog"]')!, { runOnly: { type: "tag", values: ["wcag2a", "wcag2aa", "wcag21a", "wcag21aa", "wcag22aa"] } }))
|
||||
await info.attach("large-rail-axe", { body: JSON.stringify(audit), contentType: "application/json" })
|
||||
@@ -172,7 +172,7 @@ test("Large server rail: выбранное устройство и границ
|
||||
await expect(list.getByRole("option")).toHaveCount(1)
|
||||
await expect(list.getByRole("option", { selected: true })).toContainText("Источник 1000")
|
||||
await expect(rail.getByText("Площадка B", { exact: true })).toBeVisible()
|
||||
await list.focus()
|
||||
await list.getByRole("option", { selected: true }).focus()
|
||||
await page.keyboard.press("End")
|
||||
await expect(list.getByRole("option", { selected: true })).toContainText("Цель")
|
||||
await expect(list.getByRole("option")).toHaveCount(50)
|
||||
|
||||
Reference in new issue
Block a user