Refactor playwright tests, change button text for better usability and validate mimetype in API layer

This commit is contained in:
thiloho
2024-10-25 19:23:38 +02:00
parent 4e98df5790
commit f79cbffa5a
38 changed files with 1396 additions and 1167 deletions

View File

@@ -0,0 +1,31 @@
import { test } from "@playwright/test";
import { password, authenticate, userOwner } from "./shared";
test.beforeEach(async ({ page }) => {
await authenticate(userOwner, page);
});
/* test("Delete all regular users", async ({ page }) => {
await page.getByRole("link", { name: "Manage" }).click();
await page.waitForSelector("tbody");
const userRows = await page.locator("tbody > tr").filter({ hasNotText: userOwner }).all();
for (const row of userRows) {
await row.getByRole("button", { name: "Manage" }).click();
const modalName = page.url().split("#")[1];
await page.locator(`#${modalName}`).locator('summary:has-text("Delete")').click();
await page.locator(`#${modalName}`).getByRole("button", { name: "Delete user" }).click();
}
});
test("Delete admin account", async ({ page }) => {
await page.getByRole("link", { name: "Account" }).click();
await page.getByRole("button", { name: "Delete account" }).click();
await page.getByLabel("Password:").click();
await page.getByLabel("Password:").fill(password);
await page
.locator("#delete-account-modal")
.getByRole("button", { name: "Delete account" })
.click();
}); */