2019-06-28 10:51:34 +00:00
|
|
|
import selectors from '../../helpers/selectors.js';
|
2020-01-23 15:01:29 +00:00
|
|
|
import getBrowser from '../../helpers/puppeteer';
|
2019-06-28 10:51:34 +00:00
|
|
|
|
|
|
|
describe('claim Summary path', () => {
|
2020-01-23 15:01:29 +00:00
|
|
|
let browser;
|
|
|
|
let page;
|
2019-06-28 10:51:34 +00:00
|
|
|
const claimId = 4;
|
|
|
|
|
2020-01-23 15:01:29 +00:00
|
|
|
beforeAll(async() => {
|
|
|
|
browser = await getBrowser();
|
|
|
|
page = browser.page;
|
|
|
|
});
|
|
|
|
|
|
|
|
afterAll(async() => {
|
|
|
|
await browser.close();
|
|
|
|
});
|
|
|
|
|
2019-06-28 10:51:34 +00:00
|
|
|
it('should navigate to the target claim summary section', async() => {
|
2020-01-23 15:01:29 +00:00
|
|
|
await page.loginAndModule('employee', 'claim');
|
|
|
|
await page.accessToSearchResult(claimId);
|
|
|
|
await page.waitForURL('/summary');
|
|
|
|
const url = await page.parsedUrl();
|
2019-06-28 10:51:34 +00:00
|
|
|
|
|
|
|
expect(url.hash).toContain('/summary');
|
|
|
|
});
|
|
|
|
|
|
|
|
it(`should display details from the claim and it's client on the top of the header`, async() => {
|
2020-01-23 15:01:29 +00:00
|
|
|
await page.waitForTextInElement(selectors.claimSummary.header, 'Tony Stark');
|
|
|
|
const result = await page.waitToGetProperty(selectors.claimSummary.header, 'innerText');
|
2019-06-28 10:51:34 +00:00
|
|
|
|
|
|
|
expect(result).toContain('4 -');
|
|
|
|
expect(result).toContain('Tony Stark');
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should display the claim state', async() => {
|
2020-01-23 15:01:29 +00:00
|
|
|
const result = await page.waitToGetProperty(selectors.claimSummary.state, 'innerText');
|
2019-06-28 10:51:34 +00:00
|
|
|
|
|
|
|
expect(result).toContain('Resuelto');
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should display the observation', async() => {
|
2020-01-23 15:01:29 +00:00
|
|
|
const result = await page.waitToGetProperty(selectors.claimSummary.observation, 'value');
|
2019-06-28 10:51:34 +00:00
|
|
|
|
|
|
|
expect(result).toContain('observation four');
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should display the claimed line(s)', async() => {
|
2020-01-23 15:01:29 +00:00
|
|
|
const result = await page.waitToGetProperty(selectors.claimSummary.firstSaleItemId, 'innerText');
|
2019-06-28 10:51:34 +00:00
|
|
|
|
|
|
|
expect(result).toContain('000002');
|
|
|
|
});
|
|
|
|
|
|
|
|
it(`should click on the first sale ID making the item descriptor visible`, async() => {
|
2020-01-23 15:01:29 +00:00
|
|
|
await page.waitToClick(selectors.claimSummary.firstSaleItemId);
|
|
|
|
await page.waitImgLoad(selectors.claimSummary.firstSaleDescriptorImage);
|
|
|
|
const visible = await page.isVisible(selectors.claimSummary.itemDescriptorPopover);
|
2019-06-28 10:51:34 +00:00
|
|
|
|
|
|
|
expect(visible).toBeTruthy();
|
|
|
|
});
|
|
|
|
|
|
|
|
it(`should check the url for the item diary link of the descriptor is for the right item id`, async() => {
|
2020-01-23 15:01:29 +00:00
|
|
|
const exists = await page.exists(selectors.claimSummary.itemDescriptorPopoverItemDiaryButton);
|
2019-06-28 10:51:34 +00:00
|
|
|
|
|
|
|
expect(exists).toBeTruthy();
|
2019-09-30 09:30:54 +00:00
|
|
|
await nightmare.mousedown('.vn-popover.shown');
|
2019-06-28 10:51:34 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
it('should display the claim development details', async() => {
|
2020-01-23 15:01:29 +00:00
|
|
|
const result = await page.waitToGetProperty(selectors.claimSummary.firstDevelopmentWorker, 'innerText');
|
2019-06-28 10:51:34 +00:00
|
|
|
|
|
|
|
expect(result).toContain('salesAssistantNick');
|
|
|
|
});
|
|
|
|
|
|
|
|
it(`should click on the first development worker making the worker descriptor visible`, async() => {
|
2020-01-23 15:01:29 +00:00
|
|
|
await page.waitToClick(selectors.claimSummary.firstDevelopmentWorker);
|
|
|
|
await page.wait(selectors.claimSummary.firstDevelopmentWorkerGoToClientButton);
|
|
|
|
const visible = await page.isVisible(selectors.claimSummary.firstDevelopmentWorkerGoToClientButton);
|
2019-06-28 10:51:34 +00:00
|
|
|
|
|
|
|
expect(visible).toBeTruthy();
|
|
|
|
});
|
|
|
|
|
|
|
|
it(`should check the url for the go to clientlink of the descriptor is for the right client id`, async() => {
|
2020-01-23 15:01:29 +00:00
|
|
|
const exists = await page.exists(selectors.claimSummary.firstDevelopmentWorkerGoToClientButton);
|
2019-06-28 10:51:34 +00:00
|
|
|
|
|
|
|
expect(exists).toBeTruthy();
|
2019-09-30 09:30:54 +00:00
|
|
|
await nightmare.mousedown('.vn-popover.shown');
|
2019-06-28 10:51:34 +00:00
|
|
|
});
|
2019-07-03 06:14:42 +00:00
|
|
|
|
|
|
|
it(`should click on the first action ticket ID making the ticket descriptor visible`, async() => {
|
2020-01-23 15:01:29 +00:00
|
|
|
await page.waitToClick(selectors.claimSummary.firstActionTicketId);
|
|
|
|
await page.wait(selectors.claimSummary.firstActionTicketDescriptor);
|
|
|
|
const visible = await page.isVisible(selectors.claimSummary.firstActionTicketDescriptor);
|
2019-07-03 06:14:42 +00:00
|
|
|
|
|
|
|
expect(visible).toBeTruthy();
|
|
|
|
});
|
2019-06-28 10:51:34 +00:00
|
|
|
});
|