diff --git a/test/cypress/integration/client/clientBalance.spec.js b/test/cypress/integration/client/clientBalance.spec.js index 4a666bdb1..dfba56b16 100644 --- a/test/cypress/integration/client/clientBalance.spec.js +++ b/test/cypress/integration/client/clientBalance.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/clientCredits.spec.js b/test/cypress/integration/client/clientCredits.spec.js index f81bf987d..5f303b40d 100644 --- a/test/cypress/integration/client/clientCredits.spec.js +++ b/test/cypress/integration/client/clientCredits.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/clientList.spec.js b/test/cypress/integration/client/clientList.spec.js index 93e53b9f6..22bca15ac 100644 --- a/test/cypress/integration/client/clientList.spec.js +++ b/test/cypress/integration/client/clientList.spec.js @@ -28,7 +28,7 @@ describe('Client list', () => { cy.get('.q-mt-lg > .q-btn--standard').click(); - cy.checkNotification('created'); + cy.checkNotification('Data created'); cy.url().should('include', '/summary'); }); it('Client list search client', () => { @@ -43,21 +43,4 @@ describe('Client list', () => { cy.url().should('include', `/customer/${id}/summary`); }); }); - - it('Client founded create ticket', () => { - const search = 'Jessica Jones'; - cy.searchByLabel('Name', search); - cy.clickButtonsDescriptor(2); - cy.waitForElement('#formModel'); - cy.waitForElement('.q-form'); - cy.checkValueForm(1, search); - }); - it('Client founded create order', () => { - const search = 'Jessica Jones'; - cy.searchByLabel('Name', search); - cy.clickButtonsDescriptor(4); - cy.waitForElement('#formModel'); - cy.waitForElement('.q-form'); - cy.checkValueForm(2, search); - }); }); diff --git a/test/cypress/integration/client/clientRecoveries.spec.js b/test/cypress/integration/client/clientRecoveries.spec.js index a4e220008..ea6f14407 100644 --- a/test/cypress/integration/client/clientRecoveries.spec.js +++ b/test/cypress/integration/client/clientRecoveries.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/credit-management/clientCreditOpinion.spec.js b/test/cypress/integration/client/credit-management/clientCreditOpinion.spec.js index 7d9c0fa77..c32215f01 100644 --- a/test/cypress/integration/client/credit-management/clientCreditOpinion.spec.js +++ b/test/cypress/integration/client/credit-management/clientCreditOpinion.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/others/clientConsumption.spec.js b/test/cypress/integration/client/others/clientConsumption.spec.js index 179a37707..bbc11998e 100644 --- a/test/cypress/integration/client/others/clientConsumption.spec.js +++ b/test/cypress/integration/client/others/clientConsumption.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/clientMandates.spec.js b/test/cypress/integration/client/others/clientMandates.spec.js index aaeb7f930..055eda2d0 100644 --- a/test/cypress/integration/client/others/clientMandates.spec.js +++ b/test/cypress/integration/client/others/clientMandates.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/client/others/clientSamples.spec.js index 03b7238f4..a50120402 100644 --- a/test/cypress/integration/client/others/clientSamples.spec.js +++ b/test/cypress/integration/client/others/clientSamples.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/clientWebPayments.spec.js b/test/cypress/integration/client/others/clientWebPayments.spec.js index 5f7087d21..f35b12612 100644 --- a/test/cypress/integration/client/others/clientWebPayments.spec.js +++ b/test/cypress/integration/client/others/clientWebPayments.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/integration/route/agency/agencyWorkCenter.spec.js b/test/cypress/integration/route/agency/agencyWorkCenter.spec.js index 6a3cab664..fdfcd4286 100644 --- a/test/cypress/integration/route/agency/agencyWorkCenter.spec.js +++ b/test/cypress/integration/route/agency/agencyWorkCenter.spec.js @@ -11,16 +11,16 @@ describe('AgencyWorkCenter', () => { // create cy.get(createButton).click(); cy.get(workCenterCombobox).type('workCenterOne{enter}'); - cy.hasNotify('Data created'); + cy.checkNotification('Data created'); // expect error when duplicate cy.get(createButton).click(); cy.get('[data-cy="FormModelPopup_save"]').click(); - cy.hasNotify('This workCenter is already assigned to this agency'); + cy.checkNotification('This workCenter is already assigned to this agency'); cy.get('[data-cy="FormModelPopup_cancel"]').click(); // delete cy.get('.q-item__section--side > .q-btn > .q-btn__content > .q-icon').click(); - cy.hasNotify('WorkCenter removed successfully'); + cy.checkNotification('WorkCenter removed successfully'); }); }); diff --git a/test/cypress/integration/worker/workerNotificationsManager.spec.js b/test/cypress/integration/worker/workerNotificationsManager.spec.js index 367287a5a..f121b3894 100644 --- a/test/cypress/integration/worker/workerNotificationsManager.spec.js +++ b/test/cypress/integration/worker/workerNotificationsManager.spec.js @@ -17,7 +17,9 @@ describe('WorkerNotificationsManager', () => { cy.login('developer'); cy.visit(`/#/worker/${salesPersonId}/notifications`); cy.get(firstAvailableNotification).click(); - cy.hasNotify('The notification subscription of this worker cant be modified'); + cy.checkNotification( + 'The notification subscription of this worker cant be modified' + ); }); it('should active a notification that is yours', () => { diff --git a/test/cypress/support/commands.js b/test/cypress/support/commands.js index e1bf6c950..c9b1a748e 100755 --- a/test/cypress/support/commands.js +++ b/test/cypress/support/commands.js @@ -253,6 +253,13 @@ Cypress.Commands.add('validateContent', (selector, expectedValue) => { cy.get(selector).should('have.text', expectedValue); }); +Cypress.Commands.add('openActionDescriptor', (opt) => { + cy.openActionsDescriptor(); + const listItem = '[role="menu"] .q-list .q-item'; + cy.contains(listItem, opt).click(); + 1; +}); + Cypress.Commands.add('openActionsDescriptor', () => { cy.get('.header > :nth-child(3) > .q-btn__content > .q-icon').click(); }); @@ -263,8 +270,11 @@ Cypress.Commands.add('openUserPanel', () => { ).click(); }); -Cypress.Commands.add('hasNotify', (text) => { - //last +Cypress.Commands.add('openActions', (row) => { + cy.get('tbody > tr').eq(row).find('.actions > .q-btn').click(); +}); + +Cypress.Commands.add('checkNotification', (text) => { cy.get('.q-notification') .should('be.visible') .last() @@ -273,3 +283,7 @@ Cypress.Commands.add('hasNotify', (text) => { throw new Error(`Notification not found: "${text}"`); }); }); + +Cypress.Commands.add('searchByLabel', (label, value) => { + cy.get(`[label="${label}"] > .q-field > .q-field__inner`).type(`${value}{enter}`); +});