diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index bc3c6dae..e66b6075 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -1,8 +1,14 @@ +# Full command list of cypress github actions: +# https://github.com/cypress-io/github-action#cypress-iogithub-action-- + name: End to end tests on: - # push + # To run tests on the push event of a specific branch: + # push: + # branches: + # - vimusds/cypress-debug-download schedule: - # runs tests every day at 12am ET (4am UTC) + # runs tests every day at 12am ET (4am UTC): - cron: '0 4 * * *' jobs: nightly: @@ -18,3 +24,5 @@ jobs: working-directory: ${{env.working-directory}} start: npm start wait-on: 'http://localhost:8000' + # To run only specific spec/tests: + # spec: cypress/e2e/downloadPacket.spec.js \ No newline at end of file diff --git a/client/cypress/e2e/downloadPacket.spec.js b/client/cypress/e2e/downloadPacket.spec.js index 9c3182ea..e00188c4 100644 --- a/client/cypress/e2e/downloadPacket.spec.js +++ b/client/cypress/e2e/downloadPacket.spec.js @@ -2,9 +2,10 @@ describe('Census Block Group download', () => { it('validate file download', () => { + const filename = `usa.zip`; cy.visit('localhost:8000/en/cejst'); cy.get('#download-link').invoke('attr', 'target', '_blank'); - cy.intercept('https://justice40-data.s3.amazonaws.com/Score/usa.zip', + cy.intercept(`https://justice40-data.s3.amazonaws.com/Score/${filename}`, { body: 'success', headers: { @@ -15,6 +16,6 @@ describe('Census Block Group download', () => { ).as('downloadRequest'); cy.get('button[class*="downloadPacket"]').click(); cy.wait('@downloadRequest'); - cy.readFile(`cypress/downloads/usa.csv`).should('exist'); + cy.readFile(`cypress/downloads/${filename}`).should('exist'); }); });