2020-03-02 14:37:17 +00:00
|
|
|
import selectors from '../../helpers/selectors.js';
|
|
|
|
import getBrowser from '../../helpers/puppeteer';
|
|
|
|
|
|
|
|
describe('Worker summary path', () => {
|
2022-12-28 12:06:00 +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 => {
|
|
|
|
return response.status() === 200 && response.url().includes(`Workers/${workerId}`);
|
|
|
|
});
|
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');
|
2020-03-02 14:37:17 +00:00
|
|
|
});
|
|
|
|
});
|