Skip to content

Commit

Permalink
Update E2E tests:
Browse files Browse the repository at this point in the history
- LTCE test updates
- Change selectVar command to force=true
  • Loading branch information
Kevin Ngai committed Sep 6, 2023
1 parent bb8ed0a commit 7a3bbcc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions tests/e2e/specs/ltce.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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) => {
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/support/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
})

Expand Down

0 comments on commit 7a3bbcc

Please sign in to comment.