diff --git a/e2e/helpers/selectors.js b/e2e/helpers/selectors.js index 1787733d4..91bebf0ba 100644 --- a/e2e/helpers/selectors.js +++ b/e2e/helpers/selectors.js @@ -716,6 +716,7 @@ export default { sundayWorkedHours: 'vn-worker-time-control vn-table > div > vn-tfoot > vn-tr:nth-child(1) > vn-td:nth-child(7)', weekWorkedHours: 'vn-worker-time-control vn-side-menu vn-label-value > section > span', nextMonthButton: 'vn-worker-time-control vn-side-menu vn-calendar vn-button[icon=keyboard_arrow_right]', + secondWeekDay: 'vn-worker-time-control vn-side-menu vn-calendar .day:nth-child(8) > .day-number', navigateBackToIndex: 'vn-worker-descriptor vn-icon[icon="chevron_left"]' }, invoiceOutIndex: { 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 be48b13dd..ce7316773 100644 --- a/e2e/paths/03-worker-module/02_time_control.spec.js +++ b/e2e/paths/03-worker-module/02_time_control.spec.js @@ -286,11 +286,11 @@ describe('Worker time control path', () => { }); }); - describe('as salesBoss', () => { + describe('as hr', () => { describe('on Saturday', () => { beforeAll(() => { nightmare - .loginAndModule('salesBoss', 'worker') + .loginAndModule('hr', 'worker') .accessToSearchResult('HankPym') .accessToSection('worker.card.timeControl'); }); @@ -358,10 +358,11 @@ describe('Worker time control path', () => { it(`should check Hank Pym doesn't have hours set on the next months first week`, async() => { const wholeWeekHours = await nightmare .waitToClick(selectors.workerTimeControl.nextMonthButton) - .waitForTextInElement(selectors.workerTimeControl.weekWorkedHours, '00:00 Hours') + .waitToClick(selectors.workerTimeControl.secondWeekDay) + .waitForTextInElement(selectors.workerTimeControl.weekWorkedHours, '00:00 h.') .waitToGetProperty(selectors.workerTimeControl.weekWorkedHours, 'innerText'); - expect(wholeWeekHours).toEqual('00:00 Hours'); + expect(wholeWeekHours).toEqual('00:00 h.'); }); it(`should check he didn't scan in this week yet`, async() => { @@ -371,7 +372,7 @@ describe('Worker time control path', () => { .accessToSection('worker.card.timeControl') .waitToGetProperty(selectors.workerTimeControl.weekWorkedHours, 'innerText'); - expect(wholeWeekHours).toEqual('00:00 Hours'); + expect(wholeWeekHours).toEqual('00:00 h.'); }); }); }); @@ -386,10 +387,10 @@ describe('Worker time control path', () => { it('should Hank Pym check his hours are alright', async() => { const wholeWeekHours = await nightmare - .waitForTextInElement(selectors.workerTimeControl.weekWorkedHours, '56:00 Hours') + .waitForTextInElement(selectors.workerTimeControl.weekWorkedHours, '56:00 h.') .waitToGetProperty(selectors.workerTimeControl.weekWorkedHours, 'innerText'); - expect(wholeWeekHours).toEqual('56:00 Hours'); + expect(wholeWeekHours).toEqual('56:00 h.'); }); }); });