mirror of
https://github.com/zitadel/zitadel.git
synced 2025-12-12 06:42:59 +00:00
Merge remote-tracking branch 'origin/acceptance-test-suite' into acceptance-test-suite
# Conflicts: # acceptance/tests/idp-apple.spec.ts # acceptance/tests/idp-generic-jwt.spec.ts # acceptance/tests/idp-generic-oauth.spec.ts # acceptance/tests/idp-generic-oidc.spec.ts # acceptance/tests/idp-github-enterprise.spec.ts # acceptance/tests/idp-github.spec.ts # acceptance/tests/idp-gitlab-self-hosted.spec.ts # acceptance/tests/idp-gitlab.spec.ts # acceptance/tests/idp-google.spec.ts # acceptance/tests/idp-ldap.spec.ts # acceptance/tests/idp-microsoft.spec.ts # acceptance/tests/idp-saml.spec.ts # acceptance/tests/login-configuration-possiblities.spec.ts
This commit is contained in:
@@ -1,152 +1,91 @@
|
||||
import {test as base} from "@playwright/test";
|
||||
import {OtpType, PasswordUserWithOTP} from './user';
|
||||
import path from 'path';
|
||||
import dotenv from 'dotenv';
|
||||
import {loginScreenExpect, loginWithPassword} from "./login";
|
||||
import {startSink} from "./otp";
|
||||
import test from "@playwright/test";
|
||||
|
||||
// Read from ".env" file.
|
||||
dotenv.config({path: path.resolve(__dirname, '.env.local')});
|
||||
|
||||
const test = base.extend<{ user: PasswordUserWithOTP }>({
|
||||
user: async ({page}, use) => {
|
||||
const user = new PasswordUserWithOTP({
|
||||
email: "otp_sms@example.com",
|
||||
firstName: "first",
|
||||
lastName: "last",
|
||||
password: "Password1!",
|
||||
organization: "",
|
||||
type: OtpType.sms,
|
||||
});
|
||||
|
||||
await user.ensure(page);
|
||||
await use(user);
|
||||
},
|
||||
test("login with Generic OAuth IDP", async ({ page }) => {
|
||||
// Given a Generic OAuth IDP is configured on the organization
|
||||
// Given the user has Generic OAuth IDP added as auth method
|
||||
// User authenticates with the Generic OAuth IDP
|
||||
// User is redirected back to login
|
||||
// User is redirected to the app
|
||||
});
|
||||
|
||||
|
||||
test("login with Generic OAuth IDP - auto redirect", async ({user, page}) => {
|
||||
// Given idp Generic OAuth is configure on the organization as only authencation method
|
||||
// Given the user has only idp Generic OAuth added as auth method
|
||||
|
||||
// User is automatically redirected to Generic OAuth
|
||||
// User authenticates in Generic OAuth
|
||||
// User is redirect to ZITADEL login
|
||||
// User is redirected to the app (default redirect url)
|
||||
test("login with Generic OAuth IDP - error", async ({ page }) => {
|
||||
// Given the Generic OAuth IDP is configured on the organization
|
||||
// Given the user has Generic OAuth IDP added as auth method
|
||||
// User is redirected to the Generic OAuth IDP
|
||||
// User authenticates with the Generic OAuth IDP and gets an error
|
||||
// User is redirected back to login
|
||||
// An error is shown to the user "Something went wrong"
|
||||
});
|
||||
|
||||
|
||||
test("login with Generic OAuth IDP - auto redirect, error", async ({user, page}) => {
|
||||
// Given idp Generic OAuth is configure on the organization as only authencation method
|
||||
// Given the user has only idp Generic OAuth added as auth method
|
||||
|
||||
// User is automatically redirected to Generic OAuth
|
||||
// User authenticates in Generic OAuth and gets an error
|
||||
// User is redirect to ZITADEL login
|
||||
// Error is shown to the user "Something went wrong in Generic OAuth Login"
|
||||
test("login with Generic OAuth IDP, no user existing - auto register", async ({ page }) => {
|
||||
// Given idp Generic OAuth is configure on the organization as only authencation method
|
||||
// Given idp Generic OAuth is configure with account creation alloweed, and automatic creation enabled
|
||||
// Given no user exists yet
|
||||
// User is automatically redirected to Generic OAuth
|
||||
// User authenticates in Generic OAuth
|
||||
// User is redirect to ZITADEL login
|
||||
// User is created in ZITADEL
|
||||
// User is redirected to the app (default redirect url)
|
||||
});
|
||||
|
||||
|
||||
test("login with Generic OAuth IDP", async ({user, page}) => {
|
||||
// Given username password and idp Generic OAuth is configure on the organization as authencation method
|
||||
// Given the user has username password and Generic OAuth configured
|
||||
|
||||
// Login form shows username field and a Generic OAuth Login button
|
||||
// User clicks on the Generic OAuth button
|
||||
// User is redirected to Generic OAuth
|
||||
// User authenticates in Generic OAuth and gets an error
|
||||
// User is redirect to ZITADEL login automatically
|
||||
// User is redirected to app automatically (default redirect url)
|
||||
test("login with Generic OAuth IDP, no user existing - auto register not possible", async ({ page }) => {
|
||||
// Given idp Generic OAuth is configure on the organization as only authencation method
|
||||
// Given idp Generic OAuth is configure with account creation alloweed, and automatic creation enabled
|
||||
// Given no user exists yet
|
||||
// User is automatically redirected to Generic OAuth
|
||||
// User authenticates in Generic OAuth
|
||||
// User is redirect to ZITADEL login
|
||||
// Because of missing informaiton on the user auto creation is not possible
|
||||
// User will see the registration page with pre filled user information
|
||||
// User fills missing information
|
||||
// User clicks register button
|
||||
// User is created in ZITADEL
|
||||
// User is redirected to the app (default redirect url)
|
||||
});
|
||||
|
||||
|
||||
test("login with Generic OAuth IDP, error", async ({user, page}) => {
|
||||
// Given username password and idp Generic OAuth is configure on the organization as authencation method
|
||||
// Given the user has username password and Generic OAuth configured
|
||||
|
||||
// Login form shows username field and a Generic OAuth Login button
|
||||
// User clicks on the Generic OAuth button
|
||||
// User is redirected to Generic OAuth
|
||||
// User authenticates in Generic OAuth and gets an error
|
||||
// User is redirect to ZITADEL login
|
||||
// Error is shown to the user "Something went wrong in Generic OAuth Login"
|
||||
// User can choose password for authentication
|
||||
test("login with Generic OAuth IDP, no user existing - auto register enabled - manual creation disabled, creation not possible", async ({
|
||||
page,
|
||||
}) => {
|
||||
// Given idp Generic OAuth is configure on the organization as only authencation method
|
||||
// Given idp Generic OAuth is configure with account creation not allowed, and automatic creation enabled
|
||||
// Given no user exists yet
|
||||
// User is automatically redirected to Generic OAuth
|
||||
// User authenticates in Generic OAuth
|
||||
// User is redirect to ZITADEL login
|
||||
// Because of missing informaiton on the user auto creation is not possible
|
||||
// Error message is shown, that registration of the user was not possible due to missing information
|
||||
});
|
||||
|
||||
test("login with Generic OAuth IDP, no user existing - auto register", async ({user, page}) => {
|
||||
// Given idp Generic OAuth is configure on the organization as only authencation method
|
||||
// Given idp Generic OAuth is configure with account creation alloweed, and automatic creation enabled
|
||||
// Given no user exists yet
|
||||
|
||||
// User is automatically redirected to Generic OAuth
|
||||
// User authenticates in Generic OAuth
|
||||
// User is redirect to ZITADEL login
|
||||
// User is created in ZITADEL
|
||||
// User is redirected to the app (default redirect url)
|
||||
test("login with Generic OAuth IDP, no user linked - auto link", async ({ page }) => {
|
||||
// Given idp Generic OAuth is configure on the organization as only authencation method
|
||||
// Given idp Generic OAuth is configure with account linking allowed, and linking set to existing email
|
||||
// Given user with email address user@zitadel.com exists
|
||||
// User is automatically redirected to Generic OAuth
|
||||
// User authenticates in Generic OAuth with user@zitadel.com
|
||||
// User is redirect to ZITADEL login
|
||||
// User is linked with existing user in ZITADEL
|
||||
// User is redirected to the app (default redirect url)
|
||||
});
|
||||
|
||||
test("login with Generic OAuth IDP, no user existing - auto register not possible", async ({user, page}) => {
|
||||
// Given idp Generic OAuth is configure on the organization as only authencation method
|
||||
// Given idp Generic OAuth is configure with account creation alloweed, and automatic creation enabled
|
||||
// Given no user exists yet
|
||||
|
||||
// User is automatically redirected to Generic OAuth
|
||||
// User authenticates in Generic OAuth
|
||||
// User is redirect to ZITADEL login
|
||||
// Because of missing informaiton on the user auto creation is not possible
|
||||
// User will see the registration page with pre filled user information
|
||||
// User fills missing information
|
||||
// User clicks register button
|
||||
// User is created in ZITADEL
|
||||
// User is redirected to the app (default redirect url)
|
||||
test("login with Generic OAuth IDP, no user linked, linking not possible", async ({ page }) => {
|
||||
// Given idp Generic OAuth is configure on the organization as only authencation method
|
||||
// Given idp Generic OAuth is configure with manually account linking not allowed, and linking set to existing email
|
||||
// Given user with email address user@zitadel.com doesn't exists
|
||||
// User is automatically redirected to Generic OAuth
|
||||
// User authenticates in Generic OAuth with user@zitadel.com
|
||||
// User is redirect to ZITADEL login
|
||||
// User with email address user@zitadel.com can not be found
|
||||
// User will get an error message that account linking wasn't possible
|
||||
});
|
||||
|
||||
test("login with Generic OAuth IDP, no user existing - auto register enabled - manual creation disabled, creation not possible", async ({user, page}) => {
|
||||
// Given idp Generic OAuth is configure on the organization as only authencation method
|
||||
// Given idp Generic OAuth is configure with account creation not allowed, and automatic creation enabled
|
||||
// Given no user exists yet
|
||||
|
||||
// User is automatically redirected to Generic OAuth
|
||||
// User authenticates in Generic OAuth
|
||||
// User is redirect to ZITADEL login
|
||||
// Because of missing informaiton on the user auto creation is not possible
|
||||
// Error message is shown, that registration of the user was not possible due to missing information
|
||||
});
|
||||
|
||||
test("login with Generic OAuth IDP, no user linked - auto link", async ({user, page}) => {
|
||||
// Given idp Generic OAuth is configure on the organization as only authencation method
|
||||
// Given idp Generic OAuth is configure with account linking allowed, and linking set to existing email
|
||||
// Given user with email address user@zitadel.com exists
|
||||
|
||||
// User is automatically redirected to Generic OAuth
|
||||
// User authenticates in Generic OAuth with user@zitadel.com
|
||||
// User is redirect to ZITADEL login
|
||||
// User is linked with existing user in ZITADEL
|
||||
// User is redirected to the app (default redirect url)
|
||||
});
|
||||
|
||||
test("login with Generic OAuth IDP, no user linked, linking not possible", async ({user, page}) => {
|
||||
// Given idp Generic OAuth is configure on the organization as only authencation method
|
||||
// Given idp Generic OAuth is configure with manually account linking not allowed, and linking set to existing email
|
||||
// Given user with email address user@zitadel.com doesn't exists
|
||||
|
||||
// User is automatically redirected to Generic OAuth
|
||||
// User authenticates in Generic OAuth with user@zitadel.com
|
||||
// User is redirect to ZITADEL login
|
||||
// User with email address user@zitadel.com can not be found
|
||||
// User will get an error message that account linking wasn't possible
|
||||
});
|
||||
|
||||
|
||||
test("login with Generic OAuth IDP, no user linked, linking successful", async ({user, page}) => {
|
||||
// Given idp Generic OAuth is configure on the organization as only authencation method
|
||||
// Given idp Generic OAuth is configure with manually account linking allowed, and linking set to existing email
|
||||
// Given user with email address user@zitadel.com doesn't exists
|
||||
|
||||
// User is automatically redirected to Generic OAuth
|
||||
// User authenticates in Generic OAuth with user@zitadel.com
|
||||
// User is redirect to ZITADEL login
|
||||
// User with email address user@zitadel.com can not be found
|
||||
// User is prompted to link the account manually
|
||||
// User is redirected to the app (default redirect url)
|
||||
test("login with Generic OAuth IDP, no user linked, linking successful", async ({ page }) => {
|
||||
// Given idp Generic OAuth is configure on the organization as only authencation method
|
||||
// Given idp Generic OAuth is configure with manually account linking allowed, and linking set to existing email
|
||||
// Given user with email address user@zitadel.com doesn't exists
|
||||
// User is automatically redirected to Generic OAuth
|
||||
// User authenticates in Generic OAuth with user@zitadel.com
|
||||
// User is redirect to ZITADEL login
|
||||
// User with email address user@zitadel.com can not be found
|
||||
// User is prompted to link the account manually
|
||||
// User is redirected to the app (default redirect url)
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user