test: refs #8422 update download DMS test to verify file download response
This commit is contained in:
parent
6dddad95c9
commit
800e5e18d4
|
@ -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', () => {
|
||||
|
|
Loading…
Reference in New Issue