salix/e2e/paths/02-client/23_send_compensation.spec.js

33 lines
1.1 KiB
JavaScript
Raw Permalink Normal View History

import getBrowser from '../../helpers/puppeteer';
2023-05-08 10:03:27 +00:00
const $ = {
company: 'vn-client-balance-index vn-autocomplete[ng-model="$ctrl.companyId"]',
compensationButton: 'vn-client-balance-index vn-icon-button[vn-dialog="send_compensation"]',
saveButton: '.vn-dialog.shown [response="accept"]'
};
describe('Client Send balance compensation', () => {
let browser;
let page;
beforeAll(async() => {
browser = await getBrowser();
page = browser.page;
await page.loginAndModule('employee', 'client');
await page.accessToSearchResult('Clark Kent');
await page.accessToSection('client.card.balance.index');
});
afterAll(async() => {
await browser.close();
});
it(`should click on send compensation button`, async() => {
2023-05-08 10:03:27 +00:00
await page.autocompleteSearch($.company, 'VNL');
await page.waitToClick($.compensationButton);
await page.waitToClick($.saveButton);
const message = await page.waitForSnackbar();
expect(message.text).toContain('Notification sent!');
});
});