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

36 lines
1.2 KiB
JavaScript

import selectors from '../../helpers/selectors.js';
import openPage from '../../helpers/puppeteer';
describe('Client web Payment', () => {
let page;
beforeAll(async() => {
page = await openPage();
await page.loginAndModule('employee', 'client');
await page.accessToSearchResult('Tony Stark');
await page.accessToSection('client.card.webPayment');
});
afterAll(async() => {
page.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});
});
});
});