Search RU
Tasks / Playwright / Login form validation
Statement easy

Login form validation

The page has a login form. Write Playwright tests that check the validation:

- an email without `@` → the message `Введите email` ("Enter email");
- a password shorter than 6 characters → `Пароль слишком короткий` ("Password
too short");
- valid credentials → `Добро пожаловать` ("Welcome").

The `page` fixture already opens the page. Find elements only via
`get_by_test_id(...)`: button labels may change, `data-testid` does not.

The message texts are the literal strings the page renders; assertions compare
them exactly.

playwrightuiformsvalidation
test_ui.py Python 3.14
AI mentor

The AI mentor is available after you log in: it sees your attempt history and does not spend resources on anonymous requests.

Log in and ask
Hints 1 of 3 unlocked · attempts: 0
Hint 1

What should appear on the page after a failed attempt? Start with the message,
not the button.

Hint 2 — unlocks after 1 attempt
Hint 3 — unlocks after 3 attempts