Merge branch 'dev' of https://gitea.verdnatura.es/verdnatura/salix-front into 8484-waitToDomContentLoadedInTests
gitea/salix-front/pipeline/pr-dev Build queued... Details

This commit is contained in:
Jorge Penadés 2025-02-26 16:11:22 +01:00
commit ae4b420e6d
4 changed files with 20 additions and 15 deletions

View File

@ -225,7 +225,7 @@ const toModule = computed(() =>
<div class="icons"> <div class="icons">
<slot name="icons" :entity="entity" /> <slot name="icons" :entity="entity" />
</div> </div>
<div class="actions justify-center"> <div class="actions justify-center" data-cy="descriptor_actions">
<slot name="actions" :entity="entity" /> <slot name="actions" :entity="entity" />
</div> </div>
<slot name="after" /> <slot name="after" />

View File

@ -1,16 +1,9 @@
<script setup> <script setup>
import VnSection from 'src/components/common/VnSection.vue';
import WorkerDepartmentTree from './WorkerDepartmentTree.vue'; import WorkerDepartmentTree from './WorkerDepartmentTree.vue';
</script> </script>
<template> <template>
<VnSection data-key="WorkerDepartment" :search-bar="false"> <QPage class="q-pa-md flex justify-center"> <WorkerDepartmentTree /> </QPage>
<template #body>
<div class="flex flex-center q-pa-md">
<WorkerDepartmentTree />
</div>
</template>
</VnSection>
</template> </template>
<i18n> <i18n>

View File

@ -1,7 +1,6 @@
/// <reference types="cypress" /> /// <reference types="cypress" />
describe.skip('Client list', () => { describe('Client list', () => {
beforeEach(() => { beforeEach(() => {
cy.viewport(1280, 720);
cy.login('developer'); cy.login('developer');
cy.visit('/#/customer/list', { cy.visit('/#/customer/list', {
timeout: 5000, timeout: 5000,
@ -28,7 +27,7 @@ describe.skip('Client list', () => {
Email: { val: `user.test${randomInt}@cypress.com` }, Email: { val: `user.test${randomInt}@cypress.com` },
'Sales person': { val: 'salesPerson', type: 'select' }, 'Sales person': { val: 'salesPerson', type: 'select' },
Location: { val: '46000', type: 'select' }, Location: { val: '46000', type: 'select' },
'Business type': { val: 'Otros', type: 'select' }, 'Business type': { val: 'others', type: 'select' },
}; };
cy.fillInForm(data); cy.fillInForm(data);
@ -37,6 +36,7 @@ describe.skip('Client list', () => {
cy.checkNotification('Data created'); cy.checkNotification('Data created');
cy.url().should('include', '/summary'); cy.url().should('include', '/summary');
}); });
it('Client list search client', () => { it('Client list search client', () => {
const search = 'Jessica Jones'; const search = 'Jessica Jones';
cy.searchByLabel('Name', search); cy.searchByLabel('Name', search);
@ -59,6 +59,7 @@ describe.skip('Client list', () => {
cy.checkValueForm(1, search); cy.checkValueForm(1, search);
cy.checkValueForm(2, search); cy.checkValueForm(2, search);
}); });
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);

View File

@ -354,8 +354,13 @@ Cypress.Commands.add('openUserPanel', () => {
Cypress.Commands.add('checkNotification', (text) => { Cypress.Commands.add('checkNotification', (text) => {
cy.get('.q-notification', { timeout: 10000 }) cy.get('.q-notification', { timeout: 10000 })
.should('be.visible') .should('be.visible')
.filter((_, el) => Cypress.$(el).text().includes(text)) .should('have.length.greaterThan', 0)
.should('have.length.greaterThan', 0); .should(($elements) => {
const found = $elements
.toArray()
.some((el) => Cypress.$(el).text().includes(text));
expect(found).to.be.true;
});
}); });
Cypress.Commands.add('openActions', (row) => { Cypress.Commands.add('openActions', (row) => {
@ -401,7 +406,13 @@ Cypress.Commands.add('clickButtonWith', (type, value) => {
} }
}); });
Cypress.Commands.add('clickButtonWithIcon', (iconClass) => { Cypress.Commands.add('clickButtonWithIcon', (iconClass) => {
cy.get(`.q-icon.${iconClass}`).parent().click(); cy.waitForElement('[data-cy="descriptor_actions"]');
cy.get('[data-cy="loading-spinner"]', { timeout: 10000 }).should('not.be.visible');
cy.get('.q-btn')
.filter((index, el) => Cypress.$(el).find('.q-icon.' + iconClass).length > 0)
.then(($btn) => {
cy.wrap($btn).click();
});
}); });
Cypress.Commands.add('clickButtonWithText', (buttonText) => { Cypress.Commands.add('clickButtonWithText', (buttonText) => {
cy.get('.q-btn').contains(buttonText).click(); cy.get('.q-btn').contains(buttonText).click();