diff --git a/e2e/helpers/selectors.js b/e2e/helpers/selectors.js index 4cde8771d..d7e20018b 100644 --- a/e2e/helpers/selectors.js +++ b/e2e/helpers/selectors.js @@ -659,6 +659,12 @@ export default { firstTicketDeleteButton: 'vn-route-tickets vn-tr:nth-child(1) vn-icon[icon="delete"]', confirmButton: '.vn-confirm.shown button[response="accept"]' }, + workerBasicData: { + name: 'vn-worker-basic-data vn-textfield[ng-model="$ctrl.worker.firstName"]', + surname: 'vn-worker-basic-data vn-textfield[ng-model="$ctrl.worker.lastName"]', + phone: 'vn-worker-basic-data vn-textfield[ng-model="$ctrl.worker.phone"]', + saveButton: 'vn-worker-basic-data button[type=submit]' + }, workerPbx: { extension: 'vn-worker-pbx vn-textfield[ng-model="$ctrl.worker.sip.extension"]', saveButton: 'vn-worker-pbx button[type=submit]' diff --git a/e2e/paths/02-client-module/04_edit_billing_data.spec.js b/e2e/paths/02-client-module/04_edit_billing_data.spec.js index 5ee308f7e..7e8df8aa8 100644 --- a/e2e/paths/02-client-module/04_edit_billing_data.spec.js +++ b/e2e/paths/02-client-module/04_edit_billing_data.spec.js @@ -60,7 +60,7 @@ describe('Client Edit billing data path', () => { }); it(`should save the form with all its new data`, async() => { - // await page.waitFor(3000); + await page.waitFor(2000); await page.waitForWatcherData(selectors.clientBillingData.watcher); await page.waitToClick(selectors.clientBillingData.saveButton); let snackbarMessage = await page.waitForLastSnackbar(); diff --git a/e2e/paths/03-worker-module/01_basicData.spec.js b/e2e/paths/03-worker-module/01_basicData.spec.js new file mode 100644 index 000000000..21443c517 --- /dev/null +++ b/e2e/paths/03-worker-module/01_basicData.spec.js @@ -0,0 +1,50 @@ +import selectors from '../../helpers/selectors.js'; +import getBrowser from '../../helpers/puppeteer'; + +describe('Worker basic data path', () => { + let browser; + let page; + beforeAll(async() => { + browser = await getBrowser(); + page = browser.page; + await page.loginAndModule('hr', 'worker'); + await page.accessToSearchResult('David Charles Haller'); + await page.accessToSection('worker.card.basicData'); + }); + + afterAll(async() => { + await browser.close(); + }); + + it('should edit the form', async() => { + await page.clearInput(selectors.workerBasicData.name); + await page.write(selectors.workerBasicData.name, 'David C.'); + await page.clearInput(selectors.workerBasicData.surname); + await page.write(selectors.workerBasicData.surname, 'H.'); + await page.clearInput(selectors.workerBasicData.phone); + await page.write(selectors.workerBasicData.phone, '444332211'); + await page.waitToClick(selectors.workerBasicData.saveButton); + const result = await page.waitForLastSnackbar(); + + expect(result).toEqual('Data saved!'); + }); + + it('should reload the section then check the name was edited', async() => { + await page.reloadSection('worker.card.basicData'); + const result = await page.waitToGetProperty(selectors.workerBasicData.name, 'value'); + + expect(result).toEqual('David C.'); + }); + + it('should the surname was edited', async() => { + const result = await page.waitToGetProperty(selectors.workerBasicData.surname, 'value'); + + expect(result).toEqual('H.'); + }); + + it('should the phone was edited', async() => { + const result = await page.waitToGetProperty(selectors.workerBasicData.phone, 'value'); + + expect(result).toEqual('444332211'); + }); +}); diff --git a/e2e/paths/03-worker-module/02_time_control.spec.js b/e2e/paths/03-worker-module/02_time_control.spec.js index 6624f25eb..d49ffca03 100644 --- a/e2e/paths/03-worker-module/02_time_control.spec.js +++ b/e2e/paths/03-worker-module/02_time_control.spec.js @@ -1,8 +1,7 @@ import selectors from '../../helpers/selectors.js'; import getBrowser from '../../helpers/puppeteer'; -// #2047 WorkerTimeControl no suma horas -xdescribe('Worker time control path', () => { +describe('Worker time control path', () => { let browser; let page; beforeAll(async() => { diff --git a/e2e/paths/03-worker-module/01_pbx.spec.js b/e2e/paths/03-worker-module/03_pbx.spec.js similarity index 100% rename from e2e/paths/03-worker-module/01_pbx.spec.js rename to e2e/paths/03-worker-module/03_pbx.spec.js