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

56 lines
2.3 KiB
TypeScript
Raw Normal View History

2024-11-19 11:33:42 +01:00
import { test } from "@playwright/test";
2024-11-18 09:30:23 +01:00
2024-11-19 11:33:42 +01:00
test("username, password and email otp login, enter code manually", async ({ page }) => {
2024-11-19 16:19:45 +01:00
// Given email otp is enabled on the organization of the user
2024-11-18 18:01:47 +01:00
// Given the user has only email otp configured as second factor
// User enters username
// User enters password
// User receives an email with a verification code
// User enters the code into the ui
// User is redirected to the app (default redirect url)
2024-11-18 09:30:23 +01:00
});
2024-11-19 11:33:42 +01:00
test("username, password and email otp login, click link in email", async ({ page }) => {
2024-11-19 16:19:45 +01:00
// Given email otp is enabled on the organization of the user
2024-11-18 18:01:47 +01:00
// Given the user has only email otp configured as second factor
// User enters username
// User enters password
// User receives an email with a verification code
// User clicks link in the email
// User is redirected to the app (default redirect url)
2024-11-18 09:30:23 +01:00
});
2024-11-19 11:33:42 +01:00
test("username, password and email otp login, resend code", async ({ page }) => {
2024-11-19 16:19:45 +01:00
// Given email otp is enabled on the organization of the user
2024-11-18 18:01:47 +01:00
// Given the user has only email otp configured as second factor
// User enters username
// User enters password
// User receives an email with a verification code
// User clicks resend code
// User receives a new email with a verification code
// User enters the new code in the ui
// User is redirected to the app (default redirect url)
2024-11-18 09:30:23 +01:00
});
2024-11-19 11:33:42 +01:00
test("username, password and email otp login, wrong code", async ({ page }) => {
2024-11-19 16:19:45 +01:00
// Given email otp is enabled on the organization of the user
2024-11-18 18:01:47 +01:00
// Given the user has only email otp configured as second factor
// User enters username
// User enters password
// User receives an email with a verification code
// User enters a wrond code
// Error message - "Invalid code" is shown
2024-11-18 09:30:23 +01:00
});
2024-11-19 11:33:42 +01:00
test("username, password and email otp login, multiple mfa options", async ({ page }) => {
2024-11-19 16:19:45 +01:00
// Given email otp and sms otp is enabled on the organization of the user
2024-11-18 18:01:47 +01:00
// Given the user has email and sms otp configured as second factor
// User enters username
// User enters password
// User receives an email with a verification code
// User clicks button to use sms otp as second factor
// User receives an sms with a verification code
// User enters code in ui
// User is redirected to the app (default redirect url)
2024-11-18 09:30:23 +01:00
});