test: refs #6695 run all e2e (try better selectOption)
gitea/salix-front/pipeline/pr-dev There was a failure building this commit Details

This commit is contained in:
Alex Moreno 2025-02-03 15:09:40 +01:00
parent b8761d3e4c
commit 42ba6969ad
4 changed files with 22 additions and 55 deletions

View File

@ -44,13 +44,4 @@ export default defineConfig({
viewportWidth: 1280,
viewportHeight: 720,
},
retries: {
experimentalStrategy: 'detect-flake-and-pass-on-threshold',
experimentalOptions: {
maxRetries: 1,
passesRequired: 1,
},
openMode: false,
runMode: true,
},
});

View File

@ -21,7 +21,6 @@ import VnSection from 'src/components/common/VnSection.vue';
const { t } = useI18n();
const { viewSummary } = useSummaryDialog();
const tableRef = ref();
const invoiceOutSerialsOptions = ref([]);
const customerOptions = ref([]);
const selectedRows = ref([]);
const hasSelectedCards = computed(() => selectedRows.value.length > 0);
@ -369,7 +368,6 @@ watchEffect(selectedRows);
url="InvoiceOutSerials"
v-model="data.serial"
:label="t('invoiceOutModule.serial')"
:options="invoiceOutSerialsOptions"
option-label="description"
option-value="code"
option-filter

View File

@ -62,7 +62,7 @@ describe('Client list', () => {
it('Client founded create order', () => {
const search = 'Jessica Jones';
cy.searchByLabel('Name', search);
cy.openActionDescriptor('New order');
cy.clickButtonsDescriptor(3); // New order
cy.waitForElement('#formModel');
cy.waitForElement('.q-form');
cy.checkValueForm(1, search);

View File

@ -91,26 +91,30 @@ Cypress.Commands.add('getValue', (selector) => {
// Fill Inputs
Cypress.Commands.add('selectOption', (selector, option, timeout = 10000) => {
cy.waitForElement(selector, timeout); // Esperar a que el selector sea visible
cy.get(selector).click({ force: true }).invoke('data', 'url').as('dataUrl');
// Escribir la opción deseada
let hasUrl;
cy.get('@dataUrl').then((url) => {
hasUrl = url;
cy.intercept('GET', url).as('dataRequest');
});
cy.get(selector).clear().type(option);
cy.get(selector)
.click({ force: true })
.invoke('data', 'url')
.then((url) => {
let finished;
if (url) {
cy.intercept('GET', url, () => {
finished = true;
}).as('dataRequest');
}
cy.get(selector).clear().type(option);
if (hasUrl) {
cy.wait('@dataRequest').then(() => {
cy.get('.q-menu').should('be.visible').and('exist');
cy.get('.q-menu').should('not.be.visible');
cy.get('.q-menu').should('be.visible').and('exist');
if (!finished && url) {
cy.wait('@dataRequest');
}
cy.get('.q-menu', { timeout }).should('exist').should('be.visible');
cy.get('.q-menu:visible')
.find('.q-item')
.contains(option)
.click({ force: true });
});
}
// Finalmente, seleccionar la opción deseada
cy.get('.q-menu:visible').find('.q-item').contains(option).click({ force: true });
});
Cypress.Commands.add('countSelectOptions', (selector, option) => {
@ -281,36 +285,10 @@ 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('[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('openActionDescriptor', (opt) => {
cy.openActionsDescriptor();
const listItem = '[role="menu"] .q-list .q-item';
cy.contains(listItem, opt).click();
1;
});
Cypress.Commands.add('clickButtonsDescriptor', (id) => {
cy.get(`.actions > .q-card__actions> .q-btn:nth-child(${id})`)
.invoke('removeAttr', 'target')
.click();
});
Cypress.Commands.add('openActionDescriptor', (opt) => {
cy.openActionsDescriptor();
const listItem = '[role="menu"] .q-list .q-item';