#860 E2E client/client/src/web-payment/index.js

This commit is contained in:
Carlos Jimenez Ruiz 2019-02-20 12:49:39 +01:00
parent 250bb359e1
commit ccf5c95b56
2 changed files with 44 additions and 0 deletions

View File

@ -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}`,

View File

@ -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();
});
});
});