diff --git a/cypress.config.js b/cypress.config.js index 046039c2..610f8a38 100644 --- a/cypress.config.js +++ b/cypress.config.js @@ -6,7 +6,6 @@ module.exports = defineConfig({ // implement node event listeners here }, baseUrl: 'http://localhost:5173/', - testIsolation: false, }, viewportHeight: 900, viewportWidth: 1200, diff --git a/cypress/e2e/asAdmin.cy.js b/cypress/e2e/asAdmin.cy.js index f2aa1670..9ec76612 100644 --- a/cypress/e2e/asAdmin.cy.js +++ b/cypress/e2e/asAdmin.cy.js @@ -1,12 +1,8 @@ describe('Open each page, table view and detail view, and check at least some correct text appears', () => { - before('Login as admin, directs to front page', () => { - cy.session("logged-as-admin", () => {}) + beforeEach('Login as admin', () => { cy.login('testSu') }) - beforeEach(() => { - cy.visit('/') - }) it('Locality works', () => { cy.contains('Localities').click() cy.contains('Dmanisi') diff --git a/cypress/e2e/misc.cy.js b/cypress/e2e/misc.cy.js index 424bc2a7..78fd8f87 100644 --- a/cypress/e2e/misc.cy.js +++ b/cypress/e2e/misc.cy.js @@ -36,7 +36,7 @@ describe('Test individual features across the app', () => { cy.contains('Reference type') }) describe('Staging mode works for the data types that require it', () => { - before('Login as admin', () => { + beforeEach('Login as admin', () => { cy.login('testSu') }) it('Staging mode works on locality', () => { @@ -59,7 +59,7 @@ describe('Test individual features across the app', () => { }) // TODO remove the skips once onWrite's has been added to all describe('Staging mode does not appear for the data types that dont require it', () => { - before('Login as admin', () => { + beforeEach('Login as admin', () => { cy.login('testSu') }) it('Staging mode does not appear on reference', () => { diff --git a/cypress/e2e/userRights.cy.js b/cypress/e2e/userRights.cy.js index 258f3a02..e50f19c2 100644 --- a/cypress/e2e/userRights.cy.js +++ b/cypress/e2e/userRights.cy.js @@ -1,7 +1,7 @@ describe('Broadly test what different user rights see', () => { describe('Admin visibility', () => { - before('Login as admin', () => { + beforeEach('Login as admin', () => { cy.session('admin-session', () => {}) cy.login('testSu') }) @@ -37,7 +37,7 @@ describe('Broadly test what different user rights see', () => { }) }) describe('Test unlogged visibility', () => { - before('Ensure logout', () => { + beforeEach('Ensure logout', () => { cy.clearAllLocalStorage() cy.visit('/') cy.contains('Guest user') @@ -49,9 +49,9 @@ describe('Broadly test what different user rights see', () => { cy.contains('Time Bound').should('not.exist') }) it('Direct routes to protected views do not work', () => { - cy.pageForbidden('region') - cy.pageForbidden('time-bound') - cy.pageForbidden('project') + cy.pageForbidden('/region') + cy.pageForbidden('/time-bound') + cy.pageForbidden('/project') }) }) })