-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix: project config is not loaded in tests after a change
The disk cache of the browser needs to be cleared. This can be achieved by splitting into two cy.js files.
- Loading branch information
Showing
4 changed files
with
536 additions
and
1,126 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
describe('Home page', function() { | ||
const BASEX_ROOT = Cypress.env('BASEX_ROOT') || '/app/.heroku/basex' | ||
const BASEX_PWD = Cypress.env('BASEX_admin_pw') || 'admin' | ||
|
||
it('should show Tunisia with different config', function() { | ||
cy.exec(`${BASEX_ROOT}/bin/basexclient -Uadmin -P${BASEX_PWD} -c "OPEN vicav_projects; REPLACE vicav.xml ${Cypress.config()['fileServerFolder']}/fixtures/vicav_projects/map.xml"`) | ||
cy.request({ | ||
method: 'PUT', | ||
url: 'http://localhost:8984/vicav/project', | ||
headers: {'Accept': 'application/json'} | ||
}).as('refreshConfig') | ||
cy.get('@refreshConfig').should((response) => { | ||
expect(response.status).to.equal(200) | ||
expect(response.body.projectConfig).to.exist | ||
}) | ||
cy.request({ | ||
method: 'GET', | ||
url: 'http://localhost:8984/vicav/project', | ||
headers: {'Accept': 'application/json'} | ||
}).as('config') | ||
cy.get('@config').should((response) => { | ||
expect(response.status).to.equal(200) | ||
expect(response.body.projectConfig).to.exist | ||
expect(response.body.projectConfig.cached).to.be.true | ||
expect(response.body.ETag).to.exist | ||
}) | ||
cy.visit('http://localhost:8984/vicav/') | ||
cy.get('#cookie-overlay').should('be.visible') | ||
cy.get('.cookie-accept-btn').click() | ||
cy.get('#cookie-overlay').should('not.be.visible') | ||
cy.get('img.leaflet-marker-icon') // Wait until the initial markers appear. | ||
cy.get('img[alt^="Khorasan"]').should('not.be.visible'); | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
describe('Home page', function() { | ||
const BASEX_ROOT = Cypress.env('BASEX_ROOT') || '/app/.heroku/basex' | ||
const BASEX_PWD = Cypress.env('BASEX_admin_pw') || 'admin' | ||
|
||
it('should show whole Middle-East by deafult', function() { | ||
cy.exec(`${BASEX_ROOT}/bin/basexclient -Uadmin -P${BASEX_PWD} -c "OPEN vicav_projects; REPLACE vicav.xml ${Cypress.config()['fileServerFolder']}/fixtures/vicav_projects/vicav.xml"`) | ||
cy.request({ | ||
method: 'PUT', | ||
url: 'http://localhost:8984/vicav/project', | ||
headers: {'Accept': 'application/json'} | ||
}).as('refreshConfig') | ||
cy.get('@refreshConfig').should((response) => { | ||
expect(response.status).to.equal(200) | ||
expect(response.body.projectConfig).to.exist | ||
}) | ||
cy.request({ | ||
method: 'GET', | ||
url: 'http://localhost:8984/vicav/project', | ||
headers: {'Accept': 'application/json'} | ||
}).as('config') | ||
cy.get('@config').should((response) => { | ||
expect(response.status).to.equal(200) | ||
expect(response.body.projectConfig).to.exist | ||
expect(response.body.projectConfig.cached).to.be.true | ||
expect(response.body.ETag).to.exist | ||
}) | ||
cy.visit('http://localhost:8984/vicav/') | ||
cy.get('#cookie-overlay').should('be.visible') | ||
cy.get('.cookie-accept-btn').click() | ||
cy.get('#cookie-overlay').should('not.be.visible') | ||
cy.get('img.leaflet-marker-icon') // Wait until the initial markers appear. | ||
cy.get('img[alt^="Khorasan"]').should('be.visible'); | ||
}) | ||
}) |
Oops, something went wrong.