Skip to content

Commit

Permalink
move csv download to own spec
Browse files Browse the repository at this point in the history
  • Loading branch information
esizer committed Dec 30, 2024
1 parent 3524ced commit 71232ec
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 15 deletions.
15 changes: 0 additions & 15 deletions apps/playwright/tests/admin/admin-workflows.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,21 +78,6 @@ test.describe("Admin workflows", () => {
).toBeVisible();
});

test("Download user as CSV", async ({ appPage }) => {
await loginBySub(appPage.page, "admin@test.com", false);
await goToUsersPage(appPage);
await searchForUser(appPage, "Applicant");

await appPage.page
.getByRole("button", { name: /select gul fields/i })
.click();
await appPage.page.getByRole("button", { name: /download csv/i }).click();

await expect(appPage.page.getByRole("alert")).toContainText(
/preparing your file for download/i,
);
});

test("Filter users table", async ({ appPage }) => {
await loginBySub(appPage.page, "admin@test.com", false);
await goToUsersPage(appPage);
Expand Down
23 changes: 23 additions & 0 deletions apps/playwright/tests/admin/user-csv.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { test, expect } from "~/fixtures";
import { loginBySub } from "~/utils/auth";

test.describe("User CSV", () => {
test("Download user as CSV", async ({ appPage }) => {
await loginBySub(appPage.page, "admin@test.com", false);
await appPage.page.goto("/en/admin/users");
await appPage.page
.getByRole("textbox", { name: /search/i })
.fill("Applicant", { timeout: 30000 });

await appPage.waitForGraphqlResponse("UsersPaginated");

await appPage.page
.getByRole("button", { name: /select gul fields/i })
.click();
await appPage.page.getByRole("button", { name: /download csv/i }).click();

await expect(appPage.page.getByRole("alert")).toContainText(
/preparing your file for download/i,
);
});
});

0 comments on commit 71232ec

Please sign in to comment.