salix/e2e/smokes/01_client_path.spec.js

31 lines
1.0 KiB
JavaScript
Raw Normal View History

2018-03-09 19:04:03 +00:00
import selectors from '../helpers/selectors';
import createNightmare from '../helpers/nightmare';
2018-03-09 19:04:03 +00:00
describe('create client path', () => {
let nightmare = createNightmare();
beforeAll(() => {
return nightmare
.loginAndModule('employee', 'client');
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() => {
let url = await nightmare
2019-01-23 15:00:56 +00:00
.waitToClick(selectors.clientsIndex.createClientButton)
.wait(selectors.createClientView.createButton)
.parsedUrl();
2018-03-09 19:04:03 +00:00
expect(url.hash).toEqual('#!/client/create');
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() => {
let url = await nightmare
.waitToClick(selectors.globalItems.applicationsMenuButton)
.waitToClick(selectors.globalItems.clientsButton)
.wait(selectors.clientsIndex.createClientButton)
.parsedUrl();
expect(url.hash).toEqual('#!/client/index');
2018-03-09 19:04:03 +00:00
});
});