From 595f975b4f508b2baaad133a5bd926d0c6707e2d Mon Sep 17 00:00:00 2001 From: jorgep Date: Thu, 13 Mar 2025 10:10:40 +0100 Subject: [PATCH] ci: refs #8581 update Cypress tests for InvoiceIn integration --- test/cypress/cypressParallel.sh | 4 ++-- .../invoiceIn/invoiceInBasicData.spec.js | 17 +++++++++++++++++ .../integration/invoiceIn/invoiceInList.spec.js | 2 +- 3 files changed, 20 insertions(+), 3 deletions(-) diff --git a/test/cypress/cypressParallel.sh b/test/cypress/cypressParallel.sh index 5801349cf..105768b3d 100644 --- a/test/cypress/cypressParallel.sh +++ b/test/cypress/cypressParallel.sh @@ -1,6 +1,6 @@ #!/bin/bash -find 'test/cypress/integration' \ +find 'test/cypress/integration/invoiceIn' \ -mindepth 1 \ -maxdepth 1 \ -type d | \ @@ -8,7 +8,7 @@ xargs -P "$1" -I {} sh -c ' echo "🔷 {}" && xvfb-run -a cypress run \ --headless \ - --spec "[test/cypress/integration/invoiceIn/*Descriptor.spec.js]" \ + --spec "{}" \ --quiet \ > /dev/null ' diff --git a/test/cypress/integration/invoiceIn/invoiceInBasicData.spec.js b/test/cypress/integration/invoiceIn/invoiceInBasicData.spec.js index ee4d9fb74..c47c25565 100644 --- a/test/cypress/integration/invoiceIn/invoiceInBasicData.spec.js +++ b/test/cypress/integration/invoiceIn/invoiceInBasicData.spec.js @@ -35,6 +35,23 @@ describe('InvoiceInBasicData', () => { cy.fillInForm(mock, { attr: 'data-cy' }); cy.saveCard(); cy.validateForm(mock, { attr: 'data-cy' }); + cy.request({ + method: 'PATCH', + url: '/api/InvoiceIns/1/updateInvoiceIn', + headers: { Authorization: 'DEFAULT_TOKEN' }, + body: { + supplierRef: '1234', + serial: 'R', + supplierFk: 1, + issued: new Date(Date.UTC(2001, 0, 1, 11)), + companyFk: 442, + docFk: 1, + bookEntried: new Date(Date.UTC(2001, 0, 1, 11)), + currencyFk: 1, + operated: null, + booked: null, + }, + }); }); it('should edit, remove and create the dms data', () => { diff --git a/test/cypress/integration/invoiceIn/invoiceInList.spec.js b/test/cypress/integration/invoiceIn/invoiceInList.spec.js index 63428eb96..42b548957 100644 --- a/test/cypress/integration/invoiceIn/invoiceInList.spec.js +++ b/test/cypress/integration/invoiceIn/invoiceInList.spec.js @@ -38,7 +38,7 @@ describe('InvoiceInList', () => { it('should create a new Invoice', () => { cy.dataCy('vnTableCreateBtn').click(); - cy.fillInForm(mock, { attr: 'data-cy' }); + cy.fillInForm({ ...mock }, { attr: 'data-cy' }); cy.dataCy('FormModelPopup_save').click(); cy.intercept('GET', /\/api\/InvoiceIns\/\d+\/getTotals$/).as('invoice'); cy.wait('@invoice').then(() =>