diff --git a/test/cypress/integration/worker/workerPda.spec.js b/test/cypress/integration/worker/workerPda.spec.js index d00a81ffcac..8c539cf70ea 100644 --- a/test/cypress/integration/worker/workerPda.spec.js +++ b/test/cypress/integration/worker/workerPda.spec.js @@ -13,7 +13,8 @@ describe('WorkerPda', () => { cy.checkNotification('PDA deallocated'); }); - it('send to docuware', () => { + it('send and download pdf to docuware', () => { + //Send cy.intercept('POST', '/api/Docuwares/upload-pda-pdf', (req) => { req.reply({ statusCode: 200, @@ -22,10 +23,30 @@ describe('WorkerPda', () => { }); creatNewPDA(); + cy.dataCy('workerPda-send').click(); confirmButton(); cy.checkNotification('PDF sended to signed'); + //Download + cy.intercept('POST', /\/api\/Docuwares\/Jones%20Jessica\/checkFile/, (req) => { + req.reply({ + statusCode: 200, + body: { + id: deviceId, + state: 'Firmado', + }, + }); + }); + cy.get('#st-actions').contains('refresh').click(); + cy.intercept('GET', '/api/Docuwares/download-pda-pdf**', (req) => { + req.reply({ + statusCode: 200, + body: {}, + }); + }); + + cy.dataCy('workerPda-download').click(); removeNewPDA(); }); @@ -48,30 +69,6 @@ describe('WorkerPda', () => { removeNewPDA(); }); - it('download file', () => { - cy.intercept('POST', /\/api\/Docuwares\/Jones%20Jessica\/checkFile/, (req) => { - req.reply({ - statusCode: 200, - body: { - id: deviceId, - state: 'Firmado', - }, - }); - }); - - cy.intercept('GET', '/api/Docuwares/download-pda-pdf**', (req) => { - req.reply({ - statusCode: 200, - body: {}, - }); - }); - cy.get('#st-actions').contains('refresh').click(); - - creatNewPDA(); - cy.dataCy('workerPda-download').click(); - removeNewPDA(); - }); - function creatNewPDA(id = deviceId) { cy.addBtnClick(); cy.selectOption('[data-cy="pda-dialog-select"]', id);