2020-01-23 15:01:29 +00:00
|
|
|
import selectors from '../../helpers/selectors.js';
|
|
|
|
import getBrowser from '../../helpers/puppeteer';
|
2018-03-09 19:04:03 +00:00
|
|
|
|
|
|
|
describe('create client path', () => {
|
2020-01-23 15:01:29 +00:00
|
|
|
let browser;
|
|
|
|
let page;
|
|
|
|
beforeAll(async() => {
|
|
|
|
browser = await getBrowser();
|
|
|
|
page = browser.page;
|
|
|
|
await page.loginAndModule('employee', 'client');
|
|
|
|
});
|
2018-03-09 19:04:03 +00:00
|
|
|
|
2020-01-23 15:01:29 +00:00
|
|
|
afterAll(async() => {
|
|
|
|
await browser.close();
|
2018-03-09 19:04:03 +00:00
|
|
|
});
|
|
|
|
|
2019-01-23 15:00:56 +00:00
|
|
|
it('should access to the create client view by clicking the create-client floating button', async() => {
|
2020-01-23 15:01:29 +00:00
|
|
|
await page.waitToClick(selectors.clientsIndex.createClientButton);
|
2020-02-04 15:21:10 +00:00
|
|
|
let url = await page.expectURL('#!/client/create');
|
2018-03-09 19:04:03 +00:00
|
|
|
|
2020-02-04 15:21:10 +00:00
|
|
|
expect(url).toBe(true);
|
2018-03-09 19:04:03 +00:00
|
|
|
});
|
|
|
|
|
2019-01-23 15:00:56 +00:00
|
|
|
it('should cancel the client creation to go back to clients index', async() => {
|
2020-01-23 15:01:29 +00:00
|
|
|
await page.waitToClick(selectors.globalItems.applicationsMenuButton);
|
|
|
|
await page.waitToClick(selectors.globalItems.clientsButton);
|
2020-02-04 15:21:10 +00:00
|
|
|
let url = await page.expectURL('#!/client/index');
|
2018-11-23 07:05:57 +00:00
|
|
|
|
2020-02-04 15:21:10 +00:00
|
|
|
expect(url).toBe(true);
|
2018-03-09 19:04:03 +00:00
|
|
|
});
|
|
|
|
});
|