e2e warm up added for 1st usage of fixtures.

This commit is contained in:
Carlos 2017-10-29 19:43:39 +01:00
parent 19192236b0
commit bf4cbe6c1a
3 changed files with 17 additions and 4 deletions

View File

@ -126,7 +126,7 @@ Nightmare.action('waitForSnackbarReset', function(done) {
Nightmare.action('waitForURL', function(hashURL, done) {
this.wait(200);
this.wait(hash => {
return document.location.hash === hash;
return document.location.hash.includes(hash);
}, hashURL)
.then(done);
});

View File

@ -7,6 +7,7 @@ export default {
},
globalItems: {
topBar: 'vn-topbar',
logOutButton: 'body > vn-app > vn-vertical > vn-topbar > header > vn-main-menu > div > vn-icon:nth-child(4)',
snackbarIsActive: '.mdl-snackbar--active > .mdl-snackbar__text',
applicationsMenuButton: '#apps > i',
applicationsMenuVisible: 'body > vn-app > vn-vertical > vn-topbar > header > vn-main-menu > div .is-visible > div',

View File

@ -4,7 +4,19 @@ import selectors from '../helpers/selectors.js';
import {catchErrors} from '../../services/utils/jasmineHelpers';
const nightmare = createNightmare();
const moduleAccessViewHashURL = '#!/';
const basicDataViewHashURL = '#!/clients/14/basic-data';
describe('warm up', () => {
it('should warm up login and fixtures', done => {
nightmare
.login()
.waitForURL(moduleAccessViewHashURL)
.waitToClick(selectors.globalItems.logOutButton)
.then(() => {
done();
})
.catch(catchErrors(done));
});
});
describe('Clients path', () => {
describe('Create', () => {
@ -215,10 +227,10 @@ describe('Clients path', () => {
// nightmare
// .waitForNumberOfElements(selectors.clientsIndex.searchResult, 1)
// .waitToClick(selectors.clientsIndex.searchResult) // this is targeting Bruce Wayne 1 of 10 times instead of Carol Danvers watchout for intermitence
// .waitForURL(basicDataViewHashURL)
// .waitForURL('basic-data')
// .url()
// .then(url => {
// expect(url).toBe(config.url + basicDataViewHashURL);
// expect(url).toContain('basic-data');
// done();
// })
// .catch(catchErrors(done));