From a156a26e19328a43249b1e6b567405f08a3b11fb Mon Sep 17 00:00:00 2001 From: Carlos Jimenez Ruiz Date: Mon, 31 Aug 2020 15:00:11 +0200 Subject: [PATCH] e2e updated --- e2e/helpers/selectors.js | 5 +++-- e2e/paths/02-client/14_balance.spec.js | 21 +++++++++++++++++---- 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/e2e/helpers/selectors.js b/e2e/helpers/selectors.js index 6eca623bd..d93b72483 100644 --- a/e2e/helpers/selectors.js +++ b/e2e/helpers/selectors.js @@ -189,8 +189,9 @@ export default { newPaymentBank: '.vn-dialog.shown vn-autocomplete[ng-model="$ctrl.receipt.bankFk"]', newPaymentAmount: '.vn-dialog.shown vn-input-number[ng-model="$ctrl.receipt.amountPaid"]', saveButton: '.vn-dialog.shown [response="accept"]', - firstBalanceLine: 'vn-client-balance-index vn-tbody > vn-tr:nth-child(1) > vn-td:nth-child(8)' - + firstLineBalance: 'vn-client-balance-index vn-tbody > vn-tr:nth-child(1) > vn-td:nth-child(8)', + firstLineReference: 'vn-client-balance-index vn-tbody > vn-tr:nth-child(1) > vn-td-editable', + firstLineReferenceInput: 'vn-client-balance-index vn-tbody > vn-tr:nth-child(1) > vn-td-editable > div > field > vn-textfield' }, webPayment: { confirmFirstPaymentButton: 'vn-client-web-payment vn-tr:nth-child(1) vn-icon-button[icon="done_all"]', diff --git a/e2e/paths/02-client/14_balance.spec.js b/e2e/paths/02-client/14_balance.spec.js index 108f76710..6c16d455d 100644 --- a/e2e/paths/02-client/14_balance.spec.js +++ b/e2e/paths/02-client/14_balance.spec.js @@ -53,15 +53,28 @@ describe('Client balance path', () => { expect(message.type).toBe('success'); }); - it('should check balance is now 0 and the company is now VNL becouse the user local settings were removed', async() => { + it('should edit the 1st line reference', async() => { + await page.waitToClick(selectors.clientBalance.firstLineReference); + await page.write(selectors.clientBalance.firstLineReferenceInput, 'Miscellaneous payment'); + await page.keyboard.press('Enter'); + const message = await page.waitForSnackbar(); + + expect(message.type).toBe('success'); + }); + + it('should check balance is now 0, the reference was saved and the company is now VNL becouse the user local settings were removed', async() => { await page.waitForSpinnerLoad(); let company = await page .waitToGetProperty(selectors.clientBalance.company, 'value'); + let reference = await page + .waitToGetProperty(selectors.clientBalance.firstLineReference, 'innerText'); + let firstBalanceLine = await page - .waitToGetProperty(selectors.clientBalance.firstBalanceLine, 'innerText'); + .waitToGetProperty(selectors.clientBalance.firstLineBalance, 'innerText'); expect(company).toEqual('VNL'); + expect(reference).toEqual('Miscellaneous payment'); expect(firstBalanceLine).toContain('0.00'); }); @@ -76,7 +89,7 @@ describe('Client balance path', () => { it('should check balance is now -100', async() => { let result = await page - .waitToGetProperty(selectors.clientBalance.firstBalanceLine, 'innerText'); + .waitToGetProperty(selectors.clientBalance.firstLineBalance, 'innerText'); expect(result).toContain('-€100.00'); }); @@ -92,7 +105,7 @@ describe('Client balance path', () => { it('should check balance is now 50', async() => { let result = await page - .waitToGetProperty(selectors.clientBalance.firstBalanceLine, 'innerText'); + .waitToGetProperty(selectors.clientBalance.firstLineBalance, 'innerText'); expect(result).toEqual('€50.00'); });