test: improve clientList
gitea/salix-front/pipeline/pr-master This commit looks good Details

This commit is contained in:
Javier Segarra 2024-11-26 23:34:57 +01:00
parent cf34204f82
commit 4539a73efc
2 changed files with 10 additions and 13 deletions

View File

@ -17,12 +17,14 @@ describe('Client list', () => {
it('Client list create new client', () => {
cy.get('.q-page-sticky > div > .q-btn > .q-btn__content > .q-icon').click();
const randomInt = Math.floor(Math.random() * 90) + 10;
const data = {
Name: { val: 'Name 1' },
'Social name': { val: 'TEST 1' },
'Tax number': { val: '20852113Z' },
'Web user': { val: 'user_test_1' },
Street: { val: 'C/ STREET 1' },
Name: { val: `Name ${randomInt}` },
'Social name': { val: `TEST ${randomInt}` },
'Tax number': { val: `20852${randomInt.length}3Z` },
'Web user': { val: `user_test_${randomInt}` },
Street: { val: `C/ STREET ${randomInt}` },
Email: { val: 'user.test@1.com' },
'Sales person': { val: 'employee', type: 'select' },
Location: { val: '46000, Valencia(Province one), España', type: 'select' },
@ -54,11 +56,8 @@ describe('Client list', () => {
cy.openActionDescriptor('Create ticket');
cy.waitForElement('#formModel');
cy.waitForElement('.q-form');
cy.checkValueForm(1, search);
cy.checkValueForm(2, search);
cy.get('.grid-create >:nth-child(1)').find('input').should('have.value', search);
cy.get('.grid-create >:nth-child(2)').find('input').should('have.value', search);
});
it('Client founded create order', () => {
const search = 'Jessica Jones';
@ -68,7 +67,5 @@ describe('Client list', () => {
cy.waitForElement('.q-form');
cy.checkValueForm(1, search);
cy.checkValueForm(2, search);
cy.get('.grid-create >:nth-child(2)').find('input').should('have.value', search);
cy.get('.grid-create >:nth-child(4)').find('input').should('have.value', search);
});
});

View File

@ -323,9 +323,9 @@ Cypress.Commands.add('openActions', (row) => {
});
Cypress.Commands.add('checkValueForm', (id, search) => {
cy.get(
`.grid-create > :nth-child(${id}) > .q-field__inner > .q-field__control > .q-field__control-container > .q-field__native > .q-field__input`
).should('have.value', search);
cy.get(`.grid-create > :nth-child(${id}) `)
.find('input')
.should('have.value', search);
});
Cypress.Commands.add('checkValueSelectForm', (id, search) => {