Files
safavimohadeseh78andCursor e3f0457dc9
Frontend CI / unit (test, type-check, build) (push) Successful in 1m11s
Frontend CI / browser E2E (frontend + pinned backend) (push) Failing after 2m48s
feat: complete server-backed six-lesson app and trial tooling
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-10-12 14:40:37 +03:30

32 lines
1.2 KiB
TypeScript

import { test, expect } from '@playwright/test'
import { registerViaUi, uniqueUsername } from './helpers/auth'
test.describe('UI quality', () => {
test('no unexpected console errors on home and RTL layout', async ({ page }) => {
const errors: string[] = []
page.on('pageerror', (err) => errors.push(err.message))
page.on('console', (msg) => {
if (msg.type() === 'error') errors.push(msg.text())
})
const user = uniqueUsername('ui')
await registerViaUi(page, user, 'pass1234')
const bodyDir = await page.evaluate(() => getComputedStyle(document.body).direction)
expect(bodyDir).toBe('rtl')
const overflow = await page.evaluate(() => document.documentElement.scrollWidth > window.innerWidth + 2)
expect(overflow).toBe(false)
const filtered = errors.filter(
(e) => !e.includes('favicon') && !e.includes('DevTools') && !e.includes('404'),
)
expect(filtered).toEqual([])
})
test('keyboard focus reaches login username field', async ({ page }) => {
await page.goto('/login')
await page.getByLabel('نام کاربری').focus()
await expect(page.getByLabel('نام کاربری')).toBeFocused()
})
})