2021-07-15 11:01:10 -07:00
|
|
|
// / <reference types="Cypress" />
|
|
|
|
|
2021-10-05 15:52:03 -04:00
|
|
|
describe('Does the Census Block Group packet download?', () => {
|
2021-09-15 12:06:13 -07:00
|
|
|
const filename = `Screening_Tool_Data.zip`;
|
2021-07-15 11:01:10 -07:00
|
|
|
it('validate file download', () => {
|
2021-09-07 10:08:13 -07:00
|
|
|
cy.visit('localhost:8000/en/methodology');
|
2021-08-10 09:45:45 -07:00
|
|
|
|
2021-09-07 10:08:13 -07:00
|
|
|
cy.get('[data-cy="download-link"]').invoke('attr', 'target', '_blank');
|
2021-10-05 15:52:03 -04:00
|
|
|
cy.intercept('GET', '/data-pipeline/data/score/downloadable/Screening_Tool_Data.zip',
|
2021-09-07 10:08:13 -07:00
|
|
|
{
|
2021-10-05 15:52:03 -04:00
|
|
|
hostname: 'https://d3jqyw10j8e7p9.cloudfront.net',
|
2021-09-07 10:08:13 -07:00
|
|
|
body: 'success',
|
|
|
|
headers: {
|
|
|
|
'Content-Type': 'text/html; charset=utf-8',
|
|
|
|
'Content-Disposition': 'attachment',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
).as('downloadRequest');
|
|
|
|
cy.get('button[class*="downloadPacket"]').click();
|
|
|
|
cy.wait('@downloadRequest');
|
|
|
|
cy.readFile(`cypress/downloads/${filename}`).should('exist');
|
2021-07-15 11:01:10 -07:00
|
|
|
});
|
|
|
|
});
|