diff --git a/cypress.config.js b/cypress.config.js index 2ceb523c788..4c7731fd0cc 100644 --- a/cypress.config.js +++ b/cypress.config.js @@ -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, - }, }); diff --git a/src/pages/InvoiceOut/InvoiceOutList.vue b/src/pages/InvoiceOut/InvoiceOutList.vue index 9398ded648c..c322da3421d 100644 --- a/src/pages/InvoiceOut/InvoiceOutList.vue +++ b/src/pages/InvoiceOut/InvoiceOutList.vue @@ -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 diff --git a/test/cypress/integration/client/clientList.spec.js b/test/cypress/integration/client/clientList.spec.js index dcded63b0fe..9b83a00f25c 100644 --- a/test/cypress/integration/client/clientList.spec.js +++ b/test/cypress/integration/client/clientList.spec.js @@ -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); diff --git a/test/cypress/support/commands.js b/test/cypress/support/commands.js index aa67a9558ef..2cb85153d02 100755 --- a/test/cypress/support/commands.js +++ b/test/cypress/support/commands.js @@ -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';