import {test,expect} from "@playwright/test" import {evoSettings,evoCatalog} from "./fixtures/evobgp" for(const width of [1440,390,320])test("Evolution form: responsive/"+width,async({page})=>{ await page.setViewportSize({width,height:1000}) await page.route("**/health",r=>r.fulfill({json:{ok:true}})) await page.route("**/api/**",r=>{const path=new URL(r.request().url()).pathname;return r.fulfill(path==="/api/auth/config"?{json:{required:false}}:path==="/api/evobgp/settings"?{json:evoSettings}:path==="/api/evobgp/catalog"?{json:evoCatalog}:{status:503,json:{error:"outside fixture"}})}) await page.goto("/settings");await page.getByRole("button",{name:"EvoBGP",exact:true}).click();await expect(page.getByRole("textbox",{name:"Базовый URL API",exact:true})).toHaveValue(evoSettings.baseUrl) const section=page.getByRole("region",{name:"Настройки EvoBGP",exact:true}) await section.scrollIntoViewIfNeeded();expect(await section.evaluate(e=>e.scrollWidth<=e.clientWidth+2)).toBe(true);expect(await page.evaluate(()=>document.documentElement.scrollWidth<=window.innerWidth)).toBe(true) await page.screenshot({path:"docs/ux-ui/screens/evolution-"+width+".png",fullPage:true,animations:"disabled"}) await page.getByRole("button",{name:"Удалить сохранённый ключ",exact:true}).click();await expect(page.getByRole("alertdialog")).toBeVisible();expect(await page.evaluate(()=>document.documentElement.scrollWidth<=window.innerWidth)).toBe(true) await page.screenshot({path:"docs/ux-ui/screens/evolution-clear-"+width+".png",fullPage:true,animations:"disabled"}) })