From 800e5e18d448ec8d2b313ffc0aa10cb0dbe54487 Mon Sep 17 00:00:00 2001 From: jtubau Date: Fri, 11 Apr 2025 12:20:01 +0200 Subject: [PATCH] test: refs #8422 update download DMS test to verify file download response --- .../integration/route/vehicle/vehicleDms.spec.js | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/test/cypress/integration/route/vehicle/vehicleDms.spec.js b/test/cypress/integration/route/vehicle/vehicleDms.spec.js index 89b36ec9f..94ea8ccaa 100644 --- a/test/cypress/integration/route/vehicle/vehicleDms.spec.js +++ b/test/cypress/integration/route/vehicle/vehicleDms.spec.js @@ -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', () => {