test: refs #6695 e2e better checkNotification
gitea/salix-front/pipeline/pr-dev There was a failure building this commit
Details
gitea/salix-front/pipeline/pr-dev There was a failure building this commit
Details
This commit is contained in:
parent
b532047516
commit
02fc8fce52
|
@ -38,9 +38,9 @@ COPY \
|
||||||
# pnpm install cypress && \
|
# pnpm install cypress && \
|
||||||
# npx cypress install
|
# npx cypress install
|
||||||
|
|
||||||
RUN pnpm install --prefer-offline && \
|
RUN pnpm install --frozen-lockfile --prefer-offline && \
|
||||||
pnpm install cypress && \
|
pnpx cypress install && \
|
||||||
pnpx cypress install
|
pnpm store prune
|
||||||
|
|
||||||
COPY \
|
COPY \
|
||||||
quasar.config.js \
|
quasar.config.js \
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { defineConfig } from 'cypress';
|
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/tooling/reporters
|
||||||
// https://docs.cypress.io/app/references/configuration
|
// https://docs.cypress.io/app/references/configuration
|
||||||
// https://www.npmjs.com/package/cypress-mochawesome-reporter
|
// https://www.npmjs.com/package/cypress-mochawesome-reporter
|
||||||
|
@ -19,16 +19,16 @@ export default defineConfig({
|
||||||
downloadsFolder: 'test/cypress/downloads',
|
downloadsFolder: 'test/cypress/downloads',
|
||||||
video: false,
|
video: false,
|
||||||
specPattern: [
|
specPattern: [
|
||||||
'test/cypress/integration/entry/stockBought.spec.js',
|
// 'test/cypress/integration/entry/stockBought.spec.js',
|
||||||
'test/cypress/integration/invoiceOut/invoiceOutNegativeBases.js',
|
// 'test/cypress/integration/invoiceOut/invoiceOutNegativeBases.js',
|
||||||
'test/cypress/integration/invoiceOut/invoiceOutMakeInvoice.spec.js',
|
// 'test/cypress/integration/invoiceOut/invoiceOutMakeInvoice.spec.js',
|
||||||
'test/cypress/integration/item/itemTag.spec.js',
|
'test/cypress/integration/item/itemTag.spec.js',
|
||||||
'test/cypress/integration/route/routeList.spec.js',
|
// 'test/cypress/integration/route/routeList.spec.js',
|
||||||
'test/cypress/integration/ticket/ticketList.spec.js',
|
// 'test/cypress/integration/ticket/ticketList.spec.js',
|
||||||
'test/cypress/integration/ticket/ticketSale.spec.js',
|
// 'test/cypress/integration/ticket/ticketSale.spec.js',
|
||||||
'test/cypress/integration/vnComponent/UserPanel.spec.js',
|
// 'test/cypress/integration/vnComponent/UserPanel.spec.js',
|
||||||
'test/cypress/integration/vnComponent/VnLocation.spec.js',
|
// 'test/cypress/integration/vnComponent/VnLocation.spec.js',
|
||||||
'test/cypress/integration/worker/workerNotificationsManager.spec.js',
|
// 'test/cypress/integration/worker/workerNotificationsManager.spec.js',
|
||||||
],
|
],
|
||||||
experimentalRunAllSpecs: true,
|
experimentalRunAllSpecs: true,
|
||||||
watchForFileChanges: true,
|
watchForFileChanges: true,
|
||||||
|
@ -47,7 +47,7 @@ export default defineConfig({
|
||||||
supportFile: 'test/cypress/support/unit.js',
|
supportFile: 'test/cypress/support/unit.js',
|
||||||
},
|
},
|
||||||
setupNodeEvents: async (on, config) => {
|
setupNodeEvents: async (on, config) => {
|
||||||
on('file:preprocessor', vitePreprocessor());
|
// on('file:preprocessor', vitePreprocessor());
|
||||||
const plugin = await import('cypress-mochawesome-reporter/plugin');
|
const plugin = await import('cypress-mochawesome-reporter/plugin');
|
||||||
plugin.default(on);
|
plugin.default(on);
|
||||||
return config;
|
return config;
|
||||||
|
|
|
@ -4,29 +4,30 @@ describe('Item tag', () => {
|
||||||
cy.viewport(1920, 1080);
|
cy.viewport(1920, 1080);
|
||||||
cy.login('developer');
|
cy.login('developer');
|
||||||
cy.visit(`/#/item/1/tags`);
|
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', () => {
|
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.get('.q-page-sticky > div').click();
|
cy.get('.q-page-sticky > div').click();
|
||||||
cy.dataCy('Tag_select').eq(7).type('Tallos');
|
cy.selectOption(':nth-child(8) > .q-select', 'Tallos');
|
||||||
cy.get('.q-menu .q-item').contains('Tallos').click();
|
|
||||||
cy.get(':nth-child(8) > [label="Value"]').type('1');
|
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");
|
cy.checkNotification("The tag or priority can't be repeated for an item");
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should add a new tag', () => {
|
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.get('.q-page-sticky > div').click();
|
cy.get('.q-page-sticky > div').click();
|
||||||
cy.dataCy('Tag_select').eq(7).click();
|
cy.selectOption(':nth-child(8) > .q-select', 'Ancho de la base');
|
||||||
cy.get('.q-menu .q-item').contains('Ancho de la base').type('{enter}');
|
|
||||||
cy.get(':nth-child(8) > [label="Value"]').type('50');
|
cy.get(':nth-child(8) > [label="Value"]').type('50');
|
||||||
cy.dataCy('crudModelDefaultSaveBtn').click();
|
cy.dataCy('crudModelDefaultSaveBtn').click();
|
||||||
cy.checkNotification('Data saved');
|
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.dataCy('VnConfirm_confirm').click();
|
||||||
cy.checkNotification('Data saved');
|
cy.checkNotification('Data saved');
|
||||||
});
|
});
|
||||||
|
|
|
@ -331,11 +331,8 @@ Cypress.Commands.add('openUserPanel', () => {
|
||||||
Cypress.Commands.add('checkNotification', (text) => {
|
Cypress.Commands.add('checkNotification', (text) => {
|
||||||
cy.get('.q-notification')
|
cy.get('.q-notification')
|
||||||
.should('be.visible')
|
.should('be.visible')
|
||||||
.last()
|
.contains(text, { timeout: 5000 })
|
||||||
.then(($lastNotification) => {
|
.should('be.visible');
|
||||||
if (!Cypress.$($lastNotification).text().includes(text))
|
|
||||||
throw new Error(`Notification not found: "${text}"`);
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|
||||||
Cypress.Commands.add('openActions', (row) => {
|
Cypress.Commands.add('openActions', (row) => {
|
||||||
|
|
Loading…
Reference in New Issue