parent
4709a55b8f
commit
11a2be6ac4
|
@ -468,6 +468,17 @@ export default {
|
||||||
secondClaimRedeliveryAutocomplete: 'vn-claim-development vn-horizontal:nth-child(2) vn-autocomplete[field="claimDevelopment.claimRedeliveryFk"]',
|
secondClaimRedeliveryAutocomplete: 'vn-claim-development vn-horizontal:nth-child(2) vn-autocomplete[field="claimDevelopment.claimRedeliveryFk"]',
|
||||||
saveDevelopmentButton: `${components.vnSubmit}`
|
saveDevelopmentButton: `${components.vnSubmit}`
|
||||||
},
|
},
|
||||||
|
claimAction: {
|
||||||
|
importClaimButton: 'vn-claim-action vn-button[label="Import claim"]',
|
||||||
|
importTicketButton: 'vn-claim-action vn-button[label="Import ticket"]',
|
||||||
|
secondImportableTicket: 'vn-claim-action > vn-vertical > vn-popover > div > div.content > div > vn-table > div > vn-tbody > vn-tr:nth-child(2)',
|
||||||
|
firstLineDestination: 'vn-claim-action vn-tr:nth-child(1) vn-autocomplete[field="saleClaimed.claimDestinationFk"]',
|
||||||
|
thirdLineDestination: 'vn-claim-action vn-tr:nth-child(3) vn-autocomplete[field="saleClaimed.claimDestinationFk"]',
|
||||||
|
firstDeleteLine: 'vn-claim-action vn-tr:nth-child(1) vn-icon-button[icon="delete"]',
|
||||||
|
secondDeleteLine: 'vn-claim-action vn-tr:nth-child(2) vn-icon-button[icon="delete"]',
|
||||||
|
thirdDeleteLine: 'vn-claim-action vn-tr:nth-child(3) vn-icon-button[icon="delete"]'
|
||||||
|
|
||||||
|
},
|
||||||
ordersIndex: {
|
ordersIndex: {
|
||||||
searchResult: `vn-order-index vn-card > div > vn-table > div > vn-tbody > a.vn-tr`,
|
searchResult: `vn-order-index vn-card > div > vn-table > div > vn-tbody > a.vn-tr`,
|
||||||
searchResultDate: `vn-order-index vn-table vn-tbody > a:nth-child(1) > vn-td:nth-child(4)`,
|
searchResultDate: `vn-order-index vn-table vn-tbody > a:nth-child(1) > vn-td:nth-child(4)`,
|
||||||
|
|
|
@ -0,0 +1,63 @@
|
||||||
|
import selectors from '../../helpers/selectors.js';
|
||||||
|
import createNightmare from '../../helpers/nightmare';
|
||||||
|
|
||||||
|
describe('Claim edit basic data path', () => {
|
||||||
|
const nightmare = createNightmare();
|
||||||
|
|
||||||
|
beforeAll(() => {
|
||||||
|
nightmare
|
||||||
|
.loginAndModule('administrative', 'claim')
|
||||||
|
.accessToSearchResult('4')
|
||||||
|
.accessToSection('claim.card.action');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should import the claim', async() => {
|
||||||
|
const result = await nightmare
|
||||||
|
.waitToClick(selectors.claimAction.importClaimButton)
|
||||||
|
.waitForLastSnackbar();
|
||||||
|
|
||||||
|
expect(result).toEqual('Data saved!');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should import the eighth ticket', async() => {
|
||||||
|
const result = await nightmare
|
||||||
|
.waitToClick(selectors.claimAction.importTicketButton)
|
||||||
|
.waitToClick(selectors.claimAction.secondImportableTicket)
|
||||||
|
.waitForLastSnackbar();
|
||||||
|
|
||||||
|
expect(result).toEqual('Data saved!');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should edit the fourth line destination field', async() => {
|
||||||
|
const result = await nightmare
|
||||||
|
.autocompleteSearch(selectors.claimAction.thirdLineDestination, 'Bueno')
|
||||||
|
.waitForLastSnackbar();
|
||||||
|
|
||||||
|
expect(result).toEqual('Data saved!');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should delete two first lines', async() => {
|
||||||
|
const result = await nightmare
|
||||||
|
.waitToClick(selectors.claimAction.secondDeleteLine)
|
||||||
|
.waitToClick(selectors.claimAction.firstDeleteLine)
|
||||||
|
.waitForLastSnackbar();
|
||||||
|
|
||||||
|
expect(result).toEqual('Data saved!');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should refresh the view to check the remaining line is the expected one', async() => {
|
||||||
|
const result = await nightmare
|
||||||
|
.reloadSection('claim.card.action')
|
||||||
|
.waitToGetProperty(`${selectors.claimAction.firstLineDestination} input`, 'value');
|
||||||
|
|
||||||
|
expect(result).toEqual('Bueno');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should delete the current first line', async() => {
|
||||||
|
const result = await nightmare
|
||||||
|
.waitToClick(selectors.claimAction.firstDeleteLine)
|
||||||
|
.waitForLastSnackbar();
|
||||||
|
|
||||||
|
expect(result).toEqual('Data saved!');
|
||||||
|
});
|
||||||
|
});
|
Loading…
Reference in New Issue