Toast with a timeout
The page has a `Показать уведомление` ("Show notification") button. A click
shows a toast `Файл сохранён` ("File saved") in the bottom-right corner; it
disappears on its own after 3 seconds.
Contract:
- a click adds a toast with the text `Файл сохранён`;
- after 3000 ms the toast is removed from the DOM; at 2999 ms it is still
visible;
- while the pointer is over the toast the timer is paused; after the pointer
leaves, the timer counts down the remaining time instead of restarting;
- a close button with `aria-label="Закрыть уведомление"` ("Close notification")
removes the toast immediately;
- several clicks produce several toasts, each with its own timer; toasts
created together disappear together;
- the `toasts` container has `aria-live="polite"`, each toast has
`role="status"`.
Write Playwright tests:
- appearance and text;
- auto-hide at the 2999/3000 ms boundary;
- pause on hover;
- remaining time preserved after hover;
- closing with the button;
- several toasts;
- `aria-live` and `role="status"`.
Make time deterministic: `page.clock.install(time=...)` and
`page.clock.pause_at(...)` before the click, then `page.clock.fast_forward(...)`
instead of `sleep`.
Elements: `show`, `toasts`, `toast`, `toast-close` — via `get_by_test_id`.
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 askHint 1
How do you check that a toast disappears after three seconds without actually
waiting those seconds?