test(ui): проверить период трафика на телефоне
This commit is contained in:
1 parent
3dc85a22e9
commit
cb16c03e01
2 files changed
+21
No files matched your search
@@ -56,3 +56,19 @@ test('Детали трафика: ошибка интерфейса не под
|
||||
await expect(page.getByRole('heading', { name: 'Детали 1h ether2', exact: true })).toBeVisible()
|
||||
await expect(page.getByLabel('Скорость выбранного сервера')).toBeVisible()
|
||||
})
|
||||
|
||||
for (const width of [320, 390]) {
|
||||
test(`Детали трафика: период доступен на ${width}px`, async ({ page }) => {
|
||||
await page.setViewportSize({ width, height: 900 })
|
||||
await setup(page)
|
||||
const period = page.getByRole('button', { name: '24ч', exact: true })
|
||||
const box = await period.boundingBox()
|
||||
expect(box).not.toBeNull()
|
||||
expect(box!.x).toBeGreaterThanOrEqual(0)
|
||||
expect(box!.x + box!.width).toBeLessThanOrEqual(width + 1)
|
||||
await period.click()
|
||||
await expect(page.getByRole('heading', { name: 'Детали 24h __all__', exact: true })).toBeVisible()
|
||||
await expect(page.getByLabel('Скорость выбранного сервера')).toBeVisible()
|
||||
expect(await page.evaluate(() => document.documentElement.scrollWidth <= window.innerWidth + 1)).toBe(true)
|
||||
})
|
||||
}
|
||||
Reference in new issue
Block a user