38 lines
1.2 KiB
JavaScript
38 lines
1.2 KiB
JavaScript
import selectors from '../../helpers/selectors';
|
|
import getBrowser from '../../helpers/puppeteer';
|
|
|
|
describe('Client web Payment', () => {
|
|
let browser;
|
|
let page;
|
|
beforeAll(async() => {
|
|
browser = await getBrowser();
|
|
page = browser.page;
|
|
await page.loginAndModule('employee', 'client');
|
|
await page.accessToSearchResult('Tony Stark');
|
|
await page.accessToSection('client.card.webPayment');
|
|
});
|
|
|
|
afterAll(async() => {
|
|
await browser.close();
|
|
});
|
|
|
|
describe('as employee', () => {
|
|
it('should not be able to confirm payments', async() => {
|
|
await page.waitFor(selectors.webPayment.confirmFirstPaymentButton, {hidden: true});
|
|
});
|
|
});
|
|
|
|
describe('as administrative', () => {
|
|
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() => {
|
|
await page.waitToClick(selectors.webPayment.confirmFirstPaymentButton);
|
|
await page.waitFor(selectors.webPayment.firstPaymentConfirmed, {hidden: true});
|
|
});
|
|
});
|
|
});
|