diff --git a/test/cypress/integration/worker/workerCreate.spec.js b/test/cypress/integration/worker/workerCreate.spec.js index 7f2810395..454387078 100644 --- a/test/cypress/integration/worker/workerCreate.spec.js +++ b/test/cypress/integration/worker/workerCreate.spec.js @@ -16,7 +16,7 @@ describe('WorkerCreate', () => { Location: { val: 1, type: 'select' }, Phone: { val: '123456789' }, 'Worker code': { val: 'DWW' }, - Boss: { val: developerBossId, type: 'select' }, + Boss: { val: developerBossId, type: 'selectWorker' }, Birth: { val: '11-12-2022', type: 'date' }, }; const external = { @@ -26,7 +26,7 @@ describe('WorkerCreate', () => { 'Last name': { val: 'GARCIA' }, 'Personal email': { val: 'pepe@gmail.com' }, 'Worker code': { val: 'PG' }, - Boss: { val: developerBossId, type: 'select' }, + Boss: { val: developerBossId, type: 'selectWorker' }, }; beforeEach(() => { diff --git a/test/cypress/support/commands.js b/test/cypress/support/commands.js index 1fa47757e..953fd5b2e 100755 --- a/test/cypress/support/commands.js +++ b/test/cypress/support/commands.js @@ -116,6 +116,11 @@ Cypress.Commands.add('selectOption', (selector, option, timeout = 5000) => { retryAssertion(selector, option); }); +Cypress.Commands.add('selectWorkerOption', (selector, option) => { + cy.waitForElement(selector).click().clear().type(option).wait(500); + cy.get('.q-menu').then($el => cy.get($el).find('.q-item').contains(option).click()); +}); + Cypress.Commands.add('countSelectOptions', (selector, option) => { cy.waitForElement(selector); cy.get(selector).click({ force: true }); @@ -136,6 +141,9 @@ Cypress.Commands.add('fillInForm', (obj, form = '.q-form > .q-card') => { case 'select': cy.selectOption(el, val); break; + case 'selectWorker': + cy.selectWorkerOption(el, val); + break; case 'date': cy.get(el).type(val.split('-').join('')); break;