Skip to content

chore: skip global.setup if first user already exists #12930

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Apr 11, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
chore: skip global.setup if first user already exists
treat test as a setup, rather than a test
  • Loading branch information
Emyrk committed Apr 10, 2024
commit e6021d5c63f0ebda6d501cf3ce8364041d7dc23d
8 changes: 8 additions & 0 deletions site/e2e/global.setup.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
import { expect, test } from "@playwright/test";
import { hasFirstUser } from "api/api";
import { Language } from "pages/CreateUserPage/CreateUserForm";
import * as constants from "./constants";
import { storageState } from "./playwright.config";

test("setup deployment", async ({ page }) => {
const exists = await hasFirstUser();
if (exists) {
// First user already exists, abort early. All tests execute this as a dependency,
// if you run multiple tests in the UI, this will fail unless we check this.
return;
}

await page.goto("/", { waitUntil: "domcontentloaded" });

// Setup first user
Expand Down