diff --git a/test/cypress/integration/client/clientList.spec.js b/test/cypress/integration/client/clientList.spec.js index 5529e5c65..e89b5fc77 100644 --- a/test/cypress/integration/client/clientList.spec.js +++ b/test/cypress/integration/client/clientList.spec.js @@ -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); }); }); diff --git a/test/cypress/support/commands.js b/test/cypress/support/commands.js index e5ebc37d7..cb1d3de44 100755 --- a/test/cypress/support/commands.js +++ b/test/cypress/support/commands.js @@ -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) => {