IntermediatePW-MFA-00225 minutesPlaywright

Verify a role-aware OTP challenge

Manager and Admin identities expose a required MFA policy while lower-privilege synthetic roles remain optional.

  • authentication
  • api
  • roles

Objective

What to automate

Create an Admin challenge with the public credentials, verify its OTP, and assert both the required policy and signed-in dashboard.

Preconditions and test data

Preconditions

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

Test data

  • username: admin_user
  • password: Practice@123
  • OTP: 480321

Expected result

The challenge reports required MFA and its verified UI session renders the Admin account dashboard.

Progressive hints

Hint 1

Request the MFA challenge before attempting OTP verification.

Hint 2

Read mfaPolicy from the challenge response or visible status, not from a guessed role mapping.

Hint 3

After verification, assert the account dashboard identity.

I’ve tried it — show solution
  1. Request the MFA challenge before attempting OTP verification.
  2. Read mfaPolicy from the challenge response or visible status, not from a guessed role mapping.
  3. After verification, assert the account dashboard identity.

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