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', () => {
|
2024-05-07 09:47:22 +00:00
|
|
|
const workerId = 3;
|
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-05-07 09:47:22 +00:00
|
|
|
return response.status() === 200 && response.url().includes(`Workers/${workerId}`);
|
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
|
|
|
});
|
|
|
|
});
|