changeLanguage extension applied to the whole e2e testing.

This commit is contained in:
Carlos Jimenez 2017-12-07 15:51:48 +01:00
parent 323c69858b
commit c51d339732
4 changed files with 16 additions and 43 deletions

View File

@ -137,7 +137,7 @@ Nightmare.action('changeLanguageToEnglish', function(done) {
this.click(selectors.globalItems.languageButton) this.click(selectors.globalItems.languageButton)
.then(done); .then(done);
} }
if (result != 'Cambiar idioma') { if (result === 'Change language') {
this.then(done); this.then(done);
} }
}); });

View File

@ -33,20 +33,11 @@ describe('create client path', () => {
it('should make sure the language is English', done => { it('should make sure the language is English', done => {
nightmare nightmare
.wait(selectors.globalItems.languageButton) .changeLanguageToEnglish()
.evaluate(selector => { .then(() => {
return document.querySelector(selector).title; done();
}, selectors.globalItems.languageButton) })
.then(result => { .catch(catchErrors(done));
if (result === 'Cambiar idioma') {
nightmare.click(selectors.globalItems.languageButton)
.then(done);
}
if (result != 'Cambiar idioma') {
nightmare
.then(done);
}
});
}); });
it('should access to the clients index by clicking the clients button', done => { it('should access to the clients index by clicking the clients button', done => {

View File

@ -33,20 +33,11 @@ describe('Edit basicData path', () => {
it('should make sure the language is English', done => { it('should make sure the language is English', done => {
nightmare nightmare
.wait(selectors.globalItems.languageButton) .changeLanguageToEnglish()
.evaluate(selector => { .then(() => {
return document.querySelector(selector).title; done();
}, selectors.globalItems.languageButton) })
.then(result => { .catch(catchErrors(done));
if (result === 'Cambiar idioma') {
nightmare.click(selectors.globalItems.languageButton)
.then(done);
}
if (result != 'Cambiar idioma') {
nightmare
.then(done);
}
});
}); });
it('should click on the Clients button of the top bar menu', done => { it('should click on the Clients button of the top bar menu', done => {

View File

@ -33,20 +33,11 @@ describe('Edit fiscalData path', () => {
it('should make sure the language is English', done => { it('should make sure the language is English', done => {
nightmare nightmare
.wait(selectors.globalItems.languageButton) .changeLanguageToEnglish()
.evaluate(selector => { .then(() => {
return document.querySelector(selector).title; done();
}, selectors.globalItems.languageButton) })
.then(result => { .catch(catchErrors(done));
if (result === 'Cambiar idioma') {
nightmare.click(selectors.globalItems.languageButton)
.then(done);
}
if (result != 'Cambiar idioma') {
nightmare
.then(done);
}
});
}); });
it('should click on the Clients button of the top bar menu', done => { it('should click on the Clients button of the top bar menu', done => {