salix/e2e/paths/03-worker/01_summary.spec.js

34 lines
1.7 KiB
JavaScript
Raw Normal View History

2020-03-02 14:37:17 +00:00
import selectors from '../../helpers/selectors.js';
import getBrowser from '../../helpers/puppeteer';
2023-02-27 07:41:27 +00:00
describe('Worker summary path', () => {
2020-03-02 14:37:17 +00:00
let browser;
let page;
beforeAll(async() => {
browser = await getBrowser();
page = browser.page;
await page.loginAndModule('employee', 'worker');
2022-12-28 12:06:00 +00:00
const httpDataResponse = page.waitForResponse(response => {
2024-04-15 13:09:41 +00:00
return response.status() === 200 && response.url().includes(`Workers/summary`);
2022-12-28 12:06:00 +00:00
});
2020-03-02 14:37:17 +00:00
await page.accessToSearchResult('agencyNick');
2022-12-28 12:06:00 +00:00
await httpDataResponse;
2020-03-02 14:37:17 +00:00
});
afterAll(async() => {
await browser.close();
});
2022-12-28 12:06:00 +00:00
it('should reach the employee summary section and check all properties', async() => {
expect(await page.getProperty(selectors.workerSummary.header, 'innerText')).toEqual('agency agency');
expect(await page.getProperty(selectors.workerSummary.id, 'innerText')).toEqual('3');
expect(await page.getProperty(selectors.workerSummary.email, 'innerText')).toEqual('agency@verdnatura.es');
expect(await page.getProperty(selectors.workerSummary.department, 'innerText')).toEqual('CAMARA');
expect(await page.getProperty(selectors.workerSummary.userId, 'innerText')).toEqual('3');
expect(await page.getProperty(selectors.workerSummary.userName, 'innerText')).toEqual('agency');
expect(await page.getProperty(selectors.workerSummary.role, 'innerText')).toEqual('agency');
expect(await page.getProperty(selectors.workerSummary.extension, 'innerText')).toEqual('1101');
2023-02-27 07:39:46 +00:00
expect(await page.getProperty(selectors.workerSummary.locker, 'innerText')).toEqual('-');
2020-03-02 14:37:17 +00:00
});
});