e2e path nearly as completed
This commit is contained in:
parent
9a9ef5c03f
commit
69ddf3a615
|
@ -1,15 +1,14 @@
|
||||||
import selectors from '../../helpers/selectors.js';
|
import selectors from '../../helpers/selectors.js';
|
||||||
import getBrowser from '../../helpers/puppeteer';
|
import getBrowser from '../../helpers/puppeteer';
|
||||||
|
|
||||||
// #2390-calendar_date_filter e2e
|
fdescribe('Worker calendar path', () => {
|
||||||
xdescribe('Worker calendar path', () => {
|
|
||||||
let browser;
|
let browser;
|
||||||
let page;
|
let page;
|
||||||
beforeAll(async() => {
|
beforeAll(async() => {
|
||||||
browser = await getBrowser();
|
browser = await getBrowser();
|
||||||
page = browser.page;
|
page = browser.page;
|
||||||
await page.loginAndModule('hr', 'worker');
|
await page.loginAndModule('hr', 'worker');
|
||||||
await page.accessToSearchResult('coolerNick');
|
await page.accessToSearchResult('Hank Pym');
|
||||||
await page.accessToSection('worker.card.calendar');
|
await page.accessToSection('worker.card.calendar');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -18,10 +17,10 @@ xdescribe('Worker calendar path', () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('as hr', () => {
|
describe('as hr', () => {
|
||||||
it('should check 0 total holidays have been used so far', async() => {
|
it('should check 5 total holidays have been used so far before testing anything', async() => {
|
||||||
const result = await page.waitToGetProperty(selectors.workerCalendar.totalHolidaysUsed, 'innerText');
|
const result = await page.waitToGetProperty(selectors.workerCalendar.totalHolidaysUsed, 'innerText');
|
||||||
|
|
||||||
expect(result).toContain(' 0 ');
|
expect(result).toContain(' 5 ');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should set two days as holidays on the calendar', async() => {
|
it('should set two days as holidays on the calendar', async() => {
|
||||||
|
@ -52,22 +51,22 @@ xdescribe('Worker calendar path', () => {
|
||||||
await page.waitToClick(selectors.workerCalendar.mayEighth);
|
await page.waitToClick(selectors.workerCalendar.mayEighth);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should check the total holidays used now has 1.5 more days', async() => {
|
it('should check the total holidays increased by 1.5', async() => {
|
||||||
const result = await page.waitToGetProperty(selectors.workerCalendar.totalHolidaysUsed, 'innerText');
|
const result = await page.waitToGetProperty(selectors.workerCalendar.totalHolidaysUsed, 'innerText');
|
||||||
|
|
||||||
expect(result).toContain(' 1.5 ');
|
expect(result).toContain(' 6.5 ');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe(`as cool boss`, () => {
|
describe(`as salesBoss`, () => {
|
||||||
it(`should log in and get to cool's calendar`, async() => {
|
it(`should log in and get to Hank's calendar`, async() => {
|
||||||
await page.loginAndModule('coolerBoss', 'worker');
|
await page.loginAndModule('salesBoss', 'worker');
|
||||||
await page.accessToSearchResult('coolerNick');
|
await page.accessToSearchResult('Hank Pym');
|
||||||
await page.accessToSection('worker.card.calendar');
|
await page.accessToSection('worker.card.calendar');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should undo what was done here', async() => {
|
it('should undo what was done here', async() => {
|
||||||
await page.waitFor(4000);
|
await page.waitFor(400);
|
||||||
await page.waitToClick(selectors.workerCalendar.holidays);
|
await page.waitToClick(selectors.workerCalendar.holidays);
|
||||||
await page.waitFor(400);
|
await page.waitFor(400);
|
||||||
await page.waitToClick(selectors.workerCalendar.januaryThirtyFirst);
|
await page.waitToClick(selectors.workerCalendar.januaryThirtyFirst);
|
||||||
|
@ -98,37 +97,41 @@ xdescribe('Worker calendar path', () => {
|
||||||
it('should check the total holidays used are back to what it was', async() => {
|
it('should check the total holidays used are back to what it was', async() => {
|
||||||
const result = await page.waitToGetProperty(selectors.workerCalendar.totalHolidaysUsed, 'innerText');
|
const result = await page.waitToGetProperty(selectors.workerCalendar.totalHolidaysUsed, 'innerText');
|
||||||
|
|
||||||
expect(result).toContain(' 0 ');
|
expect(result).toContain(' 5 ');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe(`as cooler`, () => {
|
describe(`as Hank`, () => {
|
||||||
it(`should log in and get to his calendar`, async() => {
|
it(`should log in and get to his calendar`, async() => {
|
||||||
await page.loginAndModule('cooler', 'worker');
|
await page.loginAndModule('HankPym', 'worker');
|
||||||
await page.accessToSearchResult('coolerNick');
|
await page.accessToSearchResult('Hank Pym');
|
||||||
await page.accessToSection('worker.card.calendar');
|
await page.accessToSection('worker.card.calendar');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should make a futile attempt to add holidays', async() => {
|
it('should make a futile attempt to add holidays', async() => {
|
||||||
await page.waitFor(4000);
|
await page.waitFor(400);
|
||||||
await page.waitToClick(selectors.workerCalendar.holidays);
|
await page.waitToClick(selectors.workerCalendar.holidays);
|
||||||
await page.waitFor(400);
|
await page.waitFor(400);
|
||||||
await page.waitToClick(selectors.workerCalendar.januaryThirtyFirst);
|
await page.waitToClick(selectors.workerCalendar.januaryThirtyFirst);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should check the total holidays used remain the same', async() => {
|
it('should check the total holidays used are now the initial ones', async() => {
|
||||||
const result = await page.waitToGetProperty(selectors.workerCalendar.totalHolidaysUsed, 'innerText');
|
const result = await page.waitToGetProperty(selectors.workerCalendar.totalHolidaysUsed, 'innerText');
|
||||||
|
|
||||||
expect(result).toContain(' 0 ');
|
expect(result).toContain(' 5 ');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should use the year selector yo go to the previous year', async() => {
|
// #1361 worker.calendar "hopefully this test works straight away after refreshing holidays per year on each filtering."
|
||||||
const date = new Date();
|
// it('should use the year selector to go to the previous year', async() => {
|
||||||
const lastYear = (date.getFullYear() - 1).toString();
|
// const date = new Date();
|
||||||
|
// const lastYear = (date.getFullYear() - 1).toString();
|
||||||
|
|
||||||
await page.autocompleteSearch(selectors.workerCalendar.year, lastYear);
|
// await page.autocompleteSearch(selectors.workerCalendar.year, lastYear);
|
||||||
|
|
||||||
expect(result).toContain(' 0 ');
|
// await page.waitFor(400);
|
||||||
});
|
// const result = await page.waitToGetProperty(selectors.workerCalendar.totalHolidaysUsed, 'innerText');
|
||||||
|
|
||||||
|
// expect(result).toContain(' 0 ');
|
||||||
|
// });
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue