IntermediatePW-MFA-00325 minutesPlaywright

Assert an expired MFA challenge

The explicit expired scenario creates a challenge already outside its fixed five-minute lifetime, so no timer or sleep is required.

  • authentication
  • api
  • error-recovery

Objective

What to automate

Request the expired scenario and verify it with the documented OTP.

Preconditions and test data

Preconditions

  • Use a fresh isolated Practice Lab browser context.
  • Open the fixture identified by FX-AUTH-001.

Test data

  • scenario: expired
  • OTP: 480321
  • expected code: MFA_CHALLENGE_EXPIRED

Expected result

Verification returns the controlled MFA_CHALLENGE_EXPIRED error and does not create a UI session.

Progressive hints

Hint 1

Select the documented expired scenario instead of waiting five minutes.

Hint 2

Keep the OTP valid so expiry is the only failing condition.

Hint 3

Assert the named error code and lack of authenticated state.

I’ve tried it — show solution
  1. Select the documented expired scenario instead of waiting five minutes.
  2. Keep the OTP valid so expiry is the only failing condition.
  3. Assert the named error code and lack of authenticated state.

The deliberately failing starter is in tests/mfa.spec.ts inside the TypeScript starter ZIP.