diff --git a/cypress/integration/health_check.js b/cypress/integration/health_check.js index db5bc761..bb570df8 100644 --- a/cypress/integration/health_check.js +++ b/cypress/integration/health_check.js @@ -15,19 +15,19 @@ describe("Health Check tests ", () => { hp.haltAndClearStorage(() => { initMain(); cy.intercept("GET", "https://try.count.ly/i?**").as("getXhr"); - cy.wait(3000).then(() => { - cy.wait("@getXhr").then((xhr) => { - const url = new URL(xhr.request.url); + cy.wait("@getXhr").then((xhr) => { + const url = new URL(xhr.request.url); - // Test the 'hc' parameter - const hcParam = url.searchParams.get("hc"); - const hcParamObj = JSON.parse(hcParam); - expect(hcParamObj).to.eql({el: 0, wl: 0, sc: -1, em: '""'}); + // Test the 'hc' parameter + const hcParam = url.searchParams.get("hc"); + const hcParamObj = JSON.parse(hcParam); + expect(hcParamObj).to.eql({ el: 0, wl: 0, sc: -1, em: "\"\"" }); - // Test the 'metrics' parameter - const metricsParam = url.searchParams.get('metrics'); - expect(metricsParam).to.equal('{"_app_version":"0.0","_ua":"abcd"}'); - }); + // Test the 'metrics' parameter + const metricsParam = url.searchParams.get("metrics"); + expect(metricsParam).to.equal("{\"_app_version\":\"0.0\",\"_ua\":\"abcd\"}"); + + // check nothing in the request queue cy.fetch_local_request_queue().then((rq) => { expect(rq.length).to.equal(0); });