diff --git a/apps/datahub-e2e/src/e2e/datasetDetailPage.cy.ts b/apps/datahub-e2e/src/e2e/datasetDetailPage.cy.ts index 0a0c695e94..a2d823b853 100644 --- a/apps/datahub-e2e/src/e2e/datasetDetailPage.cy.ts +++ b/apps/datahub-e2e/src/e2e/datasetDetailPage.cy.ts @@ -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', () => {