diff --git a/e2e/helpers/selectors.js b/e2e/helpers/selectors.js index d4a5fea0e..8b4b0e184 100644 --- a/e2e/helpers/selectors.js +++ b/e2e/helpers/selectors.js @@ -163,6 +163,10 @@ export default { firstRiskLineBalance: 'vn-client-risk-index vn-tbody > vn-tr:nth-child(1) > vn-td:nth-child(8)' }, + webPayment: { + confirmFirstPaymentButton: 'vn-client-web-payment vn-tr:nth-child(1) vn-icon-button[icon="done_all"]', + firstPaymentConfirmed: 'vn-client-web-payment vn-tr:nth-child(1) vn-icon[icon="check"]' + }, itemsIndex: { goBackToModuleIndexButton: `vn-ticket-descriptor a[href="#!/ticket/index"]`, createItemButton: `${components.vnFloatButton}`, diff --git a/e2e/paths/client-module/16_web_payment.spec.js b/e2e/paths/client-module/16_web_payment.spec.js new file mode 100644 index 000000000..d7f8e88f3 --- /dev/null +++ b/e2e/paths/client-module/16_web_payment.spec.js @@ -0,0 +1,40 @@ +import selectors from '../../helpers/selectors.js'; +import createNightmare from '../../helpers/nightmare'; + +// #860 E2E client/client/src/web-payment/index.js missing fixtures for another client +xdescribe('Client web Payment', () => { + const nightmare = createNightmare(); + + describe('as employee', () => { + beforeAll(() => { + nightmare + .loginAndModule('employee', 'client') + .accessToSearchResult('Bruce Wayne') + .accessToSection('client.card.webPayment'); + }); + + it('should not be able to confirm payments', async() => { + let exists = await nightmare + .exists(selectors.webPayment.confirmFirstPaymentButton); + + expect(exists).toBeFalsy(); + }); + }); + + describe('as administrative', () => { + beforeAll(() => { + nightmare + .loginAndModule('administrative', 'client') + .accessToSearchResult('Bruce Wayne') + .accessToSection('client.card.webPayment'); + }); + + it('should be able to confirm payments', async() => { + let exists = await nightmare + .waitToClick(selectors.webPayment.confirmFirstPaymentButton) + .exists(selectors.webPayment.firstPaymentConfirmed); + + expect(exists).toBeTruthy(); + }); + }); +});