Merge branch 'dev' of https://gitea.verdnatura.es/verdnatura/salix-front into fix_workerDescriptorMenu_i18n

This commit is contained in:
Javier Segarra 2025-03-16 13:57:17 +01:00
commit 1b34175ed5
5 changed files with 29 additions and 3 deletions

View File

@ -32,6 +32,18 @@ pnpm run test:front
pnpm run test:e2e pnpm run test:e2e
``` ```
### Run e2e parallel
```bash
pnpm run test:e2e:parallel
```
### View e2e parallel report
```bash
pnpm run test:e2e:summary
```
### Build the app for production ### Build the app for production
```bash ```bash

View File

@ -13,7 +13,7 @@
"format": "prettier --write \"**/*.{js,vue,scss,html,md,json}\" --ignore-path .gitignore", "format": "prettier --write \"**/*.{js,vue,scss,html,md,json}\" --ignore-path .gitignore",
"test:e2e": "cypress open", "test:e2e": "cypress open",
"test:e2e:ci": "npm run resetDatabase && cd ../salix-front && cypress run", "test:e2e:ci": "npm run resetDatabase && cd ../salix-front && cypress run",
"test:e2e:parallel": "bash ./test/cypress/cypressParallel.sh", "test:e2e:parallel": "bash ./test/cypress/run.sh",
"test:e2e:summary": "bash ./test/cypress/summary.sh", "test:e2e:summary": "bash ./test/cypress/summary.sh",
"test": "echo \"See package.json => scripts for available tests.\" && exit 0", "test": "echo \"See package.json => scripts for available tests.\" && exit 0",
"test:front": "vitest", "test:front": "vitest",

View File

@ -24,12 +24,21 @@ describe('Logout', () => {
}, },
}, },
statusMessage: 'AUTHORIZATION_REQUIRED', statusMessage: 'AUTHORIZATION_REQUIRED',
}); }).as('badRequest');
}); });
it('when token not exists', () => { it('when token not exists', () => {
const exceptionHandler = (err) => {
if (err.code === 'AUTHORIZATION_REQUIRED') return;
};
Cypress.on('uncaught:exception', exceptionHandler);
cy.get('.q-list').first().should('be.visible').click(); cy.get('.q-list').first().should('be.visible').click();
cy.wait('@badRequest');
cy.checkNotification('Authorization Required'); cy.checkNotification('Authorization Required');
Cypress.off('uncaught:exception', exceptionHandler);
}); });
}); });
}); });

View File

@ -23,7 +23,7 @@ describe('TicketSale', () => {
cy.get('[data-col-field="price"]') cy.get('[data-col-field="price"]')
.find('.q-btn > .q-btn__content') .find('.q-btn > .q-btn__content')
.should('have.text', `${price}`); .should('contain.text', `${price}`);
}); });
it('update discount', () => { it('update discount', () => {
const discount = Math.floor(Math.random() * 100) + 1; const discount = Math.floor(Math.random() * 100) + 1;

View File

@ -40,6 +40,11 @@ style.innerHTML = `
`; `;
document.head.appendChild(style); document.head.appendChild(style);
// FIXME: https://redmine.verdnatura.es/issues/8771
Cypress.on('uncaught:exception', (err) => {
if (err.code === 'ERR_CANCELED') return false;
});
const waitForApiReady = (url, maxRetries = 20, delay = 1000) => { const waitForApiReady = (url, maxRetries = 20, delay = 1000) => {
let retries = 0; let retries = 0;