changeLanguage extension applied to the whole e2e testing.
This commit is contained in:
parent
323c69858b
commit
c51d339732
|
@ -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);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -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 => {
|
||||||
|
|
|
@ -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 => {
|
||||||
|
|
|
@ -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 => {
|
||||||
|
|
Loading…
Reference in New Issue