Files
pedwfrontend/pwe2e/tests/loggedin/downloadFile.spec.js
Robert Bond 478fa91004 Merged PR 2558: updated link on awaiting submission view allin welsh
updated link on awaiting submission view allin welsh

Related work items: #24389
2026-08-12 13:58:07 +00:00

28 lines
896 B
JavaScript

import { test, expect } from "@playwright/test";
import { login } from "../../helpers";
test("Download a file when logged in", async ({ page }) => {
await login(page);
await page
.getByRole("textbox", { name: "Use the case reference or DNS" })
.click();
await page
.getByRole("textbox", { name: "Use the case reference or DNS" })
.fill("gaerwen");
await page.getByRole("button", { name: "Submit search" }).click();
// await page
// .getByRole("link", { name: "DNS3276735 - Gaerwen Wind Farm (test)" })
// .click();
await page.locator("dd a.govuk-link--no-underline").first().click();
const downloadPromise = page.waitForEvent("download");
await page.locator(".documentLink").first().click();
const download = await downloadPromise;
await page.getByText("Download complete!").click();
await page.getByRole("link", { name: "Home" }).click();
});