Skip to content

Commit

Permalink
cypress: Upgrade to v13.2
Browse files Browse the repository at this point in the history
The cypress version has been upgraded and some e2e js code has been
modified to use new syntax.

Added the creation of cypress/videos and screenshots writeble
directories.
  • Loading branch information
mamedin committed Sep 28, 2023
1 parent 9fd22ac commit c19f0a7
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 12 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
4 changes: 3 additions & 1 deletion cypress/e2e/csv_import.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand Down
11 changes: 8 additions & 3 deletions cypress/e2e/finding_aid.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down
14 changes: 7 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit c19f0a7

Please sign in to comment.