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)
.then(done);
}
if (result != 'Cambiar idioma') {
if (result === 'Change language') {
this.then(done);
}
});

View File

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