salix/e2e/paths/02-client-module/16_web_payment.spec.js

38 lines
1.2 KiB
JavaScript
Raw Normal View History

import selectors from '../../helpers/selectors';
import getBrowser from '../../helpers/puppeteer';
describe('Client web Payment', () => {
let browser;
2019-12-31 11:00:16 +00:00
let page;
beforeAll(async() => {
browser = await getBrowser();
page = browser.page;
2019-12-31 11:00:16 +00:00
await page.loginAndModule('employee', 'client');
await page.accessToSearchResult('Tony Stark');
await page.accessToSection('client.card.webPayment');
});
2019-12-31 11:00:16 +00:00
afterAll(async() => {
browser.close();
2019-12-31 11:00:16 +00:00
});
2019-12-31 11:00:16 +00:00
describe('as employee', () => {
it('should not be able to confirm payments', async() => {
2019-12-31 11:00:16 +00:00
await page.waitFor(selectors.webPayment.confirmFirstPaymentButton, {hidden: true});
});
});
describe('as administrative', () => {
2019-12-31 11:00:16 +00:00
beforeAll(async() => {
await page.loginAndModule('administrative', 'client');
await page.accessToSearchResult('Tony Stark');
await page.accessToSection('client.card.webPayment');
});
it('should be able to confirm payments', async() => {
2019-12-31 11:00:16 +00:00
await page.waitToClick(selectors.webPayment.confirmFirstPaymentButton);
await page.waitFor(selectors.webPayment.firstPaymentConfirmed, {hidden: true});
});
});
});