mirror of
https://github.com/zitadel/zitadel.git
synced 2025-12-12 13:35:07 +00:00
Merge branch 'acceptance-test-suite' into test_definitions
This commit is contained in:
@@ -1,39 +1,36 @@
|
||||
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 as base } from "@playwright/test";
|
||||
import dotenv from "dotenv";
|
||||
import path from "path";
|
||||
import { OtpType, PasswordUserWithOTP } 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: PasswordUserWithOTP }>({
|
||||
user: async ({page}, use) => {
|
||||
const user = new PasswordUserWithOTP({
|
||||
email: "otp_sms@example.com",
|
||||
firstName: "first",
|
||||
lastName: "last",
|
||||
password: "Password1!",
|
||||
organization: "",
|
||||
type: OtpType.sms,
|
||||
});
|
||||
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);
|
||||
},
|
||||
await user.ensure(page);
|
||||
await use(user);
|
||||
},
|
||||
});
|
||||
|
||||
test("username, password and otp login", async ({user, page}) => {
|
||||
const server = startSink()
|
||||
await loginWithPassword(page, user.getUsername(), user.getPassword())
|
||||
/*
|
||||
test("username, password and otp login", async ({ user, page }) => {
|
||||
//const server = startSink()
|
||||
await loginWithPassword(page, user.getUsername(), user.getPassword());
|
||||
|
||||
|
||||
await loginScreenExpect(page, user.getFullName());
|
||||
server.close()
|
||||
await loginScreenExpect(page, user.getFullName());
|
||||
//server.close()
|
||||
});
|
||||
|
||||
|
||||
test("username, password and sms otp login", async ({user, page}) => {
|
||||
// Given sms otp is enabled on the organizaiton of the user
|
||||
// Given the user has only sms otp configured as second factor
|
||||
@@ -45,7 +42,6 @@ test("username, password and sms otp login", async ({user, page}) => {
|
||||
// User is redirected to the app (default redirect url)
|
||||
});
|
||||
|
||||
|
||||
test("username, password and sms otp login, resend code", async ({user, page}) => {
|
||||
// Given sms otp is enabled on the organizaiton of the user
|
||||
// Given the user has only sms otp configured as second factor
|
||||
@@ -58,7 +54,6 @@ test("username, password and sms otp login, resend code", async ({user, page}) =
|
||||
// User is redirected to the app (default redirect url)
|
||||
});
|
||||
|
||||
|
||||
test("username, password and sms otp login, wrong code", async ({user, page}) => {
|
||||
// Given sms otp is enabled on the organizaiton of the user
|
||||
// Given the user has only sms otp configured as second factor
|
||||
@@ -69,3 +64,4 @@ test("username, password and sms otp login, wrong code", async ({user, page}) =>
|
||||
// User enters a wrond code
|
||||
// Error message - "Invalid code" is shown
|
||||
});
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user