test: refs #8422 update download DMS test to verify file download response

This commit is contained in:
Jose Antonio Tubau 2025-04-11 12:20:01 +02:00
parent 6dddad95c9
commit 800e5e18d4
1 changed files with 9 additions and 6 deletions

View File

@ -55,13 +55,16 @@ describe('Vehicle DMS', () => {
.should('have.length.greaterThan', 0);
});
it('Should download DMS', () => {
cy.get(selectors.lastRowDownloadBtn).click();
cy.wait(2000);
const downloadsFolder = Cypress.config('downloadsFolder');
it.only('Should download DMS', () => {
const fileName = '11.jpg';
cy.readFile(`${downloadsFolder}/${fileName}`).should('exist');
cy.intercept('GET', /\/api\/dms\/11\/downloadFile/).as('download');
cy.get(selectors.lastRowDownloadBtn).click();
cy.wait('@download').then((interception) => {
cy.log('RESPUESTA: ', JSON.stringify(interception.response));
expect(interception.response.statusCode).to.equal(200);
expect(interception.response.headers['content-disposition']).to.contain(fileName);
});
});
it('Should create new DMS', () => {