Skip to content

Commit

Permalink
fix(e2e): fix e2e test
Browse files Browse the repository at this point in the history
  • Loading branch information
cmoinier committed Dec 7, 2023
1 parent 81444e4 commit 320c8b0
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions apps/datahub-e2e/src/e2e/datasetDetailPage.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -373,15 +373,18 @@ describe('dataset pages', () => {
})
})
it('downloads a file on click', () => {
cy.intercept(
'GET',
'https://www.geo2france.fr/geoserver/insee/ows?SERVICE=WFS&REQUEST=GetFeature&VERSION=2.0.0&TYPENAMES=insee%3Arectangles_200m_menage_erbm&OUTPUTFORMAT=csv'
).as('downloadRequest')

cy.get('datahub-record-downloads')
.find('gn-ui-download-item')
.first()
.click()
cy.exec('ls cypress/downloads').then((result) => {
const fileList = result.stdout.split('\n')

const isFileDownloaded = fileList[0]
expect(/\S/.test(isFileDownloaded)).to.be.true
cy.wait('@downloadRequest').then((interception) => {
expect(interception.response.statusCode).to.equal(200)
})
})
it('displays the full list after clicking two times on one filter', () => {
Expand Down

0 comments on commit 320c8b0

Please sign in to comment.