#1536 e2e claim summary
gitea/salix/dev This commit has test failures Details

This commit is contained in:
Carlos Jimenez Ruiz 2019-06-28 12:51:34 +02:00
parent 2b4598049c
commit 27104b44a7
4 changed files with 97 additions and 0 deletions

View File

@ -494,6 +494,17 @@ export default {
searchResult: 'vn-claim-index vn-card > div > vn-table > div > vn-tbody > a',
searchButton: 'vn-claim-index vn-searchbar vn-icon[icon="search"]'
},
claimSummary: {
header: 'vn-claim-summary > vn-card > div > h5',
state: 'vn-claim-summary vn-label-value[label="State"] > section > span',
observation: 'vn-claim-summary vn-textarea[model="$ctrl.summary.claim.observation"] > div > textarea',
firstSaleItemId: 'vn-claim-summary vn-horizontal > vn-auto:nth-child(4) > vn-table > div > vn-tbody > vn-tr:nth-child(1) > vn-td:nth-child(1) > span',
firstSaleDescriptorImage: 'vn-claim-summary vn-item-descriptor-popover > vn-popover vn-item-descriptor img',
itemDescriptorPopover: 'vn-claim-summary vn-item-descriptor-popover > vn-popover',
itemDescriptorPopoverItemDiaryButton: 'vn-claim-summary > vn-item-descriptor-popover a[href="#!/item/2/diary"]',
firstDevelopmentWorker: 'vn-claim-summary vn-horizontal > vn-auto:nth-child(5) > vn-table > div > vn-tbody > vn-tr:nth-child(1) > vn-td:nth-child(4) > span',
firstdevelopmentWorkerGoToClientButton: 'vn-claim-summary > vn-worker-descriptor-popover > vn-popover vn-worker-descriptor div.quicklinks > a[href="#!/client/21/summary"]'
},
claimBasicData: {
claimStateAutocomplete: 'vn-claim-basic-data vn-autocomplete[field="$ctrl.claim.claimStateFk"]',
responsabilityInputRange: 'vn-input-range',

View File

@ -0,0 +1,86 @@
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();
});
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)
.wait(selectors.claimSummary.firstdevelopmentWorkerGoToClientButton)
.isVisible(selectors.claimSummary.firstdevelopmentWorkerGoToClientButton);
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
.exists(selectors.claimSummary.firstdevelopmentWorkerGoToClientButton);
expect(exists).toBeTruthy();
});
});