Playwright

Handle token expiry mid-session

Expert190 pts
  • Session Expiry
  • Token Refresh
  • Logout Flow
Practice app · Acme Ops

A sign-in page with field validation and an authenticated dashboard.

Test URL
/lab/qa-automation-handle-token-expiry-mid-session

Your starter code already declares TEST_URL — never hardcode a host.

Objective

Test application handling of expired authentication tokens and verify redirection to login.

Your Task

  1. 1Navigate to the sign-in page at TEST_URL.
  2. 2Sign in with 'qa@target.dev' and 'Test@123'.
  3. 3Assert that the dashboard container (#dashboard) is visible.
  4. 4Click the logout button (#logout-button) to simulate session invalidation.
  5. 5Assert that the email input field (#username) is visible again upon returning to the sign-in screen.

Validation Checks

  • Signs in and validates session invalidation/logout
  • Returns to sign-in screen (#username is visible)
  • At least 2 assertions pass

Fixtures

username
qa@target.dev
password
Test@123

Playwright · QA Automation Practice Track · Authentication & storage state