Files
zitadel/acceptance/tests/username-password-totp.spec.ts

35 lines
1.4 KiB
TypeScript
Raw Normal View History

2024-11-19 11:33:42 +01:00
import { test } from "@playwright/test";
2024-11-18 10:36:13 +01:00
2024-11-19 11:33:42 +01:00
test("username, password and totp login", async ({ page }) => {
2024-11-19 16:19:45 +01:00
// Given totp is enabled on the organization of the user
2024-11-18 18:01:47 +01:00
// Given the user has only totp configured as second factor
// User enters username
// User enters password
// Screen for entering the code is shown directly
// User enters the code into the ui
// User is redirected to the app (default redirect url)
2024-11-18 10:36:13 +01:00
});
2024-11-19 11:33:42 +01:00
test("username, password and totp otp login, wrong code", async ({ page }) => {
2024-11-19 16:19:45 +01:00
// Given totp is enabled on the organization of the user
2024-11-18 18:01:47 +01:00
// Given the user has only totp configured as second factor
// User enters username
// User enters password
// Screen for entering the code is shown directly
// User enters a wrond code
// Error message - "Invalid code" is shown
2024-11-18 10:36:13 +01:00
});
2024-11-19 11:33:42 +01:00
test("username, password and totp login, multiple mfa options", async ({ page }) => {
2024-11-19 16:19:45 +01:00
// Given totp and email otp is enabled on the organization of the user
2024-11-18 18:01:47 +01:00
// Given the user has totp and email otp configured as second factor
// User enters username
// User enters password
// Screen for entering the code is shown directly
// Button to switch to email otp is shown
// User clicks button to use email otp instead
// User receives an email with a verification code
// User enters code in ui
// User is redirected to the app (default redirect url)
2024-11-18 10:36:13 +01:00
});