Merged PR 2558: updated link on awaiting submission view allin welsh

updated link on awaiting submission view allin welsh

Related work items: #24389
This commit is contained in:
Robert Bond
2026-08-12 13:58:07 +00:00
parent 5813d409bc
commit 478fa91004
14 changed files with 1769 additions and 7 deletions
@@ -0,0 +1,35 @@
import { test, expect } from "@playwright/test";
import { handleSearchResults } from "../../helpers/index";
test("Check for DNS applications", async ({ page }) => {
await page.goto("/");
await page.getByRole("button", { name: "Accept cookies" }).click();
await page.getByRole("link", { name: "View all DNS applications" }).click();
async function handleSearchResults(page) {
const results = page.locator("dd a.govuk-link--no-underline");
await Promise.race([
results.first().waitFor({ state: "visible", timeout: 15000 }),
]);
if ((await results.count()) > 0) {
await results.first().click({ timeout: 15000 });
await expect(page.locator("#main-content")).toContainText("Reference:", {
timeout: 15000,
});
return "clicked";
} else if ((await noResultsMessage.count()) > 0) {
console.log("️ No results found. Test passes.");
return "no-results";
} else {
throw new Error(
"⚠️ Unexpected search page state: neither results nor zero-results message found."
);
}
}
// Handle search results safely
const outcome = await handleSearchResults(page);
console.log(`Search outcome for DNS":`, outcome);
});