fix(test): сохранять снимки GRE и VXLAN в результатах проверки
This commit is contained in:
1 parent
af07c59ffa
commit
cdb528276b
8 files changed
+101
-14
No files matched your search
@@ -1,8 +1,7 @@
|
||||
import { test, expect } from "@playwright/test"
|
||||
import { mkdirSync } from "node:fs"
|
||||
|
||||
for (const section of ["gre", "vxlan"]) for (const device of ["desktop", "mobile"] as const) {
|
||||
test(`${section}: клавиатура и layout ${device}`, async ({ page }) => {
|
||||
test(`${section}: клавиатура и layout ${device}`, async ({ page }, info) => {
|
||||
await page.setViewportSize(device === "desktop" ? { width: 1440, height: 1000 } : { width: 390, height: 844 })
|
||||
await page.clock.install({ time: new Date("2026-09-30T05:00:00Z") })
|
||||
const devices = [1, 2].map(id => ({ id, name: id === 1 ? "Основной роутер" : "Резервный роутер", host: "192.0.2." + id, enabled: true, country: "RU", status: "online", type: "exit-node" }))
|
||||
@@ -25,8 +24,7 @@ for (const section of ["gre", "vxlan"]) for (const device of ["desktop", "mobile
|
||||
await expect(page.locator("tr[data-row-id]")).toHaveCount(1)
|
||||
expect(await page.evaluate(() => document.documentElement.scrollWidth <= innerWidth)).toBe(true)
|
||||
await page.addStyleTag({ content: "nextjs-portal { display: none !important; }" })
|
||||
mkdirSync("docs/ux-ui/screens", { recursive: true })
|
||||
await page.screenshot({ path: `docs/ux-ui/screens/${section}-${device}.png`, animations: "disabled" })
|
||||
await page.screenshot({ path: info.outputPath(`${section}-${device}.png`), animations: "disabled" })
|
||||
const menu = page.getByRole("button", { name: "Действия: " + section + "-2", exact: true })
|
||||
await menu.focus()
|
||||
await page.keyboard.press("Enter")
|
||||
@@ -45,7 +43,7 @@ for (const section of ["gre", "vxlan"]) for (const device of ["desktop", "mobile
|
||||
await expect(dialog).toContainText("Резервный роутер")
|
||||
await expect(dialog).toContainText("vni=200")
|
||||
}
|
||||
await page.screenshot({ path: `docs/ux-ui/screens/${section}-${section === "gre" ? "form" : "export"}-${device}.png`, animations: "disabled" })
|
||||
await page.screenshot({ path: info.outputPath(`${section}-${section === "gre" ? "form" : "export"}-${device}.png`), animations: "disabled" })
|
||||
if (section === "gre") {
|
||||
await dialog.getByRole("button", { name: "Сохранить", exact: true }).focus()
|
||||
await page.keyboard.press("Enter")
|
||||
|
||||
Reference in new issue
Block a user