Skip to content

Commit

Permalink
fix: frontend tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ptitFicus committed Oct 29, 2024
1 parent 4369542 commit ed0f211
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
4 changes: 3 additions & 1 deletion izanami-frontend/tests/global.setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@ import { test as setup, expect } from "@playwright/test";
import { STORAGE_STATE } from "../playwright.config";
import { cleanup } from "./utils";

export const PASSWORD = "ADMIN_DEFAULT_PASSWORD";

setup("do login", async ({ page }) => {
await cleanup();
await page.goto("/");
await page.getByLabel("Username").fill("RESERVED_ADMIN_USER");
await page.getByLabel("Password").fill("ADMIN_DEFAULT_PASSWORD");
await page.getByLabel("Password").fill(PASSWORD);
await page.getByRole("button", { name: "Login" }).click();

// Wait until the page actually signs in.
Expand Down
2 changes: 2 additions & 0 deletions izanami-frontend/tests/projects.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { Page } from "@playwright/test";
import { test, expect } from "./izanami-test";
import { testBuilder, testTenant, testproject } from "./testBuilder";
import { PASSWORD } from "./global.setup";

test.use({
headless: true,
Expand Down Expand Up @@ -54,6 +55,7 @@ test.describe("Project setting screen should", () => {
await page.goto(`/tenants/${tenantName}/projects/project`);
await page.getByLabel("Project settings").click();
await page.getByRole("button", { name: "Delete project" }).click();
await page.getByLabel("Password").fill(PASSWORD);
await page.getByRole("button", { name: "Confirm" }).click();
await expect(page).toHaveURL(`/tenants/${tenantName}`);
await expect(page.getByRole("link", { name: "foo" })).toHaveCount(0);
Expand Down
2 changes: 2 additions & 0 deletions izanami-frontend/tests/webhooks.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {
testWebhook,
testproject,
} from "./testBuilder";
import { PASSWORD } from "./global.setup";

test.use({
headless: true,
Expand Down Expand Up @@ -124,6 +125,7 @@ test.describe("Webhook screen should", () => {
await page.goto(`/tenants/${tenantName}/webhooks`);
await webhookAction(page, "Delete");

await page.getByLabel("Password").fill(PASSWORD);
await page.getByRole("button", { name: "Confirm" }).click();

await expect(
Expand Down

0 comments on commit ed0f211

Please sign in to comment.