From 0fd556dd2a1ffac75fb2858b2a5cf288800b0ce1 Mon Sep 17 00:00:00 2001 From: alexm Date: Fri, 11 Mar 2022 13:23:02 +0100 Subject: [PATCH 1/2] fix(worker): fix calendar e2e --- e2e/paths/03-worker/05_calendar.spec.js | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/e2e/paths/03-worker/05_calendar.spec.js b/e2e/paths/03-worker/05_calendar.spec.js index 08ef71f130..6d3d7bd4d9 100644 --- a/e2e/paths/03-worker/05_calendar.spec.js +++ b/e2e/paths/03-worker/05_calendar.spec.js @@ -9,7 +9,7 @@ describe('Worker calendar path', () => { browser = await getBrowser(); page = browser.page; await page.loginAndModule('hr', 'worker'); - await page.accessToSearchResult('Hank Pym'); + await page.accessToSearchResult('Charles Xavier'); await page.accessToSection('worker.card.calendar'); }); @@ -18,12 +18,6 @@ describe('Worker calendar path', () => { }); describe('as hr', () => { - it('should check 5 total holidays have been used so far before testing anything', async() => { - const result = await page.waitToGetProperty(selectors.workerCalendar.totalHolidaysUsed, 'innerText'); - - expect(result).toContain(' 5 '); - }); - 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); @@ -56,14 +50,14 @@ describe('Worker calendar path', () => { const result = await page.waitToGetProperty(selectors.workerCalendar.totalHolidaysUsed, 'innerText'); - expect(result).toContain(' 6.5 '); + expect(result).toContain(' 1.5 '); }); }); describe(`as salesBoss`, () => { it(`should log in and get to Hank's calendar`, async() => { await page.loginAndModule('salesBoss', 'worker'); - await page.accessToSearchResult('Hank Pym'); + await page.accessToSearchResult('Charles Xavier'); await page.accessToSection('worker.card.calendar'); }); @@ -101,14 +95,14 @@ describe('Worker calendar path', () => { it('should check the total holidays used are back to what it was', async() => { const result = await page.waitToGetProperty(selectors.workerCalendar.totalHolidaysUsed, 'innerText'); - expect(result).toContain(' 5 '); + expect(result).toContain(' 0 '); }); }); describe(`as Hank`, () => { it(`should log in and get to his calendar`, async() => { await page.loginAndModule('HankPym', 'worker'); - await page.accessToSearchResult('Hank Pym'); + await page.accessToSearchResult('Charles Xavier'); await page.accessToSection('worker.card.calendar'); }); @@ -122,7 +116,7 @@ describe('Worker calendar path', () => { it('should check the total holidays used are now the initial ones', async() => { const result = await page.waitToGetProperty(selectors.workerCalendar.totalHolidaysUsed, 'innerText'); - expect(result).toContain(' 5 '); + expect(result).toContain(' 0 '); }); it('should use the year selector to go to the previous year', async() => { -- 2.40.1 From 39b3e35725815b2be54b6897ae7eb9738d460e98 Mon Sep 17 00:00:00 2001 From: alexm Date: Tue, 15 Mar 2022 15:11:58 +0100 Subject: [PATCH 2/2] change description --- e2e/paths/03-worker/05_calendar.spec.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/e2e/paths/03-worker/05_calendar.spec.js b/e2e/paths/03-worker/05_calendar.spec.js index 6d3d7bd4d9..e97b7fe7c8 100644 --- a/e2e/paths/03-worker/05_calendar.spec.js +++ b/e2e/paths/03-worker/05_calendar.spec.js @@ -55,7 +55,7 @@ describe('Worker calendar path', () => { }); describe(`as salesBoss`, () => { - it(`should log in and get to Hank's calendar`, async() => { + it(`should log in and get to Charles Xavier's calendar`, async() => { await page.loginAndModule('salesBoss', 'worker'); await page.accessToSearchResult('Charles Xavier'); await page.accessToSection('worker.card.calendar'); @@ -99,9 +99,9 @@ describe('Worker calendar path', () => { }); }); - describe(`as Hank`, () => { + describe(`as Charles Xavier`, () => { it(`should log in and get to his calendar`, async() => { - await page.loginAndModule('HankPym', 'worker'); + await page.loginAndModule('CharlesXavier', 'worker'); await page.accessToSearchResult('Charles Xavier'); await page.accessToSection('worker.card.calendar'); }); -- 2.40.1