From 30a2da027b42f7bf4d2de5de2699b0b034675527 Mon Sep 17 00:00:00 2001 From: Javier Segarra Date: Sat, 23 Nov 2024 00:51:45 +0100 Subject: [PATCH] test: rename client by customer --- .../customerCreditContracts.spec.js} | 0 .../customerCreditOpinion.spec.js} | 2 +- .../customerAddress.spec.js} | 0 .../customerBalance.spec.js} | 2 +- .../customerBasicData.spec.js} | 0 .../customerBillingData.spec.js} | 0 .../customerCredits.spec.js} | 2 +- .../customerFiscalData.spec.js} | 0 .../customerGreuges.spec.js} | 0 .../customerList.spec.js} | 0 .../customerNotes.spec.js} | 0 .../customerRecoveries.spec.js} | 2 +- .../customerWebAccess.spec.js} | 0 .../others/customerConsumption.spec.js} | 2 +- .../others/customerContacts.spec.js} | 0 .../others/customerMandates.spec.js} | 2 +- .../others/customerSamples.spec.js} | 2 +- .../others/customerUnpaid.spec.js} | 0 .../others/customerWebPayments.spec.js} | 4 +-- test/cypress/support/commands.js | 27 ++++++++++++++++++- 20 files changed, 35 insertions(+), 10 deletions(-) rename test/cypress/integration/{client/credit-management/clientCreditContracts.spec.js => customer/credit-management/customerCreditContracts.spec.js} (100%) rename test/cypress/integration/{client/credit-management/clientCreditOpinion.spec.js => customer/credit-management/customerCreditOpinion.spec.js} (87%) rename test/cypress/integration/{client/clientAddress.spec.js => customer/customerAddress.spec.js} (100%) rename test/cypress/integration/{client/clientBalance.spec.js => customer/customerBalance.spec.js} (86%) rename test/cypress/integration/{client/clientBasicData.spec.js => customer/customerBasicData.spec.js} (100%) rename test/cypress/integration/{client/clientBillingData.spec.js => customer/customerBillingData.spec.js} (100%) rename test/cypress/integration/{client/clientCredits.spec.js => customer/customerCredits.spec.js} (86%) rename test/cypress/integration/{client/clientFiscalData.spec.js => customer/customerFiscalData.spec.js} (100%) rename test/cypress/integration/{client/clientGreuges.spec.js => customer/customerGreuges.spec.js} (100%) rename test/cypress/integration/{client/clientList.spec.js => customer/customerList.spec.js} (100%) rename test/cypress/integration/{client/clientNotes.spec.js => customer/customerNotes.spec.js} (100%) rename test/cypress/integration/{client/clientRecoveries.spec.js => customer/customerRecoveries.spec.js} (86%) rename test/cypress/integration/{client/clientWebAccess.spec.js => customer/customerWebAccess.spec.js} (100%) rename test/cypress/integration/{client/others/clientConsumption.spec.js => customer/others/customerConsumption.spec.js} (86%) rename test/cypress/integration/{client/others/clientContacts.spec.js => customer/others/customerContacts.spec.js} (100%) rename test/cypress/integration/{client/others/clientMandates.spec.js => customer/others/customerMandates.spec.js} (86%) rename test/cypress/integration/{client/others/clientSamples.spec.js => customer/others/customerSamples.spec.js} (86%) rename test/cypress/integration/{client/others/clientUnpaid.spec.js => customer/others/customerUnpaid.spec.js} (100%) rename test/cypress/integration/{client/others/clientWebPayments.spec.js => customer/others/customerWebPayments.spec.js} (70%) diff --git a/test/cypress/integration/client/credit-management/clientCreditContracts.spec.js b/test/cypress/integration/customer/credit-management/customerCreditContracts.spec.js similarity index 100% rename from test/cypress/integration/client/credit-management/clientCreditContracts.spec.js rename to test/cypress/integration/customer/credit-management/customerCreditContracts.spec.js diff --git a/test/cypress/integration/client/credit-management/clientCreditOpinion.spec.js b/test/cypress/integration/customer/credit-management/customerCreditOpinion.spec.js similarity index 87% rename from test/cypress/integration/client/credit-management/clientCreditOpinion.spec.js rename to test/cypress/integration/customer/credit-management/customerCreditOpinion.spec.js index 7d9c0fa77..c32215f01 100644 --- a/test/cypress/integration/client/credit-management/clientCreditOpinion.spec.js +++ b/test/cypress/integration/customer/credit-management/customerCreditOpinion.spec.js @@ -8,6 +8,6 @@ describe('Client credit opinion', () => { }); }); it('Should load layout', () => { - cy.get('.q-card').should('be.visible'); + cy.get('.q-page').should('be.visible'); }); }); diff --git a/test/cypress/integration/client/clientAddress.spec.js b/test/cypress/integration/customer/customerAddress.spec.js similarity index 100% rename from test/cypress/integration/client/clientAddress.spec.js rename to test/cypress/integration/customer/customerAddress.spec.js diff --git a/test/cypress/integration/client/clientBalance.spec.js b/test/cypress/integration/customer/customerBalance.spec.js similarity index 86% rename from test/cypress/integration/client/clientBalance.spec.js rename to test/cypress/integration/customer/customerBalance.spec.js index 4a666bdb1..dfba56b16 100644 --- a/test/cypress/integration/client/clientBalance.spec.js +++ b/test/cypress/integration/customer/customerBalance.spec.js @@ -8,6 +8,6 @@ describe('Client balance', () => { }); }); it('Should load layout', () => { - cy.get('.q-card').should('be.visible'); + cy.get('.q-page').should('be.visible'); }); }); diff --git a/test/cypress/integration/client/clientBasicData.spec.js b/test/cypress/integration/customer/customerBasicData.spec.js similarity index 100% rename from test/cypress/integration/client/clientBasicData.spec.js rename to test/cypress/integration/customer/customerBasicData.spec.js diff --git a/test/cypress/integration/client/clientBillingData.spec.js b/test/cypress/integration/customer/customerBillingData.spec.js similarity index 100% rename from test/cypress/integration/client/clientBillingData.spec.js rename to test/cypress/integration/customer/customerBillingData.spec.js diff --git a/test/cypress/integration/client/clientCredits.spec.js b/test/cypress/integration/customer/customerCredits.spec.js similarity index 86% rename from test/cypress/integration/client/clientCredits.spec.js rename to test/cypress/integration/customer/customerCredits.spec.js index f81bf987d..5f303b40d 100644 --- a/test/cypress/integration/client/clientCredits.spec.js +++ b/test/cypress/integration/customer/customerCredits.spec.js @@ -8,6 +8,6 @@ describe('Client credits', () => { }); }); it('Should load layout', () => { - cy.get('.q-card').should('be.visible'); + cy.get('.q-page').should('be.visible'); }); }); diff --git a/test/cypress/integration/client/clientFiscalData.spec.js b/test/cypress/integration/customer/customerFiscalData.spec.js similarity index 100% rename from test/cypress/integration/client/clientFiscalData.spec.js rename to test/cypress/integration/customer/customerFiscalData.spec.js diff --git a/test/cypress/integration/client/clientGreuges.spec.js b/test/cypress/integration/customer/customerGreuges.spec.js similarity index 100% rename from test/cypress/integration/client/clientGreuges.spec.js rename to test/cypress/integration/customer/customerGreuges.spec.js diff --git a/test/cypress/integration/client/clientList.spec.js b/test/cypress/integration/customer/customerList.spec.js similarity index 100% rename from test/cypress/integration/client/clientList.spec.js rename to test/cypress/integration/customer/customerList.spec.js diff --git a/test/cypress/integration/client/clientNotes.spec.js b/test/cypress/integration/customer/customerNotes.spec.js similarity index 100% rename from test/cypress/integration/client/clientNotes.spec.js rename to test/cypress/integration/customer/customerNotes.spec.js diff --git a/test/cypress/integration/client/clientRecoveries.spec.js b/test/cypress/integration/customer/customerRecoveries.spec.js similarity index 86% rename from test/cypress/integration/client/clientRecoveries.spec.js rename to test/cypress/integration/customer/customerRecoveries.spec.js index a4e220008..ea6f14407 100644 --- a/test/cypress/integration/client/clientRecoveries.spec.js +++ b/test/cypress/integration/customer/customerRecoveries.spec.js @@ -8,6 +8,6 @@ describe('Client recoveries', () => { }); }); it('Should load layout', () => { - cy.get('.q-card').should('be.visible'); + cy.get('.q-page').should('be.visible'); }); }); diff --git a/test/cypress/integration/client/clientWebAccess.spec.js b/test/cypress/integration/customer/customerWebAccess.spec.js similarity index 100% rename from test/cypress/integration/client/clientWebAccess.spec.js rename to test/cypress/integration/customer/customerWebAccess.spec.js diff --git a/test/cypress/integration/client/others/clientConsumption.spec.js b/test/cypress/integration/customer/others/customerConsumption.spec.js similarity index 86% rename from test/cypress/integration/client/others/clientConsumption.spec.js rename to test/cypress/integration/customer/others/customerConsumption.spec.js index 179a37707..bbc11998e 100644 --- a/test/cypress/integration/client/others/clientConsumption.spec.js +++ b/test/cypress/integration/customer/others/customerConsumption.spec.js @@ -8,6 +8,6 @@ describe('Client consumption', () => { }); }); it('Should load layout', () => { - cy.get('.q-card').should('be.visible'); + cy.get('.q-page').should('be.visible'); }); }); diff --git a/test/cypress/integration/client/others/clientContacts.spec.js b/test/cypress/integration/customer/others/customerContacts.spec.js similarity index 100% rename from test/cypress/integration/client/others/clientContacts.spec.js rename to test/cypress/integration/customer/others/customerContacts.spec.js diff --git a/test/cypress/integration/client/others/clientMandates.spec.js b/test/cypress/integration/customer/others/customerMandates.spec.js similarity index 86% rename from test/cypress/integration/client/others/clientMandates.spec.js rename to test/cypress/integration/customer/others/customerMandates.spec.js index aaeb7f930..055eda2d0 100644 --- a/test/cypress/integration/client/others/clientMandates.spec.js +++ b/test/cypress/integration/customer/others/customerMandates.spec.js @@ -8,6 +8,6 @@ describe('Client mandates', () => { }); }); it('Should load layout', () => { - cy.get('.q-card').should('be.visible'); + cy.get('.q-page').should('be.visible'); }); }); diff --git a/test/cypress/integration/client/others/clientSamples.spec.js b/test/cypress/integration/customer/others/customerSamples.spec.js similarity index 86% rename from test/cypress/integration/client/others/clientSamples.spec.js rename to test/cypress/integration/customer/others/customerSamples.spec.js index 03b7238f4..a50120402 100644 --- a/test/cypress/integration/client/others/clientSamples.spec.js +++ b/test/cypress/integration/customer/others/customerSamples.spec.js @@ -8,6 +8,6 @@ describe('Client samples', () => { }); }); it('Should load layout', () => { - cy.get('.q-card').should('be.visible'); + cy.get('.q-page').should('be.visible'); }); }); diff --git a/test/cypress/integration/client/others/clientUnpaid.spec.js b/test/cypress/integration/customer/others/customerUnpaid.spec.js similarity index 100% rename from test/cypress/integration/client/others/clientUnpaid.spec.js rename to test/cypress/integration/customer/others/customerUnpaid.spec.js diff --git a/test/cypress/integration/client/others/clientWebPayments.spec.js b/test/cypress/integration/customer/others/customerWebPayments.spec.js similarity index 70% rename from test/cypress/integration/client/others/clientWebPayments.spec.js rename to test/cypress/integration/customer/others/customerWebPayments.spec.js index 5f7087d21..f35b12612 100644 --- a/test/cypress/integration/client/others/clientWebPayments.spec.js +++ b/test/cypress/integration/customer/others/customerWebPayments.spec.js @@ -3,11 +3,11 @@ describe('Client web payments', () => { beforeEach(() => { cy.viewport(1280, 720); cy.login('developer'); - cy.visit('#/customer/1101/others/web-payments', { + cy.visit('#/customer/1101/others/web-payment', { timeout: 5000, }); }); it('Should load layout', () => { - cy.get('.q-card').should('be.visible'); + cy.get('.q-page').should('be.visible'); }); }); diff --git a/test/cypress/support/commands.js b/test/cypress/support/commands.js index f0e64e660..75b5eeec3 100755 --- a/test/cypress/support/commands.js +++ b/test/cypress/support/commands.js @@ -254,7 +254,13 @@ Cypress.Commands.add('validateContent', (selector, expectedValue) => { }); Cypress.Commands.add('openActionsDescriptor', () => { - cy.get('.header > :nth-child(3) > .q-btn__content > .q-icon').click(); + cy.get('[data-cy="descriptor-more-opts"]').click(); +}); + +Cypress.Commands.add('clickButtonsDescriptor', (id) => { + cy.get(`.actions > .q-card__actions> .q-btn:nth-child(${id})`) + .invoke('removeAttr', 'target') + .click(); }); Cypress.Commands.add('openUserPanel', () => { @@ -262,6 +268,25 @@ Cypress.Commands.add('openUserPanel', () => { '.column > .q-avatar > .q-avatar__content > .q-img > .q-img__container > .q-img__image' ).click(); }); +Cypress.Commands.add('checkNotification', (text) => { + cy.get('.q-notification') + .should('be.visible') + .last() + .then(($lastNotification) => { + if (!Cypress.$($lastNotification).text().includes(text)) + throw new Error(`Notification not found: "${text}"`); + }); +}); + +Cypress.Commands.add('checkValueForm', (id, search) => { + cy.get( + `.grid-create > :nth-child(${id}) > .q-field__inner > .q-field__control > .q-field__control-container > .q-field__native > .q-field__input` + ).should('have.value', search); +}); + +Cypress.Commands.add('searchByLabel', (label, value) => { + cy.get(`[label="${label}"] > .q-field > .q-field__inner`).type(`${value}{enter}`); +}); Cypress.Commands.add('dataCy', (tag, attr = 'data-cy') => { return cy.get(`[${attr}="${tag}"]`);