2019-06-28 10:51:34 +00:00
|
|
|
import selectors from '../../helpers/selectors.js';
|
|
|
|
import createNightmare from '../../helpers/nightmare';
|
|
|
|
|
|
|
|
describe('claim Summary path', () => {
|
|
|
|
const nightmare = createNightmare();
|
|
|
|
const claimId = 4;
|
|
|
|
|
|
|
|
it('should navigate to the target claim summary section', async() => {
|
|
|
|
let url = await nightmare
|
|
|
|
.loginAndModule('employee', 'claim')
|
|
|
|
.accessToSearchResult(claimId)
|
|
|
|
.waitForURL('/summary')
|
|
|
|
.parsedUrl();
|
|
|
|
|
|
|
|
expect(url.hash).toContain('/summary');
|
|
|
|
});
|
|
|
|
|
|
|
|
it(`should display details from the claim and it's client on the top of the header`, async() => {
|
|
|
|
let result = await nightmare
|
|
|
|
.waitForSpinnerLoad()
|
|
|
|
.waitToGetProperty(selectors.claimSummary.header, 'innerText');
|
|
|
|
|
|
|
|
expect(result).toContain('4 -');
|
|
|
|
expect(result).toContain('Tony Stark');
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should display the claim state', async() => {
|
|
|
|
let result = await nightmare
|
|
|
|
.waitToGetProperty(selectors.claimSummary.state, 'innerText');
|
|
|
|
|
|
|
|
expect(result).toContain('Resuelto');
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should display the observation', async() => {
|
|
|
|
let result = await nightmare
|
|
|
|
.waitToGetProperty(selectors.claimSummary.observation, 'value');
|
|
|
|
|
|
|
|
expect(result).toContain('observation four');
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should display the claimed line(s)', async() => {
|
|
|
|
let result = await nightmare
|
|
|
|
.waitToGetProperty(selectors.claimSummary.firstSaleItemId, 'innerText');
|
|
|
|
|
|
|
|
expect(result).toContain('000002');
|
|
|
|
});
|
|
|
|
|
|
|
|
it(`should click on the first sale ID making the item descriptor visible`, async() => {
|
|
|
|
const visible = await nightmare
|
|
|
|
.waitToClick(selectors.claimSummary.firstSaleItemId)
|
|
|
|
.waitImgLoad(selectors.claimSummary.firstSaleDescriptorImage)
|
|
|
|
.isVisible(selectors.claimSummary.itemDescriptorPopover);
|
|
|
|
|
|
|
|
expect(visible).toBeTruthy();
|
|
|
|
});
|
|
|
|
|
|
|
|
it(`should check the url for the item diary link of the descriptor is for the right item id`, async() => {
|
|
|
|
const exists = await nightmare
|
|
|
|
.exists(selectors.claimSummary.itemDescriptorPopoverItemDiaryButton);
|
|
|
|
|
|
|
|
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() => {
|
|
|
|
let result = await nightmare
|
|
|
|
.waitToGetProperty(selectors.claimSummary.firstDevelopmentWorker, 'innerText');
|
|
|
|
|
|
|
|
expect(result).toContain('salesAssistantNick');
|
|
|
|
});
|
|
|
|
|
|
|
|
it(`should click on the first development worker making the worker descriptor visible`, async() => {
|
|
|
|
const visible = await nightmare
|
|
|
|
.waitToClick(selectors.claimSummary.firstDevelopmentWorker)
|
2019-07-03 06:14:42 +00:00
|
|
|
.wait(selectors.claimSummary.firstDevelopmentWorkerGoToClientButton)
|
|
|
|
.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() => {
|
|
|
|
const exists = await nightmare
|
2019-07-03 06:14:42 +00:00
|
|
|
.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() => {
|
|
|
|
const visible = await nightmare
|
|
|
|
.waitToClick(selectors.claimSummary.firstActionTicketId)
|
|
|
|
.wait(selectors.claimSummary.firstActionTicketDescriptor)
|
|
|
|
.isVisible(selectors.claimSummary.firstActionTicketDescriptor);
|
|
|
|
|
|
|
|
expect(visible).toBeTruthy();
|
|
|
|
});
|
2019-06-28 10:51:34 +00:00
|
|
|
});
|