2020-01-14 08:20:14 +00:00
|
|
|
import selectors from '../../helpers/selectors';
|
|
|
|
import getBrowser from '../../helpers/puppeteer';
|
2019-02-20 11:49:39 +00:00
|
|
|
|
2019-03-01 10:30:59 +00:00
|
|
|
describe('Client web Payment', () => {
|
2020-01-14 08:20:14 +00:00
|
|
|
let browser;
|
2019-12-31 11:00:16 +00:00
|
|
|
let page;
|
|
|
|
beforeAll(async() => {
|
2020-01-14 08:20:14 +00:00
|
|
|
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-02-20 11:49:39 +00:00
|
|
|
|
2019-12-31 11:00:16 +00:00
|
|
|
afterAll(async() => {
|
2020-01-14 08:40:50 +00:00
|
|
|
await browser.close();
|
2019-12-31 11:00:16 +00:00
|
|
|
});
|
2019-02-20 11:49:39 +00:00
|
|
|
|
2019-12-31 11:00:16 +00:00
|
|
|
describe('as employee', () => {
|
2019-02-20 11:49:39 +00:00
|
|
|
it('should not be able to confirm payments', async() => {
|
2020-11-23 17:28:39 +00:00
|
|
|
await page.waitForSelector(selectors.webPayment.confirmFirstPaymentButton, {hidden: true});
|
2019-02-20 11:49:39 +00:00
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
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');
|
2019-02-20 11:49:39 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
it('should be able to confirm payments', async() => {
|
2019-12-31 11:00:16 +00:00
|
|
|
await page.waitToClick(selectors.webPayment.confirmFirstPaymentButton);
|
2020-11-23 17:28:39 +00:00
|
|
|
await page.waitForSelector(selectors.webPayment.firstPaymentConfirmed, {hidden: true});
|
2019-02-20 11:49:39 +00:00
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|