diff --git a/Dockerfile.e2e b/Dockerfile.e2e index 4cf68e47b6..f4c90ef6da 100644 --- a/Dockerfile.e2e +++ b/Dockerfile.e2e @@ -38,9 +38,9 @@ COPY \ # pnpm install cypress && \ # npx cypress install -RUN pnpm install --prefer-offline && \ - pnpm install cypress && \ - pnpx cypress install +RUN pnpm install --frozen-lockfile --prefer-offline && \ + pnpx cypress install && \ + pnpm store prune COPY \ quasar.config.js \ diff --git a/cypress.config.js b/cypress.config.js index 1bc810b162..564eeaa5a3 100644 --- a/cypress.config.js +++ b/cypress.config.js @@ -1,5 +1,5 @@ import { defineConfig } from 'cypress'; -import vitePreprocessor from 'cypress-vite'; +// import vitePreprocessor from 'cypress-vite'; // https://docs.cypress.io/app/tooling/reporters // https://docs.cypress.io/app/references/configuration // https://www.npmjs.com/package/cypress-mochawesome-reporter @@ -19,16 +19,16 @@ export default defineConfig({ downloadsFolder: 'test/cypress/downloads', video: false, specPattern: [ - 'test/cypress/integration/entry/stockBought.spec.js', - 'test/cypress/integration/invoiceOut/invoiceOutNegativeBases.js', - 'test/cypress/integration/invoiceOut/invoiceOutMakeInvoice.spec.js', + // 'test/cypress/integration/entry/stockBought.spec.js', + // 'test/cypress/integration/invoiceOut/invoiceOutNegativeBases.js', + // 'test/cypress/integration/invoiceOut/invoiceOutMakeInvoice.spec.js', 'test/cypress/integration/item/itemTag.spec.js', - 'test/cypress/integration/route/routeList.spec.js', - 'test/cypress/integration/ticket/ticketList.spec.js', - 'test/cypress/integration/ticket/ticketSale.spec.js', - 'test/cypress/integration/vnComponent/UserPanel.spec.js', - 'test/cypress/integration/vnComponent/VnLocation.spec.js', - 'test/cypress/integration/worker/workerNotificationsManager.spec.js', + // 'test/cypress/integration/route/routeList.spec.js', + // 'test/cypress/integration/ticket/ticketList.spec.js', + // 'test/cypress/integration/ticket/ticketSale.spec.js', + // 'test/cypress/integration/vnComponent/UserPanel.spec.js', + // 'test/cypress/integration/vnComponent/VnLocation.spec.js', + // 'test/cypress/integration/worker/workerNotificationsManager.spec.js', ], experimentalRunAllSpecs: true, watchForFileChanges: true, @@ -47,7 +47,7 @@ export default defineConfig({ supportFile: 'test/cypress/support/unit.js', }, setupNodeEvents: async (on, config) => { - on('file:preprocessor', vitePreprocessor()); + // on('file:preprocessor', vitePreprocessor()); const plugin = await import('cypress-mochawesome-reporter/plugin'); plugin.default(on); return config; diff --git a/test/cypress/integration/item/itemTag.spec.js b/test/cypress/integration/item/itemTag.spec.js index 10d68d08a6..4182085007 100644 --- a/test/cypress/integration/item/itemTag.spec.js +++ b/test/cypress/integration/item/itemTag.spec.js @@ -4,30 +4,31 @@ describe('Item tag', () => { cy.viewport(1920, 1080); cy.login('developer'); cy.visit(`/#/item/1/tags`); + cy.get('.q-page').should('be.visible'); + cy.waitForElement('[data-cy="itemTags"]'); }); it('should throw an error adding an existent tag', () => { - cy.get('.q-page').should('be.visible'); cy.get('.q-page-sticky > div').click(); cy.get('.q-page-sticky > div').click(); - cy.dataCy('Tag_select').eq(7).type('Tallos'); - cy.get('.q-menu .q-item').contains('Tallos').click(); + cy.selectOption(':nth-child(8) > .q-select', 'Tallos'); cy.get(':nth-child(8) > [label="Value"]').type('1'); - +cy.dataCy('crudModelDefaultSaveBtn').click(); + cy.dataCy('crudModelDefaultSaveBtn').click(); cy.checkNotification("The tag or priority can't be repeated for an item"); }); it('should add a new tag', () => { - cy.get('.q-page').should('be.visible'); cy.get('.q-page-sticky > div').click(); cy.get('.q-page-sticky > div').click(); - cy.dataCy('Tag_select').eq(7).click(); - cy.get('.q-menu .q-item').contains('Ancho de la base').type('{enter}'); + cy.selectOption(':nth-child(8) > .q-select', 'Ancho de la base'); cy.get(':nth-child(8) > [label="Value"]').type('50'); cy.dataCy('crudModelDefaultSaveBtn').click(); cy.checkNotification('Data saved'); - cy.dataCy('itemTags').children(':nth-child(8)').find('.justify-center > .q-icon').click(); + cy.dataCy('itemTags') + .children(':nth-child(8)') + .find('.justify-center > .q-icon') + .click(); cy.dataCy('VnConfirm_confirm').click(); cy.checkNotification('Data saved'); }); -}); \ No newline at end of file +}); diff --git a/test/cypress/support/commands.js b/test/cypress/support/commands.js index 814cafdf73..5f0d367414 100755 --- a/test/cypress/support/commands.js +++ b/test/cypress/support/commands.js @@ -331,11 +331,8 @@ Cypress.Commands.add('openUserPanel', () => { 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}"`); - }); + .contains(text, { timeout: 5000 }) + .should('be.visible'); }); Cypress.Commands.add('openActions', (row) => {