From d52f54620101e6b539fe463053d0441023de6ff7 Mon Sep 17 00:00:00 2001 From: Sean Rankine Date: Mon, 29 Jul 2024 13:49:42 +0100 Subject: [PATCH] Remove DGU dataset comparision test This test would be suited as metrics available from apps and then alerting set up when the dataset number are out of sync. --- tests/data-gov-uk.spec.js | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/tests/data-gov-uk.spec.js b/tests/data-gov-uk.spec.js index 84e8efd..b07e7ed 100644 --- a/tests/data-gov-uk.spec.js +++ b/tests/data-gov-uk.spec.js @@ -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); - }); });