salix/e2e/paths/06-claim/04_summary.spec.js

97 lines
3.7 KiB
JavaScript
Raw Normal View History

2019-06-28 10:51:34 +00:00
import selectors from '../../helpers/selectors.js';
import getBrowser from '../../helpers/puppeteer.js';
2019-06-28 10:51:34 +00:00
2020-12-31 09:30:51 +00:00
describe('Claim summary path', () => {
let browser;
let page;
2020-01-26 23:48:00 +00:00
const claimId = '4';
2019-06-28 10:51:34 +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() => {
2023-05-15 12:14:08 +00:00
await page.loginAndModule('salesPerson', 'claim');
await page.accessToSearchResult(claimId);
await page.waitForState('claim.card.summary');
2019-06-28 10:51:34 +00:00
});
it(`should display details from the claim and it's client on the top of the header`, async() => {
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() => {
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() => {
2022-06-27 15:25:35 +00:00
const result = await page.waitToGetProperty(selectors.claimSummary.observation, 'innerText');
2019-06-28 10:51:34 +00:00
expect(result).toContain('Wisi forensibus mnesarchum in cum. Per id impetus abhorreant');
2019-06-28 10:51:34 +00:00
});
it('should display the claimed line(s)', async() => {
const result = await page.waitToGetProperty(selectors.claimSummary.firstSaleItemId, 'innerText');
2019-06-28 10:51:34 +00:00
2023-02-17 10:21:31 +00:00
expect(result).toContain('2');
2019-06-28 10:51:34 +00:00
});
it(`should click on the first sale ID making the item descriptor visible`, async() => {
2023-06-08 08:25:25 +00:00
const firstItem = selectors.claimSummary.firstSaleItemId;
await page.evaluate(selectors => {
document.querySelector(selectors).scrollIntoView();
}, firstItem);
await page.click(firstItem);
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-26 23:48:00 +00:00
await page.waitForSelector(selectors.claimSummary.itemDescriptorPopoverItemDiaryButton, {visible: true});
2019-06-28 10:51:34 +00:00
2020-02-12 13:36:05 +00:00
await page.closePopup();
2019-06-28 10:51:34 +00:00
});
it('should display the claim development details', async() => {
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() => {
await page.waitToClick(selectors.claimSummary.firstDevelopmentWorker);
2020-01-26 23:48:00 +00:00
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-26 23:48:00 +00:00
await page.waitForSelector(selectors.claimSummary.firstDevelopmentWorkerGoToClientButton, {visible: true});
2019-06-28 10:51:34 +00:00
2020-02-12 13:36:05 +00:00
await page.closePopup();
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() => {
await page.waitToClick(selectors.claimSummary.firstActionTicketId);
2020-01-26 23:48:00 +00:00
await page.waitForSelector(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
});