mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-11 15:49:35 +00:00
timeouts
This commit is contained in:
@@ -14,5 +14,5 @@
|
|||||||
3001
|
3001
|
||||||
],
|
],
|
||||||
"onCreateCommand": "pnpm install --filter . --filter @zitadel/login; cd apps/login; pnpm cypress install",
|
"onCreateCommand": "pnpm install --filter . --filter @zitadel/login; cd apps/login; pnpm cypress install",
|
||||||
"postAttachCommand": "pnpm turbo daemon clean || true; pnpm turbo watch test:integration:login"
|
"postAttachCommand": "pnpm turbo daemon clean || true; pnpm turbo watch @zitadel/login#dev test:integration:login"
|
||||||
}
|
}
|
@@ -4,4 +4,4 @@ services:
|
|||||||
extends:
|
extends:
|
||||||
file: ../base/docker-compose.yml
|
file: ../base/docker-compose.yml
|
||||||
service: devcontainer
|
service: devcontainer
|
||||||
network_mode: !reset ""
|
network_mode: service:mock-zitadel
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
NEXT_PUBLIC_BASE_PATH="/ui/v2/login"
|
NEXT_PUBLIC_BASE_PATH="/ui/v2/login"
|
||||||
ZITADEL_API_URL=http://mock-zitadel:22222
|
ZITADEL_API_URL=http://localhost:22222
|
||||||
ZITADEL_SERVICE_USER_TOKEN="yolo"
|
ZITADEL_SERVICE_USER_TOKEN="yolo"
|
||||||
EMAIL_VERIFICATION=true
|
EMAIL_VERIFICATION=true
|
||||||
DEBUG=true
|
DEBUG=true
|
||||||
|
@@ -8,7 +8,8 @@
|
|||||||
!next.config.mjs
|
!next.config.mjs
|
||||||
!next-env-vars.d.ts
|
!next-env-vars.d.ts
|
||||||
!next-env.d.ts
|
!next-env.d.ts
|
||||||
!tailwind.config.js
|
!tailwind.config.mjs
|
||||||
|
!postcss.config.cjs
|
||||||
!tsconfig.json
|
!tsconfig.json
|
||||||
!package.json
|
!package.json
|
||||||
!pnpm-lock.yaml
|
!pnpm-lock.yaml
|
||||||
|
@@ -2,10 +2,15 @@ import { defineConfig } from "cypress";
|
|||||||
|
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
reporter: "list",
|
reporter: "list",
|
||||||
|
video: true,
|
||||||
e2e: {
|
e2e: {
|
||||||
baseUrl: process.env.LOGIN_BASE_URL || "http://localhost:3001/ui/v2/login",
|
baseUrl: process.env.LOGIN_BASE_URL || "http://localhost:3001/ui/v2/login",
|
||||||
specPattern: "integration/integration/**/*.cy.{js,jsx,ts,tsx}",
|
specPattern: "integration/integration/**/*.cy.{js,jsx,ts,tsx}",
|
||||||
supportFile: "integration/support/e2e.{js,jsx,ts,tsx}",
|
supportFile: "integration/support/e2e.{js,jsx,ts,tsx}",
|
||||||
|
responseTimeout: 5 * 60_000, // 5 minutes
|
||||||
|
pageLoadTimeout: 5 * 60_000, // 5 minutes
|
||||||
|
taskTimeout: 5 * 60_000, // 5 minutes
|
||||||
|
defaultCommandTimeout: 60_000, // 1 minute
|
||||||
setupNodeEvents(on, config) {
|
setupNodeEvents(on, config) {
|
||||||
// implement node event listeners here
|
// implement node event listeners here
|
||||||
},
|
},
|
||||||
|
@@ -22,22 +22,22 @@ describe("verify invite", () => {
|
|||||||
user: {
|
user: {
|
||||||
userId: "221394658884845598",
|
userId: "221394658884845598",
|
||||||
state: 1,
|
state: 1,
|
||||||
username: "john@zitadel.com",
|
username: "john@example.com",
|
||||||
loginNames: ["john@zitadel.com"],
|
loginNames: ["john@example.com"],
|
||||||
preferredLoginName: "john@zitadel.com",
|
preferredLoginName: "john@example.com",
|
||||||
human: {
|
human: {
|
||||||
userId: "221394658884845598",
|
userId: "221394658884845598",
|
||||||
state: 1,
|
state: 1,
|
||||||
username: "john@zitadel.com",
|
username: "john@example.com",
|
||||||
loginNames: ["john@zitadel.com"],
|
loginNames: ["john@example.com"],
|
||||||
preferredLoginName: "john@zitadel.com",
|
preferredLoginName: "john@example.com",
|
||||||
profile: {
|
profile: {
|
||||||
givenName: "John",
|
givenName: "John",
|
||||||
familyName: "Doe",
|
familyName: "Doe",
|
||||||
avatarUrl: "https://zitadel.com/avatar.jpg",
|
avatarUrl: "https://example.com/avatar.jpg",
|
||||||
},
|
},
|
||||||
email: {
|
email: {
|
||||||
email: "john@zitadel.com",
|
email: "john@example.com",
|
||||||
isVerified: false,
|
isVerified: false,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -68,7 +68,7 @@ describe("verify invite", () => {
|
|||||||
factors: {
|
factors: {
|
||||||
user: {
|
user: {
|
||||||
id: "221394658884845598",
|
id: "221394658884845598",
|
||||||
loginName: "john@zitadel.com",
|
loginName: "john@example.com",
|
||||||
},
|
},
|
||||||
password: undefined,
|
password: undefined,
|
||||||
webAuthN: undefined,
|
webAuthN: undefined,
|
||||||
@@ -93,7 +93,7 @@ describe("verify invite", () => {
|
|||||||
stub("zitadel.user.v2.UserService", "VerifyInviteCode");
|
stub("zitadel.user.v2.UserService", "VerifyInviteCode");
|
||||||
|
|
||||||
cy.visit("/verify?userId=221394658884845598&code=abc&invite=true");
|
cy.visit("/verify?userId=221394658884845598&code=abc&invite=true");
|
||||||
cy.url({ timeout: 10_000 }).should("include", Cypress.config().baseUrl + "/authenticator/set");
|
cy.url({ timeout: 5 * 60_000 }).should("include", Cypress.config().baseUrl + "/authenticator/set");
|
||||||
});
|
});
|
||||||
|
|
||||||
it("shows an error if invite code validation failed", () => {
|
it("shows an error if invite code validation failed", () => {
|
||||||
|
@@ -33,7 +33,7 @@ describe("login", () => {
|
|||||||
factors: {
|
factors: {
|
||||||
user: {
|
user: {
|
||||||
id: "221394658884845598",
|
id: "221394658884845598",
|
||||||
loginName: "john@zitadel.com",
|
loginName: "john@example.com",
|
||||||
},
|
},
|
||||||
password: undefined,
|
password: undefined,
|
||||||
webAuthN: undefined,
|
webAuthN: undefined,
|
||||||
@@ -64,22 +64,22 @@ describe("login", () => {
|
|||||||
{
|
{
|
||||||
userId: "221394658884845598",
|
userId: "221394658884845598",
|
||||||
state: 1,
|
state: 1,
|
||||||
username: "john@zitadel.com",
|
username: "john@example.com",
|
||||||
loginNames: ["john@zitadel.com"],
|
loginNames: ["john@example.com"],
|
||||||
preferredLoginName: "john@zitadel.com",
|
preferredLoginName: "john@example.com",
|
||||||
human: {
|
human: {
|
||||||
userId: "221394658884845598",
|
userId: "221394658884845598",
|
||||||
state: 1,
|
state: 1,
|
||||||
username: "john@zitadel.com",
|
username: "john@example.com",
|
||||||
loginNames: ["john@zitadel.com"],
|
loginNames: ["john@example.com"],
|
||||||
preferredLoginName: "john@zitadel.com",
|
preferredLoginName: "john@example.com",
|
||||||
profile: {
|
profile: {
|
||||||
givenName: "John",
|
givenName: "John",
|
||||||
familyName: "Doe",
|
familyName: "Doe",
|
||||||
avatarUrl: "https://zitadel.com/avatar.jpg",
|
avatarUrl: "https://example.com/avatar.jpg",
|
||||||
},
|
},
|
||||||
email: {
|
email: {
|
||||||
email: "john@zitadel.com",
|
email: "john@example.com",
|
||||||
isVerified: true,
|
isVerified: true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -94,8 +94,8 @@ describe("login", () => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
it("should redirect a user with password authentication to /password", () => {
|
it("should redirect a user with password authentication to /password", () => {
|
||||||
cy.visit("/loginname?loginName=john%40zitadel.com&submit=true");
|
cy.visit("/loginname?loginName=john%40example.com&submit=true");
|
||||||
cy.url({ timeout: 10_000 }).should("include", Cypress.config().baseUrl + "/password");
|
cy.url({ timeout: 5 * 60_000 }).should("include", Cypress.config().baseUrl + "/password");
|
||||||
});
|
});
|
||||||
describe("with passkey prompt", () => {
|
describe("with passkey prompt", () => {
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
@@ -112,8 +112,8 @@ describe("login", () => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
// it("should prompt a user to setup passwordless authentication if passkey is allowed in the login settings", () => {
|
// it("should prompt a user to setup passwordless authentication if passkey is allowed in the login settings", () => {
|
||||||
// cy.visit("/loginname?loginName=john%40zitadel.com&submit=true");
|
// cy.visit("/loginname?loginName=john%40example.com&submit=true");
|
||||||
// cy.location("pathname", { timeout: 10_000 }).should("eq", "/password");
|
// cy.location("pathname", { timeout: 5 * 60_000 }).should("eq", "/password");
|
||||||
// cy.get('input[type="password"]').focus().type("MyStrongPassword!1");
|
// cy.get('input[type="password"]').focus().type("MyStrongPassword!1");
|
||||||
// cy.get('button[type="submit"]').click();
|
// cy.get('button[type="submit"]').click();
|
||||||
// cy.location("pathname", { timeout: 10_000 }).should(
|
// cy.location("pathname", { timeout: 10_000 }).should(
|
||||||
@@ -134,22 +134,22 @@ describe("login", () => {
|
|||||||
{
|
{
|
||||||
userId: "221394658884845598",
|
userId: "221394658884845598",
|
||||||
state: 1,
|
state: 1,
|
||||||
username: "john@zitadel.com",
|
username: "john@example.com",
|
||||||
loginNames: ["john@zitadel.com"],
|
loginNames: ["john@example.com"],
|
||||||
preferredLoginName: "john@zitadel.com",
|
preferredLoginName: "john@example.com",
|
||||||
human: {
|
human: {
|
||||||
userId: "221394658884845598",
|
userId: "221394658884845598",
|
||||||
state: 1,
|
state: 1,
|
||||||
username: "john@zitadel.com",
|
username: "john@example.com",
|
||||||
loginNames: ["john@zitadel.com"],
|
loginNames: ["john@example.com"],
|
||||||
preferredLoginName: "john@zitadel.com",
|
preferredLoginName: "john@example.com",
|
||||||
profile: {
|
profile: {
|
||||||
givenName: "John",
|
givenName: "John",
|
||||||
familyName: "Doe",
|
familyName: "Doe",
|
||||||
avatarUrl: "https://zitadel.com/avatar.jpg",
|
avatarUrl: "https://example.com/avatar.jpg",
|
||||||
},
|
},
|
||||||
email: {
|
email: {
|
||||||
email: "john@zitadel.com",
|
email: "john@example.com",
|
||||||
isVerified: true,
|
isVerified: true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -165,8 +165,8 @@ describe("login", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("should redirect a user with passwordless authentication to /passkey", () => {
|
it("should redirect a user with passwordless authentication to /passkey", () => {
|
||||||
cy.visit("/loginname?loginName=john%40zitadel.com&submit=true");
|
cy.visit("/loginname?loginName=john%40example.com&submit=true");
|
||||||
cy.url({ timeout: 10_000 }).should("include", Cypress.config().baseUrl + "/passkey");
|
cy.url({ timeout: 5 * 60_000 }).should("include", Cypress.config().baseUrl + "/passkey");
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@@ -48,7 +48,7 @@ describe("register", () => {
|
|||||||
factors: {
|
factors: {
|
||||||
user: {
|
user: {
|
||||||
id: "221394658884845598",
|
id: "221394658884845598",
|
||||||
loginName: "john@zitadel.com",
|
loginName: "john@example.com",
|
||||||
},
|
},
|
||||||
password: undefined,
|
password: undefined,
|
||||||
webAuthN: undefined,
|
webAuthN: undefined,
|
||||||
@@ -64,10 +64,10 @@ describe("register", () => {
|
|||||||
cy.visit("/register");
|
cy.visit("/register");
|
||||||
cy.get('input[data-testid="firstname-text-input"]').focus().type("John");
|
cy.get('input[data-testid="firstname-text-input"]').focus().type("John");
|
||||||
cy.get('input[data-testid="lastname-text-input"]').focus().type("Doe");
|
cy.get('input[data-testid="lastname-text-input"]').focus().type("Doe");
|
||||||
cy.get('input[data-testid="email-text-input"]').focus().type("john@zitadel.com");
|
cy.get('input[data-testid="email-text-input"]').focus().type("john@example.com");
|
||||||
cy.get('input[type="checkbox"][value="privacypolicy"]').check();
|
cy.get('input[type="checkbox"][value="privacypolicy"]').check();
|
||||||
cy.get('input[type="checkbox"][value="tos"]').check();
|
cy.get('input[type="checkbox"][value="tos"]').check();
|
||||||
cy.get('button[type="submit"]').click();
|
cy.get('button[type="submit"]').click();
|
||||||
cy.url({ timeout: 10_000 }).should("include", Cypress.config().baseUrl + "/passkey/set");
|
cy.url({ timeout: 5 * 60_000 }).should("include", Cypress.config().baseUrl + "/passkey/set");
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@@ -24,22 +24,22 @@ describe("verify email", () => {
|
|||||||
user: {
|
user: {
|
||||||
userId: "221394658884845598",
|
userId: "221394658884845598",
|
||||||
state: 1,
|
state: 1,
|
||||||
username: "john@zitadel.com",
|
username: "john@example.com",
|
||||||
loginNames: ["john@zitadel.com"],
|
loginNames: ["john@example.com"],
|
||||||
preferredLoginName: "john@zitadel.com",
|
preferredLoginName: "john@example.com",
|
||||||
human: {
|
human: {
|
||||||
userId: "221394658884845598",
|
userId: "221394658884845598",
|
||||||
state: 1,
|
state: 1,
|
||||||
username: "john@zitadel.com",
|
username: "john@example.com",
|
||||||
loginNames: ["john@zitadel.com"],
|
loginNames: ["john@example.com"],
|
||||||
preferredLoginName: "john@zitadel.com",
|
preferredLoginName: "john@example.com",
|
||||||
profile: {
|
profile: {
|
||||||
givenName: "John",
|
givenName: "John",
|
||||||
familyName: "Doe",
|
familyName: "Doe",
|
||||||
avatarUrl: "https://zitadel.com/avatar.jpg",
|
avatarUrl: "https://example.com/avatar.jpg",
|
||||||
},
|
},
|
||||||
email: {
|
email: {
|
||||||
email: "john@zitadel.com",
|
email: "john@example.com",
|
||||||
isVerified: false, // email is not verified yet
|
isVerified: false, // email is not verified yet
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -70,7 +70,7 @@ describe("verify email", () => {
|
|||||||
factors: {
|
factors: {
|
||||||
user: {
|
user: {
|
||||||
id: "221394658884845598",
|
id: "221394658884845598",
|
||||||
loginName: "john@zitadel.com",
|
loginName: "john@example.com",
|
||||||
},
|
},
|
||||||
password: undefined,
|
password: undefined,
|
||||||
webAuthN: undefined,
|
webAuthN: undefined,
|
||||||
|
@@ -15,7 +15,7 @@
|
|||||||
"test:unit": "vitest --run",
|
"test:unit": "vitest --run",
|
||||||
"lint-staged": "lint-staged",
|
"lint-staged": "lint-staged",
|
||||||
"clean": "rm -rf .turbo && rm -rf node_modules && rm -rf .next",
|
"clean": "rm -rf .turbo && rm -rf node_modules && rm -rf .next",
|
||||||
"test:integration:login": "wait-on http://localhost:3001/ui/v2/login/verify && DISPLAY='' cypress run",
|
"test:integration:login": "wait-on --simultaneous 1 http://localhost:3001/ui/v2/login/verify?userId=221394658884845598&code=abc && DISPLAY='' cypress run",
|
||||||
"test:acceptance": "dotenv -e ../login/.env.test.local playwright",
|
"test:acceptance": "dotenv -e ../login/.env.test.local playwright",
|
||||||
"test:acceptance:setup": "cd ../.. && make login_test_acceptance_setup_env && NODE_ENV=test turbo run test:acceptance:setup:dev",
|
"test:acceptance:setup": "cd ../.. && make login_test_acceptance_setup_env && NODE_ENV=test turbo run test:acceptance:setup:dev",
|
||||||
"test:acceptance:setup:dev": "cd ../.. && make login_test_acceptance_setup_dev"
|
"test:acceptance:setup:dev": "cd ../.. && make login_test_acceptance_setup_dev"
|
||||||
|
@@ -42,9 +42,11 @@
|
|||||||
},
|
},
|
||||||
"test:integration:login": {
|
"test:integration:login": {
|
||||||
"inputs": [
|
"inputs": [
|
||||||
".next/trace",
|
".next/**",
|
||||||
|
"!.next/cache/**",
|
||||||
"integration/integration/**",
|
"integration/integration/**",
|
||||||
"integration/support/**"
|
"integration/support/**",
|
||||||
|
"cypress.config.ts"
|
||||||
],
|
],
|
||||||
"outputs": [
|
"outputs": [
|
||||||
"cypress/videos/**",
|
"cypress/videos/**",
|
||||||
|
Reference in New Issue
Block a user