From 7a3bbcc384a3def9a094bb293c32076e4d8e4c64 Mon Sep 17 00:00:00 2001 From: Kevin Ngai Date: Wed, 6 Sep 2023 13:18:19 -0700 Subject: [PATCH] Update E2E tests: - LTCE test updates - Change selectVar command to force=true --- tests/e2e/specs/ltce.js | 8 ++++---- tests/e2e/support/commands.js | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/e2e/specs/ltce.js b/tests/e2e/specs/ltce.js index ef021e8..4d78778 100644 --- a/tests/e2e/specs/ltce.js +++ b/tests/e2e/specs/ltce.js @@ -23,7 +23,7 @@ describe('E2E test for LTCE data with various form options', () => { } expect(xhr.response.body).to.have.property('type') expect(xhr.response.body.type).to.equal('FeatureCollection') - expect(xhr.response.body.features.length).to.equal(5837) + expect(xhr.response.body.features.length).to.equal(5819) }), { errorMsg: 'Timeout reached', // overrides the default error message timeout: TIMEOUT_MS, // waits up to TIMEOUT_MS, default to 6500 ms @@ -54,7 +54,7 @@ describe('E2E test for LTCE data with various form options', () => { expect(xhr.request.method).to.equal('GET') expect(xhr.response.body).to.have.property('type') expect(xhr.response.body.type).to.equal('FeatureCollection') - expect(xhr.response.body.numberMatched).to.be.greaterThan(270000) + expect(xhr.response.body.numberMatched).to.be.greaterThan(260000) }), { errorMsg: 'Timeout reached', // overrides the default error message timeout: TIMEOUT_MS, // waits up to TIMEOUT_MS, default to 6500 ms @@ -67,7 +67,7 @@ describe('E2E test for LTCE data with various form options', () => { // visit download link (replace with limit 1) cy.get('#oapif-link-list').scrollIntoView().wait(250).should('be.visible') - cy.get('#oapif-link-list').find('a').should('have.length.of.at.most', 2) + cy.get('#oapif-link-list').find('a').should('have.length.of.at.most', 30) cy.get('#oapif-link-list a:first').should('have.attr', 'href').then((href) => { let hrefLimited = href.replace(/limit=\d+/, 'limit=1') cy.request('GET', hrefLimited).then((response) => { @@ -220,7 +220,7 @@ describe('E2E test for LTCE data with various form options', () => { expect(xhr.response.headers).to.have.property('access-control-allow-origin') expect(xhr.response.body).to.have.property('type') expect(xhr.response.body.type).to.equal('FeatureCollection') - expect(xhr.response.body.features.length).to.equal(2290) + expect(xhr.response.body.features.length).to.be.greaterThan(2270) }), { errorMsg: 'Timeout reached', // overrides the default error message timeout: TIMEOUT_MS, // waits up to TIMEOUT_MS, default to 6500 ms diff --git a/tests/e2e/support/commands.js b/tests/e2e/support/commands.js index 59ea436..05c0c5e 100644 --- a/tests/e2e/support/commands.js +++ b/tests/e2e/support/commands.js @@ -28,7 +28,7 @@ import 'cypress-wait-until'; Cypress.Commands.add('selectVar', (getInput, text, value) => { - cy.get(getInput).scrollIntoView().wait(250).select(text).should('have.value', value) + cy.get(getInput).scrollIntoView().wait(250).select(text, {force: true}).should('have.value', value) return cy.get(getInput) })