mirror of
https://github.com/zitadel/zitadel.git
synced 2025-12-11 22:02:26 +00:00
chore: fixes to tests
This commit is contained in:
@@ -101,7 +101,7 @@ test("login with Apple IDP, no user linked - auto link", async ({user, page}) =>
|
||||
// User is redirected to the app (default redirect url)
|
||||
});
|
||||
|
||||
test("login with Apple IDP, no user linked, user doesn't exist - no auto link", async ({user, page}) => {
|
||||
test("login with Apple IDP, no user linked, linking not possible", async ({user, page}) => {
|
||||
// Given idp Apple is configure on the organization as only authencation method
|
||||
// Given idp Apple 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
|
||||
@@ -114,7 +114,7 @@ test("login with Apple IDP, no user linked, user doesn't exist - no auto link",
|
||||
});
|
||||
|
||||
|
||||
test("login with Apple IDP, no user linked, user doesn't exist - no auto link", async ({user, page}) => {
|
||||
test("login with Apple IDP, no user linked, user link successful", async ({user, page}) => {
|
||||
// Given idp Apple is configure on the organization as only authencation method
|
||||
// Given idp Apple is configure with manually account linking allowed, and linking set to existing email
|
||||
// Given user with email address user@zitadel.com doesn't exists
|
||||
|
||||
@@ -58,7 +58,7 @@ test("login with Generic JWT IDP", async ({user, page}) => {
|
||||
// User is redirected to app automatically (default redirect url)
|
||||
});
|
||||
|
||||
|
||||
|
||||
test("login with Generic JWT IDP, error", async ({user, page}) => {
|
||||
// Given username password and idp Generic JWT is configure on the organization as authencation method
|
||||
// Given the user has username password and Generic JWT configured
|
||||
@@ -124,7 +124,7 @@ test("login with Generic JWT IDP, no user linked - auto link", async ({user, pag
|
||||
// User is redirected to the app (default redirect url)
|
||||
});
|
||||
|
||||
test("login with Generic JWT IDP, no user linked, user doesn't exist - no auto link", async ({user, page}) => {
|
||||
test("login with Generic JWT IDP, no user linked, linking not possible", async ({user, page}) => {
|
||||
// Given idp Generic JWT is configure on the organization as only authencation method
|
||||
// Given idp Generic JWT 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
|
||||
@@ -137,7 +137,7 @@ test("login with Generic JWT IDP, no user linked, user doesn't exist - no auto l
|
||||
});
|
||||
|
||||
|
||||
test("login with Generic JWT IDP, no user linked, user doesn't exist - no auto link", async ({user, page}) => {
|
||||
test("login with Generic JWT IDP, no user linked, linking successful", async ({user, page}) => {
|
||||
// Given idp Generic JWT is configure on the organization as only authencation method
|
||||
// Given idp Generic JWT is configure with manually account linking allowed, and linking set to existing email
|
||||
// Given user with email address user@zitadel.com doesn't exists
|
||||
|
||||
@@ -125,7 +125,7 @@ test("login with Generic OAuth IDP, no user linked - auto link", async ({user, p
|
||||
// User is redirected to the app (default redirect url)
|
||||
});
|
||||
|
||||
test("login with Generic OAuth IDP, no user linked, user doesn't exist - no auto link", async ({user, page}) => {
|
||||
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
|
||||
@@ -138,7 +138,7 @@ test("login with Generic OAuth IDP, no user linked, user doesn't exist - no auto
|
||||
});
|
||||
|
||||
|
||||
test("login with Generic OAuth IDP, no user linked, user doesn't exist - no auto link", async ({user, page}) => {
|
||||
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
|
||||
|
||||
@@ -126,7 +126,7 @@ test("login with Generic OIDC IDP, no user linked - auto link", async ({user, pa
|
||||
// User is redirected to the app (default redirect url)
|
||||
});
|
||||
|
||||
test("login with Generic OIDC IDP, no user linked, user doesn't exist - no auto link", async ({user, page}) => {
|
||||
test("login with Generic OIDC IDP, no user linked, linking not possible", async ({user, page}) => {
|
||||
// Given idp Generic OIDC is configure on the organization as only authencation method
|
||||
// Given idp Generic OIDC 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
|
||||
@@ -139,7 +139,7 @@ test("login with Generic OIDC IDP, no user linked, user doesn't exist - no auto
|
||||
});
|
||||
|
||||
|
||||
test("login with Generic OIDC IDP, no user linked, user doesn't exist - no auto link", async ({user, page}) => {
|
||||
test("login with Generic OIDC IDP, no user linked, linking successful", async ({user, page}) => {
|
||||
// Given idp Generic OIDC is configure on the organization as only authencation method
|
||||
// Given idp Generic OIDC is configure with manually account linking allowed, and linking set to existing email
|
||||
// Given user with email address user@zitadel.com doesn't exists
|
||||
|
||||
@@ -127,7 +127,7 @@ test("login with GitHub Enterprise IDP, no user linked - auto link", async ({use
|
||||
// User is redirected to the app (default redirect url)
|
||||
});
|
||||
|
||||
test("login with GitHub Enterprise IDP, no user linked, user doesn't exist - no auto link", async ({user, page}) => {
|
||||
test("login with GitHub Enterprise IDP, no user linked, linking not possible", async ({user, page}) => {
|
||||
// Given idp GitHub Enterprise is configure on the organization as only authencation method
|
||||
// Given idp GitHub Enterprise is configure with manually account linking not allowed, and linking set to existing email
|
||||
// Given ZITADEL Action is added to autofill missing user information
|
||||
@@ -141,7 +141,7 @@ test("login with GitHub Enterprise IDP, no user linked, user doesn't exist - no
|
||||
});
|
||||
|
||||
|
||||
test("login with GitHub Enterprise IDP, no user linked, user doesn't exist - no auto link", async ({user, page}) => {
|
||||
test("login with GitHub Enterprise IDP, no user linked, linking successful", async ({user, page}) => {
|
||||
// Given idp GitHub Enterprise is configure on the organization as only authencation method
|
||||
// Given idp GitHub Enterprise is configure with manually account linking allowed, and linking set to existing email
|
||||
// Given ZITADEL Action is added to autofill missing user information
|
||||
|
||||
@@ -127,7 +127,7 @@ test("login with GitHub IDP, no user linked - auto link", async ({user, page}) =
|
||||
// User is redirected to the app (default redirect url)
|
||||
});
|
||||
|
||||
test("login with GitHub IDP, no user linked, user doesn't exist - no auto link", async ({user, page}) => {
|
||||
test("login with GitHub IDP, no user linked, linking not possible", async ({user, page}) => {
|
||||
// Given idp GitHub is configure on the organization as only authencation method
|
||||
// Given idp GitHub is configure with manually account linking not allowed, and linking set to existing email
|
||||
// Given ZITADEL Action is added to autofill missing user information
|
||||
@@ -141,7 +141,7 @@ test("login with GitHub IDP, no user linked, user doesn't exist - no auto link",
|
||||
});
|
||||
|
||||
|
||||
test("login with GitHub IDP, no user linked, user doesn't exist - no auto link", async ({user, page}) => {
|
||||
test("login with GitHub IDP, no user linked, linking successful", async ({user, page}) => {
|
||||
// Given idp GitHub is configure on the organization as only authencation method
|
||||
// Given idp GitHub is configure with manually account linking allowed, and linking set to existing email
|
||||
// Given ZITADEL Action is added to autofill missing user information
|
||||
|
||||
@@ -127,7 +127,7 @@ test("login with Gitlab Self-Hosted IDP, no user linked - auto link", async ({us
|
||||
// User is redirected to the app (default redirect url)
|
||||
});
|
||||
|
||||
test("login with Gitlab Self-Hosted IDP, no user linked, user doesn't exist - no auto link", async ({user, page}) => {
|
||||
test("login with Gitlab Self-Hosted IDP, no user linked, linking not possible", async ({user, page}) => {
|
||||
// Given idp Gitlab Self-Hosted is configure on the organization as only authencation method
|
||||
// Given idp Gitlab Self-Hosted is configure with manually account linking not allowed, and linking set to existing email
|
||||
// Given ZITADEL Action is added to autofill missing user information
|
||||
@@ -141,7 +141,7 @@ test("login with Gitlab Self-Hosted IDP, no user linked, user doesn't exist - no
|
||||
});
|
||||
|
||||
|
||||
test("login with Gitlab Self-Hosted IDP, no user linked, user doesn't exist - no auto link", async ({user, page}) => {
|
||||
test("login with Gitlab Self-Hosted IDP, no user linked, linking successful", async ({user, page}) => {
|
||||
// Given idp Gitlab Self-Hosted is configure on the organization as only authencation method
|
||||
// Given idp Gitlab Self-Hosted is configure with manually account linking allowed, and linking set to existing email
|
||||
// Given ZITADEL Action is added to autofill missing user information
|
||||
|
||||
@@ -127,7 +127,7 @@ test("login with Gitlab IDP, no user linked - auto link", async ({user, page}) =
|
||||
// User is redirected to the app (default redirect url)
|
||||
});
|
||||
|
||||
test("login with Gitlab IDP, no user linked, user doesn't exist - no auto link", async ({user, page}) => {
|
||||
test("login with Gitlab IDP, no user linked, linking not possible", async ({user, page}) => {
|
||||
// Given idp Gitlab is configure on the organization as only authencation method
|
||||
// Given idp Gitlab is configure with manually account linking not allowed, and linking set to existing email
|
||||
// Given ZITADEL Action is added to autofill missing user information
|
||||
@@ -141,7 +141,7 @@ test("login with Gitlab IDP, no user linked, user doesn't exist - no auto link",
|
||||
});
|
||||
|
||||
|
||||
test("login with Gitlab IDP, no user linked, user doesn't exist - no auto link", async ({user, page}) => {
|
||||
test("login with Gitlab IDP, no user linked, linking successful", async ({user, page}) => {
|
||||
// Given idp Gitlab is configure on the organization as only authencation method
|
||||
// Given idp Gitlab is configure with manually account linking allowed, and linking set to existing email
|
||||
// Given ZITADEL Action is added to autofill missing user information
|
||||
|
||||
@@ -124,7 +124,7 @@ test("login with Google IDP, no user linked - auto link", async ({user, page}) =
|
||||
// User is redirected to the app (default redirect url)
|
||||
});
|
||||
|
||||
test("login with Google IDP, no user linked, user doesn't exist - no auto link", async ({user, page}) => {
|
||||
test("login with Google IDP, no user linked, linking not possible", async ({user, page}) => {
|
||||
// Given idp Google is configure on the organization as only authencation method
|
||||
// Given idp Google 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
|
||||
@@ -137,7 +137,7 @@ test("login with Google IDP, no user linked, user doesn't exist - no auto link",
|
||||
});
|
||||
|
||||
|
||||
test("login with Google IDP, no user linked, user doesn't exist - no auto link", async ({user, page}) => {
|
||||
test("login with Google IDP, no user linked, linking successful", async ({user, page}) => {
|
||||
// Given idp Google is configure on the organization as only authencation method
|
||||
// Given idp Google is configure with manually account linking allowed, and linking set to existing email
|
||||
// Given user with email address user@zitadel.com doesn't exists
|
||||
|
||||
@@ -124,7 +124,7 @@ test("login with LDAP IDP, no user linked - auto link", async ({user, page}) =>
|
||||
// User is redirected to the app (default redirect url)
|
||||
});
|
||||
|
||||
test("login with LDAP IDP, no user linked, user doesn't exist - no auto link", async ({user, page}) => {
|
||||
test("login with LDAP IDP, no user linked, linking not possible", async ({user, page}) => {
|
||||
// Given idp LDAP is configure on the organization as only authencation method
|
||||
// Given idp LDAP 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
|
||||
@@ -137,7 +137,7 @@ test("login with LDAP IDP, no user linked, user doesn't exist - no auto link", a
|
||||
});
|
||||
|
||||
|
||||
test("login with LDAP IDP, no user linked, user doesn't exist - no auto link", async ({user, page}) => {
|
||||
test("login with LDAP IDP, no user linked, linking successful", async ({user, page}) => {
|
||||
// Given idp LDAP is configure on the organization as only authencation method
|
||||
// Given idp LDAP is configure with manually account linking allowed, and linking set to existing email
|
||||
// Given user with email address user@zitadel.com doesn't exists
|
||||
|
||||
@@ -127,7 +127,7 @@ test("login with Microsoft IDP, no user linked - auto link", async ({user, page}
|
||||
// User is redirected to the app (default redirect url)
|
||||
});
|
||||
|
||||
test("login with Microsoft IDP, no user linked, user doesn't exist - no auto link", async ({user, page}) => {
|
||||
test("login with Microsoft IDP, no user linked, linking not possible", async ({user, page}) => {
|
||||
// Given idp Microsoft is configure on the organization as only authencation method
|
||||
// Given idp Microsoft 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
|
||||
@@ -140,7 +140,7 @@ test("login with Microsoft IDP, no user linked, user doesn't exist - no auto lin
|
||||
});
|
||||
|
||||
|
||||
test("login with Microsoft IDP, no user linked, user doesn't exist - no auto link", async ({user, page}) => {
|
||||
test("login with Microsoft IDP, no user linked, linking successful", async ({user, page}) => {
|
||||
// Given idp Microsoft is configure on the organization as only authencation method
|
||||
// Given idp Microsoft is configure with manually account linking allowed, and linking set to existing email
|
||||
// Given user with email address user@zitadel.com doesn't exists
|
||||
|
||||
@@ -128,7 +128,7 @@ test("login with SAML IDP, no user linked - auto link", async ({user, page}) =>
|
||||
// User is redirected to the app (default redirect url)
|
||||
});
|
||||
|
||||
test("login with SAML IDP, no user linked, user doesn't exist - no auto link", async ({user, page}) => {
|
||||
test("login with SAML IDP, no user linked, linking not possible", async ({user, page}) => {
|
||||
// Given idp SAML is configure on the organization as only authencation method
|
||||
// Given idp SAML is configure with manually account linking not allowed, and linking set to existing email
|
||||
// Given ZITADEL Action is added to autofill missing user information
|
||||
@@ -142,7 +142,7 @@ test("login with SAML IDP, no user linked, user doesn't exist - no auto link", a
|
||||
});
|
||||
|
||||
|
||||
test("login with SAML IDP, no user linked, user doesn't exist - no auto link", async ({user, page}) => {
|
||||
test("login with SAML IDP, no user linked, linking successful", async ({user, page}) => {
|
||||
// Given idp SAML is configure on the organization as only authencation method
|
||||
// Given idp SAML is configure with manually account linking allowed, and linking set to existing email
|
||||
// Given ZITADEL Action is added to autofill missing user information
|
||||
|
||||
@@ -73,7 +73,7 @@ test("login with mfa setup, force mfa - external user", async ({user, page}) =>
|
||||
});
|
||||
|
||||
|
||||
test("login with mfa setup, force mfa - external user", async ({user, page}) => {
|
||||
test("login with mfa setup, force mfa - local user, wrong password", async ({user, page}) => {
|
||||
// Given the organization has a password lockout policy set to 1 on the max password attempts
|
||||
// Given the user has only a password as auth methos
|
||||
|
||||
|
||||
@@ -1,47 +1,50 @@
|
||||
import { test as base } from "@playwright/test";
|
||||
import {test as base} from "@playwright/test";
|
||||
import dotenv from "dotenv";
|
||||
import path from "path";
|
||||
import { loginScreenExpect, loginWithPassword } from "./login";
|
||||
import { changePassword, startChangePassword } from "./password";
|
||||
import { changePasswordScreen, changePasswordScreenExpect } from "./password-screen";
|
||||
import { PasswordUser } from "./user";
|
||||
import {loginWithPassword} from "./login";
|
||||
import {startChangePassword} from "./password";
|
||||
import {changePasswordScreen, changePasswordScreenExpect} from "./password-screen";
|
||||
import {PasswordUser} from "./user";
|
||||
|
||||
// Read from ".env" file.
|
||||
dotenv.config({ path: path.resolve(__dirname, ".env.local") });
|
||||
dotenv.config({path: path.resolve(__dirname, ".env.local")});
|
||||
|
||||
const test = base.extend<{ user: PasswordUser }>({
|
||||
user: async ({ page }, use) => {
|
||||
const user = new PasswordUser({
|
||||
email: "password-changed@example.com",
|
||||
firstName: "first",
|
||||
lastName: "last",
|
||||
password: "Password1!",
|
||||
organization: "",
|
||||
});
|
||||
await user.ensure(page);
|
||||
await use(user);
|
||||
},
|
||||
user: async ({page}, use) => {
|
||||
const user = new PasswordUser({
|
||||
email: "password-changed@example.com",
|
||||
firstName: "first",
|
||||
lastName: "last",
|
||||
password: "Password1!",
|
||||
organization: "",
|
||||
});
|
||||
await user.ensure(page);
|
||||
await use(user);
|
||||
},
|
||||
});
|
||||
|
||||
test("username and password changed login", async ({ user, page }) => {
|
||||
const changedPw = "ChangedPw1!";
|
||||
await loginWithPassword(page, user.getUsername(), user.getPassword());
|
||||
test("username and password changed login", async ({user, page}) => {
|
||||
// commented, fix in https://github.com/zitadel/zitadel/pull/8807
|
||||
/*
|
||||
const changedPw = "ChangedPw1!";
|
||||
await loginWithPassword(page, user.getUsername(), user.getPassword());
|
||||
|
||||
// wait for projection of token
|
||||
await page.waitForTimeout(2000);
|
||||
// wait for projection of token
|
||||
await page.waitForTimeout(2000);
|
||||
|
||||
await changePassword(page, user.getUsername(), changedPw);
|
||||
await loginScreenExpect(page, user.getFullName());
|
||||
await changePassword(page, user.getUsername(), changedPw);
|
||||
await loginScreenExpect(page, user.getFullName());
|
||||
|
||||
await loginWithPassword(page, user.getUsername(), changedPw);
|
||||
await loginScreenExpect(page, user.getFullName());
|
||||
await loginWithPassword(page, user.getUsername(), changedPw);
|
||||
await loginScreenExpect(page, user.getFullName());
|
||||
*/
|
||||
});
|
||||
|
||||
test("password not with desired complexity", async ({ user, page }) => {
|
||||
const changedPw1 = "change";
|
||||
const changedPw2 = "chang";
|
||||
await loginWithPassword(page, user.getUsername(), user.getPassword());
|
||||
await startChangePassword(page, user.getUsername());
|
||||
await changePasswordScreen(page, changedPw1, changedPw2);
|
||||
await changePasswordScreenExpect(page, changedPw1, changedPw2, false, false, false, false, true, false);
|
||||
test("password not with desired complexity", async ({user, page}) => {
|
||||
const changedPw1 = "change";
|
||||
const changedPw2 = "chang";
|
||||
await loginWithPassword(page, user.getUsername(), user.getPassword());
|
||||
await startChangePassword(page, user.getUsername());
|
||||
await changePasswordScreen(page, changedPw1, changedPw2);
|
||||
await changePasswordScreenExpect(page, changedPw1, changedPw2, false, false, false, false, true, false);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user