diff --git a/.github/workflows/integration-tests.yml b/.github/workflows/integration-tests.yml index b3be038b91..bb0cf05443 100644 --- a/.github/workflows/integration-tests.yml +++ b/.github/workflows/integration-tests.yml @@ -90,6 +90,10 @@ jobs: sudo rm -f /etc/nginx/sites-enabled/default sudo nginx -t sudo systemctl restart nginx + - name: Create writable Cypress videos and screenshots dirs + run: | + sudo mkdir -p ${{ github.workspace }}/cypress/screenshots ${{ github.workspace }}/cypress/videos + sudo chmod a=rwx ${{ github.workspace }}/cypress/screenshots ${{ github.workspace }}/cypress/videos - name: Run tests env: BROWSER: ${{ matrix.browser }} diff --git a/cypress/e2e/csv_import.cy.js b/cypress/e2e/csv_import.cy.js index 9304f1c72a..060310a97f 100644 --- a/cypress/e2e/csv_import.cy.js +++ b/cypress/e2e/csv_import.cy.js @@ -20,7 +20,9 @@ describe('CSV import', () => { cy.contains('CSV import order fonds').click() cy.waitUntil(() => Cypress.$('li.jstree-node').length === 4) - cy.get('li.jstree-closed > i').click({multiple: true}) + cy.get('li.jstree-closed > i') + .should('be.visible') // Ensure the element is visible + .click({ multiple: true }); cy.waitUntil(() => Cypress.$('li.jstree-node').length === 34) const orderedTitles = [ diff --git a/cypress/e2e/finding_aid.cy.js b/cypress/e2e/finding_aid.cy.js index 863a55deef..17ec8e026d 100644 --- a/cypress/e2e/finding_aid.cy.js +++ b/cypress/e2e/finding_aid.cy.js @@ -24,10 +24,15 @@ describe( }) }) + beforeEach(() => { - // Preserve authentication cookies between tests - Cypress.Cookies.preserveOnce('atom_authenticated', 'symfony') - }) + // Use cy.session to preserve all cookies and validate them + cy.session('unique_identifier', cy.login, { + validate () { + cy.getCookies().should('exist') + }, + }) + }); it('Disables finding aids', () => { cy.visit('settings/findingAid') diff --git a/package-lock.json b/package-lock.json index fd895ef6aa..cc6315efa5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -26,7 +26,7 @@ }, "devDependencies": { "css-loader": "^6.3.0", - "cypress": "^10.3.0", + "cypress": "^13.2.0", "cypress-file-upload": "^5.0.8", "cypress-wait-until": "^1.7.2", "expose-loader": "^3.0.0", @@ -1348,9 +1348,9 @@ } }, "node_modules/cypress": { - "version": "10.3.0", - "resolved": "https://registry.npmjs.org/cypress/-/cypress-10.3.0.tgz", - "integrity": "sha512-txkQWKzvBVnWdCuKs5Xc08gjpO89W2Dom2wpZgT9zWZT5jXxqPIxqP/NC1YArtkpmp3fN5HW8aDjYBizHLUFvg==", + "version": "13.2.0", + "resolved": "https://registry.npmjs.org/cypress/-/cypress-13.2.0.tgz", + "integrity": "sha512-AvDQxBydE771GTq0TR4ZUBvv9m9ffXuB/ueEtpDF/6gOcvFR96amgwSJP16Yhqw6VhmwqspT5nAGzoxxB+D89g==", "dev": true, "hasInstallScript": true, "dependencies": { @@ -5424,9 +5424,9 @@ "dev": true }, "cypress": { - "version": "10.3.0", - "resolved": "https://registry.npmjs.org/cypress/-/cypress-10.3.0.tgz", - "integrity": "sha512-txkQWKzvBVnWdCuKs5Xc08gjpO89W2Dom2wpZgT9zWZT5jXxqPIxqP/NC1YArtkpmp3fN5HW8aDjYBizHLUFvg==", + "version": "13.2.0", + "resolved": "https://registry.npmjs.org/cypress/-/cypress-13.2.0.tgz", + "integrity": "sha512-AvDQxBydE771GTq0TR4ZUBvv9m9ffXuB/ueEtpDF/6gOcvFR96amgwSJP16Yhqw6VhmwqspT5nAGzoxxB+D89g==", "dev": true, "requires": { "@cypress/request": "^2.88.10", diff --git a/package.json b/package.json index 435c146ebe..c4c2347f62 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,7 @@ }, "devDependencies": { "css-loader": "^6.3.0", - "cypress": "^10.3.0", + "cypress": "^13.2.0", "cypress-file-upload": "^5.0.8", "cypress-wait-until": "^1.7.2", "expose-loader": "^3.0.0",