refactor: refs #8581 update client list and invoice descriptor tests for improved clarity and functionality
gitea/salix-front/pipeline/pr-dev There was a failure building this commit Details

This commit is contained in:
Jorge Penadés 2025-02-26 14:18:19 +01:00
parent 271f7d70af
commit ad10e62217
3 changed files with 11 additions and 13 deletions

View File

@ -1,5 +1,5 @@
/// <reference types="cypress" />
describe.skip('Client list', () => {
describe('Client list', () => {
beforeEach(() => {
cy.viewport(1280, 720);
cy.login('developer');
@ -53,7 +53,7 @@ describe.skip('Client list', () => {
it('Client founded create ticket', () => {
const search = 'Jessica Jones';
cy.searchByLabel('Name', search);
cy.openActionDescriptor('Create ticket');
cy.selectDescriptorOption();
cy.waitForElement('#formModel');
cy.waitForElement('.q-form');
cy.checkValueForm(1, search);

View File

@ -6,7 +6,7 @@ describe('InvoiceInDescriptor', () => {
cy.viewport(1280, 720);
cy.login('developer');
cy.visit('/#/invoice-in/1/summary');
cy.get('[data-cy="cardDescriptor"] [data-cy="descriptor-more-opts"]').click();
cy.openActionsDescriptor();
cy.selectDescriptorOption();
cy.dataCy('VnConfirm_confirm').click();
@ -17,4 +17,7 @@ describe('InvoiceInDescriptor', () => {
cy.validateCheckbox(checkbox, false);
});
});
// it('should delete the invoice properly', () => {
// });
});

View File

@ -352,14 +352,8 @@ 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();
});
Cypress.Commands.add('openActionsDescriptor', () => {
cy.get('[data-cy="descriptor-more-opts"]').click();
cy.get('[data-cy="cardDescriptor"] [data-cy="descriptor-more-opts"]').click();
});
Cypress.Commands.add('clickButtonDescriptor', (id) => {
@ -496,9 +490,10 @@ Cypress.Commands.add('checkDate', (rawDate, expectedVal, operation) => {
});
Cypress.Commands.add('selectDescriptorOption', (opt = 1) => {
cy.get(
`[data-cy="descriptor-more-opts_list"] > :not(template):nth-of-type(${opt})`,
).click();
cy.openActionsDescriptor();
const listItem = '[data-cy="descriptor-more-opts_list"]';
cy.waitForElement(listItem);
cy.get(`${listItem} > :not(template):nth-of-type(${opt})`).click();
});
Cypress.Commands.add('validateCheckbox', (selector, expectedVal = 'true') => {