#1056 modificar e2e client.risk

This commit is contained in:
Carlos Jimenez Ruiz 2019-01-30 09:40:38 +01:00
parent 15ded03ef9
commit 8b8b3432e0
2 changed files with 37 additions and 5 deletions

View File

@ -160,6 +160,7 @@ export default {
},
clientRisk: {
riskButton: `vn-left-menu a[ui-sref="client.card.risk.index"]`,
companyAutocomplete: 'vn-client-risk-index vn-autocomplete[field="$ctrl.companyFk"]',
newPaymentButton: `${components.vnFloatButton}`,
newPaymentBankInut: `vn-client-risk-create vn-textfield[field="$ctrl.receipt.bankFk"] input`,
newPaymentAmountInput: `vn-client-risk-create vn-textfield[field="$ctrl.receipt.amountPaid"] input`,

View File

@ -7,12 +7,38 @@ describe('Client risk path', () => {
beforeAll(() => {
nightmare
.loginAndModule('administrative', 'client')
.accessToSearchResult('Petter Parker')
.accessToSection('client.card.risk.index');
.accessToSearchResult('Petter Parker');
});
it('should now edit the local user config data', async() => {
let result = await nightmare
.waitToClick(selectors.globalItems.userMenuButton)
.autocompleteSearch(selectors.globalItems.userLocalCompany, 'CCs')
.waitForLastSnackbar();
expect(result).toEqual('Data saved!');
});
it('should access to the risk section to check the data shown matches the local settings', async() => {
let result = await nightmare
.accessToSection('client.card.risk.index')
.waitToGetProperty(`${selectors.clientRisk.companyAutocomplete} input`, 'value');
expect(result).toEqual('CCs');
});
it('should now clear the user local settings', async() => {
let result = await nightmare
.waitToClick(selectors.globalItems.userMenuButton)
.waitToClick(selectors.globalItems.userConfigThirdAutocompleteClear)
.waitForLastSnackbar();
expect(result).toEqual('Data saved!');
});
it('should click the new payment button', async() => {
let url = await nightmare
.reloadSection('client.card.risk.index')
.waitToClick(selectors.clientRisk.newPaymentButton)
.waitForURL('/risk')
.parsedUrl();
@ -30,11 +56,16 @@ describe('Client risk path', () => {
expect(result).toContain('Data saved!');
});
it('should check balance is now 0', async() => {
let result = await nightmare
it('should check balance is now 0 and the company is now VNL becouse the user local settings were removed', async() => {
let company = await nightmare
.waitToGetProperty(`${selectors.clientRisk.companyAutocomplete} input`, 'value');
let firstRiskLineBalance = await nightmare
.waitToGetProperty(selectors.clientRisk.firstRiskLineBalance, 'innerText');
expect(result).toEqual('0.00 €');
expect(company).toEqual('VNL');
expect(firstRiskLineBalance).toEqual('0.00 €');
});
it('should now click the new payment button', async() => {