From 057a2520c0d776c10f3f9903d3bb5511b7494dff Mon Sep 17 00:00:00 2001 From: alexm Date: Sun, 23 Mar 2025 07:21:17 +0100 Subject: [PATCH] test(WorkerPda): refs #5926 unify send and download e2e --- .../integration/worker/workerPda.spec.js | 47 +++++++++---------- 1 file changed, 22 insertions(+), 25 deletions(-) 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);