test: refs #6695 run all e2e (try better selectOption)
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
b8761d3e4c
commit
42ba6969ad
|
@ -44,13 +44,4 @@ export default defineConfig({
|
||||||
viewportWidth: 1280,
|
viewportWidth: 1280,
|
||||||
viewportHeight: 720,
|
viewportHeight: 720,
|
||||||
},
|
},
|
||||||
retries: {
|
|
||||||
experimentalStrategy: 'detect-flake-and-pass-on-threshold',
|
|
||||||
experimentalOptions: {
|
|
||||||
maxRetries: 1,
|
|
||||||
passesRequired: 1,
|
|
||||||
},
|
|
||||||
openMode: false,
|
|
||||||
runMode: true,
|
|
||||||
},
|
|
||||||
});
|
});
|
||||||
|
|
|
@ -21,7 +21,6 @@ import VnSection from 'src/components/common/VnSection.vue';
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const { viewSummary } = useSummaryDialog();
|
const { viewSummary } = useSummaryDialog();
|
||||||
const tableRef = ref();
|
const tableRef = ref();
|
||||||
const invoiceOutSerialsOptions = ref([]);
|
|
||||||
const customerOptions = ref([]);
|
const customerOptions = ref([]);
|
||||||
const selectedRows = ref([]);
|
const selectedRows = ref([]);
|
||||||
const hasSelectedCards = computed(() => selectedRows.value.length > 0);
|
const hasSelectedCards = computed(() => selectedRows.value.length > 0);
|
||||||
|
@ -369,7 +368,6 @@ watchEffect(selectedRows);
|
||||||
url="InvoiceOutSerials"
|
url="InvoiceOutSerials"
|
||||||
v-model="data.serial"
|
v-model="data.serial"
|
||||||
:label="t('invoiceOutModule.serial')"
|
:label="t('invoiceOutModule.serial')"
|
||||||
:options="invoiceOutSerialsOptions"
|
|
||||||
option-label="description"
|
option-label="description"
|
||||||
option-value="code"
|
option-value="code"
|
||||||
option-filter
|
option-filter
|
||||||
|
|
|
@ -62,7 +62,7 @@ describe('Client list', () => {
|
||||||
it('Client founded create order', () => {
|
it('Client founded create order', () => {
|
||||||
const search = 'Jessica Jones';
|
const search = 'Jessica Jones';
|
||||||
cy.searchByLabel('Name', search);
|
cy.searchByLabel('Name', search);
|
||||||
cy.openActionDescriptor('New order');
|
cy.clickButtonsDescriptor(3); // New order
|
||||||
cy.waitForElement('#formModel');
|
cy.waitForElement('#formModel');
|
||||||
cy.waitForElement('.q-form');
|
cy.waitForElement('.q-form');
|
||||||
cy.checkValueForm(1, search);
|
cy.checkValueForm(1, search);
|
||||||
|
|
|
@ -91,26 +91,30 @@ Cypress.Commands.add('getValue', (selector) => {
|
||||||
// Fill Inputs
|
// Fill Inputs
|
||||||
Cypress.Commands.add('selectOption', (selector, option, timeout = 10000) => {
|
Cypress.Commands.add('selectOption', (selector, option, timeout = 10000) => {
|
||||||
cy.waitForElement(selector, timeout); // Esperar a que el selector sea visible
|
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
|
cy.get(selector)
|
||||||
let hasUrl;
|
.click({ force: true })
|
||||||
cy.get('@dataUrl').then((url) => {
|
.invoke('data', 'url')
|
||||||
hasUrl = url;
|
.then((url) => {
|
||||||
cy.intercept('GET', url).as('dataRequest');
|
let finished;
|
||||||
});
|
if (url) {
|
||||||
|
cy.intercept('GET', url, () => {
|
||||||
|
finished = true;
|
||||||
|
}).as('dataRequest');
|
||||||
|
}
|
||||||
cy.get(selector).clear().type(option);
|
cy.get(selector).clear().type(option);
|
||||||
|
|
||||||
if (hasUrl) {
|
if (!finished && url) {
|
||||||
cy.wait('@dataRequest').then(() => {
|
cy.wait('@dataRequest');
|
||||||
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');
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Finalmente, seleccionar la opción deseada
|
cy.get('.q-menu', { timeout }).should('exist').should('be.visible');
|
||||||
cy.get('.q-menu:visible').find('.q-item').contains(option).click({ force: true });
|
|
||||||
|
cy.get('.q-menu:visible')
|
||||||
|
.find('.q-item')
|
||||||
|
.contains(option)
|
||||||
|
.click({ force: true });
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
Cypress.Commands.add('countSelectOptions', (selector, option) => {
|
Cypress.Commands.add('countSelectOptions', (selector, option) => {
|
||||||
|
@ -281,36 +285,10 @@ Cypress.Commands.add('validateContent', (selector, expectedValue) => {
|
||||||
cy.get(selector).should('have.text', 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', () => {
|
Cypress.Commands.add('openActionsDescriptor', () => {
|
||||||
cy.get('[data-cy="descriptor-more-opts"]').click();
|
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) => {
|
Cypress.Commands.add('openActionDescriptor', (opt) => {
|
||||||
cy.openActionsDescriptor();
|
cy.openActionsDescriptor();
|
||||||
const listItem = '[role="menu"] .q-list .q-item';
|
const listItem = '[role="menu"] .q-list .q-item';
|
||||||
|
|
Loading…
Reference in New Issue