Playwright · Senior · Question 13 of 77
How can E2E tests handle two-factor authentication with a TOTP app?
- 1Ask a team member to type the code during the CI run
- 2Turn off 2FA in production so tests can pass
- 3Store a test TOTP secret and generate codes in the test
Show the answer
Correct answer: Store a test TOTP secret and generate codes in the test
Explanation
With the test account's secret, a library like otpauth computes the current code, so the flow is tested end to end.