fix(ui): адаптировать формы серверов и прокрутку ресурсов
This commit is contained in:
1 parent
9cd15528c9
commit
ca9474ac83
7 files changed
+74
-11
No files matched your search
@@ -509,3 +509,27 @@ test("права серверов: отзыв перед сохранением
|
||||
await expect(page.getByRole("button", { name: "Сохранить", exact: true })).toBeDisabled()
|
||||
expect(writes).toBe(0)
|
||||
})
|
||||
|
||||
for (const width of [320, 390, 1440]) {
|
||||
test(`приёмка формы сервера ${width}px: все шаги и отмена`, async ({ page }) => {
|
||||
await page.setViewportSize({ width, height: 844 })
|
||||
await setup(page)
|
||||
await edit(page)
|
||||
const dialog = page.getByRole('dialog')
|
||||
await dialog.getByRole("button", { name: "Home Router", exact: true }).click()
|
||||
for (let step = 1; step <= 4; step++) {
|
||||
if (step === 2) await dialog.getByRole("button", { name: "Добавить WAN-аплинк", exact: true }).click()
|
||||
if (step === 4) await dialog.getByRole("button", { name: "Дополнительно", exact: true }).last().click()
|
||||
await expect(dialog.getByRole('button', { name: 'Отмена', exact: true })).toBeInViewport()
|
||||
await expect.poll(() => dialog.locator('button, input').evaluateAll(elements => elements.filter(el => {
|
||||
const rect = el.getBoundingClientRect()
|
||||
return rect.width > 0 && (rect.left < -1 || rect.right > innerWidth + 1)
|
||||
}).map(el => el.textContent || el.tagName))).toEqual([])
|
||||
await page.screenshot({ path: `test-results/server-form-${width}-${step}.png`, animations: 'disabled' })
|
||||
if (step < 4) await dialog.getByRole('button', { name: 'Далее', exact: true }).click()
|
||||
}
|
||||
await expect(dialog.getByRole('button', { name: 'Сохранить', exact: true })).toBeInViewport()
|
||||
await page.keyboard.press('Escape')
|
||||
await expect(dialog).toBeHidden()
|
||||
})
|
||||
}
|
||||
Reference in new issue
Block a user