2022-11-21 09:49:19 +00:00
|
|
|
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"]'
|
|
|
|
};
|
|
|
|
|
2022-11-21 09:49:19 +00:00
|
|
|
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);
|
2022-11-21 09:49:19 +00:00
|
|
|
const message = await page.waitForSnackbar();
|
|
|
|
|
|
|
|
expect(message.text).toContain('Notification sent!');
|
|
|
|
});
|
|
|
|
});
|