test(e2e): fix order of execution in registration tests
This commit is contained in:
parent
a98ab958ef
commit
4599f41d68
2 changed files with 13 additions and 6 deletions
3
.github/workflows/e2e.yml
vendored
3
.github/workflows/e2e.yml
vendored
|
|
@ -58,6 +58,9 @@ jobs:
|
||||||
timeout 30s bash -c 'until curl -f http://localhost:4096/healthcheck; do echo "Waiting for server..." && sleep 2; done'
|
timeout 30s bash -c 'until curl -f http://localhost:4096/healthcheck; do echo "Waiting for server..." && sleep 2; done'
|
||||||
continue-on-error: false
|
continue-on-error: false
|
||||||
|
|
||||||
|
- name: Make data directory writable
|
||||||
|
run: sudo chmod -R 777 data
|
||||||
|
|
||||||
- name: Run Playwright tests
|
- name: Run Playwright tests
|
||||||
run: bun run test:e2e
|
run: bun run test:e2e
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,13 +1,13 @@
|
||||||
import fs from "fs";
|
import fs from "fs";
|
||||||
import { test, expect } from "@playwright/test";
|
import { test, expect } from "@playwright/test";
|
||||||
import { resetDatabase } from "./helpers/db";
|
import { resetDatabase } from "./helpers/db";
|
||||||
import { createTestAccount } from "./helpers/account";
|
|
||||||
|
// TODO: Run these tests with different users once multi-user support is added
|
||||||
|
|
||||||
// Run tests in serial mode to avoid conflicts during onboarding
|
// Run tests in serial mode to avoid conflicts during onboarding
|
||||||
test.describe.configure({ mode: "serial" });
|
test.describe.configure({ mode: "serial" });
|
||||||
|
|
||||||
test.beforeEach(async () => {
|
test.beforeAll(async () => {
|
||||||
console.log("Resetting database...");
|
|
||||||
await resetDatabase();
|
await resetDatabase();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -36,7 +36,13 @@ test("user can register a new account", async ({ page }) => {
|
||||||
});
|
});
|
||||||
|
|
||||||
test("user can download recovery key", async ({ page }) => {
|
test("user can download recovery key", async ({ page }) => {
|
||||||
await createTestAccount(page);
|
await page.goto("/login");
|
||||||
|
|
||||||
|
await page.getByRole("textbox", { name: "Username" }).fill("test");
|
||||||
|
await page.getByRole("textbox", { name: "Password" }).fill("password");
|
||||||
|
await page.getByRole("button", { name: "Login" }).click();
|
||||||
|
|
||||||
|
await expect(page.getByText("Download Your Recovery Key")).toBeVisible();
|
||||||
|
|
||||||
await page.getByRole("textbox", { name: "Confirm Your Password" }).fill("test");
|
await page.getByRole("textbox", { name: "Confirm Your Password" }).fill("test");
|
||||||
await page.getByRole("button", { name: "Download Recovery Key" }).click();
|
await page.getByRole("button", { name: "Download Recovery Key" }).click();
|
||||||
|
|
@ -60,8 +66,6 @@ test("user can download recovery key", async ({ page }) => {
|
||||||
});
|
});
|
||||||
|
|
||||||
test("can't create another admin user after initial setup", async ({ page }) => {
|
test("can't create another admin user after initial setup", async ({ page }) => {
|
||||||
await createTestAccount(page);
|
|
||||||
|
|
||||||
await page.goto("/onboarding");
|
await page.goto("/onboarding");
|
||||||
|
|
||||||
await page.getByRole("textbox", { name: "Email" }).click();
|
await page.getByRole("textbox", { name: "Email" }).click();
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue