chore: add basic acceptance tests

This commit is contained in:
Stefan Benz
2024-10-28 19:44:50 +01:00
parent bfd8a7c9e1
commit 9af39ac1bc
12 changed files with 484 additions and 75 deletions

View File

@@ -0,0 +1,26 @@
import {test as base} from "@playwright/test";
import {PasswordUser} from './user';
import path from 'path';
import dotenv from 'dotenv';
// Read from ".env" file.
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();
await use(user);
},
});
test("username and password changed login", async ({user, page}) => {
await user.changePassword(page, "ChangedPw1!")
await user.login(page)
});