Skip to content

Commit

Permalink
Remove DGU dataset comparision test
Browse files Browse the repository at this point in the history
This test would be suited as metrics available from apps and then
alerting set up when the dataset number are out of sync.
  • Loading branch information
theseanything committed Jul 29, 2024
1 parent 3e9604b commit d52f546
Showing 1 changed file with 0 additions and 19 deletions.
19 changes: 0 additions & 19 deletions tests/data-gov-uk.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,23 +44,4 @@ test.describe("CKAN", () => {
expect(response.status()).toBe(200);
expect(await response.json()).toBeTruthy();
});

test("Check datasets sync between CKAN and Find", async ({ page }) => {
await page.goto("/dataset?q=");
const ckanDatasetCountString = page.locator(".search-form h1").first();
await expect(ckanDatasetCountString).toHaveText(/(\d{1,3}(,\d{3})*) datasets found/, { useInnerText: true });
const ckanDatasetCount = parseInt((await ckanDatasetCountString.innerText()).replace(/,/g, ""));

// Data.gov.uk
await page.goto("https://data.gov.uk");
await page.getByRole("searchbox", { name: "Search data.gov.uk" }).fill("");
await page.getByRole("button", { name: "Search" }).click("data");
const dataGovUkDatasetCountString = page.locator(".dgu-results__summary > span");
await expect(dataGovUkDatasetCountString).toHaveText(/(\d{1,3}(,\d{3})*)/, { useInnerText: true });
const dataGovUkDatasetCount = parseInt((await dataGovUkDatasetCountString.innerText()).replace(/,/g, ""));

const countDiff = Math.abs(ckanDatasetCount - dataGovUkDatasetCount);

expect(countDiff).toBeLessThan(25);
});
});

0 comments on commit d52f546

Please sign in to comment.