From ea6b7cd9e8553f850b1eede7d6a3c3d29e787ebc Mon Sep 17 00:00:00 2001 From: carlosjr Date: Mon, 18 Jan 2021 19:11:29 +0100 Subject: [PATCH] worker calendar e2e fix --- e2e/helpers/selectors.js | 12 ++++++------ e2e/paths/03-worker/05_calendar.spec.js | 26 ++++++++++++------------- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/e2e/helpers/selectors.js b/e2e/helpers/selectors.js index eb2dce909..8140b8f04 100644 --- a/e2e/helpers/selectors.js +++ b/e2e/helpers/selectors.js @@ -793,13 +793,13 @@ export default { workerCalendar: { year: 'vn-worker-calendar vn-autocomplete[ng-model="$ctrl.year"]', totalHolidaysUsed: 'vn-worker-calendar div.totalBox > div', - januaryThirtyFirst: 'vn-worker-calendar vn-calendar:nth-child(2) section:nth-child(33) > div', - marchTwentyThird: 'vn-worker-calendar vn-calendar:nth-child(4) section:nth-child(29) > div', - mayFourth: 'vn-worker-calendar vn-calendar:nth-child(6) section:nth-child(8) > div', + penultimateMondayOfJanuary: 'vn-worker-calendar vn-calendar:nth-child(2) section:nth-child(22) > div', + lastMondayOfMarch: 'vn-worker-calendar vn-calendar:nth-child(4) section:nth-child(29) > div', + fistMondayOfMay: 'vn-worker-calendar vn-calendar:nth-child(6) section:nth-child(8) > div', mayEighth: 'vn-worker-calendar vn-calendar:nth-child(6) section:nth-child(12) > div', - mayTwelfth: 'vn-worker-calendar vn-calendar:nth-child(6) section:nth-child(16) > div', - mayThirteenth: 'vn-worker-calendar vn-calendar:nth-child(6) section:nth-child(17) > div', - mayFourteenth: 'vn-worker-calendar vn-calendar:nth-child(6) section:nth-child(18) > div', + secondTuesdayOfMay: 'vn-worker-calendar vn-calendar:nth-child(6) section:nth-child(16) > div', + secondWednesdayOfMay: 'vn-worker-calendar vn-calendar:nth-child(6) section:nth-child(17) > div', + secondThursdayOfMay: 'vn-worker-calendar vn-calendar:nth-child(6) section:nth-child(18) > div', holidays: 'vn-worker-calendar > vn-side-menu div:nth-child(3) > vn-chip:nth-child(1)', absence: 'vn-worker-calendar > vn-side-menu div:nth-child(3) > vn-chip:nth-child(2)', halfHoliday: 'vn-worker-calendar > vn-side-menu div:nth-child(3) > vn-chip:nth-child(3)', diff --git a/e2e/paths/03-worker/05_calendar.spec.js b/e2e/paths/03-worker/05_calendar.spec.js index e82006b3c..1d5f0c156 100644 --- a/e2e/paths/03-worker/05_calendar.spec.js +++ b/e2e/paths/03-worker/05_calendar.spec.js @@ -27,26 +27,26 @@ describe('Worker calendar path', () => { it('should set two days as holidays on the calendar and check the total holidays increased by 1.5', async() => { await page.waitToClick(selectors.workerCalendar.holidays); await page.waitForTimeout(reasonableTimeBetweenClicks); - await page.waitToClick(selectors.workerCalendar.januaryThirtyFirst); + await page.waitToClick(selectors.workerCalendar.penultimateMondayOfJanuary); await page.waitForTimeout(reasonableTimeBetweenClicks); await page.waitToClick(selectors.workerCalendar.absence); await page.waitForTimeout(reasonableTimeBetweenClicks); - await page.waitToClick(selectors.workerCalendar.marchTwentyThird); + await page.waitToClick(selectors.workerCalendar.lastMondayOfMarch); await page.waitForTimeout(reasonableTimeBetweenClicks); await page.waitToClick(selectors.workerCalendar.halfHoliday); await page.waitForTimeout(reasonableTimeBetweenClicks); - await page.waitToClick(selectors.workerCalendar.mayFourth); + await page.waitToClick(selectors.workerCalendar.fistMondayOfMay); await page.waitForTimeout(reasonableTimeBetweenClicks); await page.waitToClick(selectors.workerCalendar.furlough); await page.waitForTimeout(reasonableTimeBetweenClicks); - await page.waitToClick(selectors.workerCalendar.mayTwelfth); + await page.waitToClick(selectors.workerCalendar.secondTuesdayOfMay); await page.waitForTimeout(reasonableTimeBetweenClicks); - await page.waitToClick(selectors.workerCalendar.mayThirteenth); + await page.waitToClick(selectors.workerCalendar.secondWednesdayOfMay); await page.waitForTimeout(reasonableTimeBetweenClicks); - await page.waitToClick(selectors.workerCalendar.mayFourteenth); + await page.waitToClick(selectors.workerCalendar.secondThursdayOfMay); await page.waitForTimeout(reasonableTimeBetweenClicks); await page.waitToClick(selectors.workerCalendar.halfFurlough); @@ -71,26 +71,26 @@ describe('Worker calendar path', () => { await page.waitForTimeout(reasonableTimeBetweenClicks); await page.waitToClick(selectors.workerCalendar.holidays); await page.waitForTimeout(reasonableTimeBetweenClicks); - await page.waitToClick(selectors.workerCalendar.januaryThirtyFirst); + await page.waitToClick(selectors.workerCalendar.penultimateMondayOfJanuary); await page.waitForTimeout(reasonableTimeBetweenClicks); await page.waitToClick(selectors.workerCalendar.absence); await page.waitForTimeout(reasonableTimeBetweenClicks); - await page.waitToClick(selectors.workerCalendar.marchTwentyThird); + await page.waitToClick(selectors.workerCalendar.lastMondayOfMarch); await page.waitForTimeout(reasonableTimeBetweenClicks); await page.waitToClick(selectors.workerCalendar.halfHoliday); await page.waitForTimeout(reasonableTimeBetweenClicks); - await page.waitToClick(selectors.workerCalendar.mayFourth); + await page.waitToClick(selectors.workerCalendar.fistMondayOfMay); await page.waitForTimeout(reasonableTimeBetweenClicks); await page.waitToClick(selectors.workerCalendar.furlough); await page.waitForTimeout(reasonableTimeBetweenClicks); - await page.waitToClick(selectors.workerCalendar.mayTwelfth); + await page.waitToClick(selectors.workerCalendar.secondTuesdayOfMay); await page.waitForTimeout(reasonableTimeBetweenClicks); - await page.waitToClick(selectors.workerCalendar.mayThirteenth); + await page.waitToClick(selectors.workerCalendar.secondWednesdayOfMay); await page.waitForTimeout(reasonableTimeBetweenClicks); - await page.waitToClick(selectors.workerCalendar.mayFourteenth); + await page.waitToClick(selectors.workerCalendar.secondThursdayOfMay); await page.waitForTimeout(reasonableTimeBetweenClicks); await page.waitToClick(selectors.workerCalendar.halfFurlough); @@ -116,7 +116,7 @@ describe('Worker calendar path', () => { await page.waitForTimeout(reasonableTimeBetweenClicks); await page.waitToClick(selectors.workerCalendar.holidays); await page.waitForTimeout(reasonableTimeBetweenClicks); - await page.waitToClick(selectors.workerCalendar.januaryThirtyFirst); + await page.waitToClick(selectors.workerCalendar.penultimateMondayOfJanuary); }); it('should check the total holidays used are now the initial ones', async() => {