greuge e2e path tests and nightamre config update

This commit is contained in:
Carlos Jimenez 2018-01-09 09:26:45 +01:00
parent 23a7a1a707
commit 0a4a2f1d1d
2 changed files with 10 additions and 7 deletions

View File

@ -1,8 +1,8 @@
/* eslint no-console: 0 */ /* eslint no-console: 0 */
import Nightmare from 'nightmare'; import Nightmare from 'nightmare';
export default function createNightmare(width = 1100, height = 600) { export default function createNightmare(width = 1280, height = 720) {
const nightmare = new Nightmare({show: true, typeInterval: 10}).viewport(width, height); const nightmare = new Nightmare({show: true, typeInterval: 10, x: 0, y: 0}).viewport(width, height);
nightmare.on('page', function(type, message, error) { nightmare.on('page', function(type, message, error) {
fail(error); fail(error);
@ -13,7 +13,7 @@ export default function createNightmare(width = 1100, height = 600) {
fail(message); fail(message);
} }
if (type === 'log') { if (type === 'log') {
// console.log(message); console.log(message);
} }
}); });
return nightmare; return nightmare;

View File

@ -87,16 +87,19 @@ describe('Add greuge path', () => {
it(`should click on the add greuge button`, done => { it(`should click on the add greuge button`, done => {
nightmare nightmare
.waitToClick(selectors.greuge.addGreugeFloatButton) .waitToClick(selectors.greuge.addGreugeFloatButton)
.waitForURL('/greuge/create') .wait(500)
.waitForURL('greuge/create')
.wait(500)
.url() .url()
.wait(500)
.then(url => { .then(url => {
expect(url).toContain('/greuge/create'); expect(url).toContain('greuge/create');
done(); done();
}) })
.catch(catchErrors(done)); .catch(catchErrors(done));
}); });
it(`should add a new greuge`, done => { // it(`should add a new greuge`, done => {
// nightmare // nightmare
// .type(selectors.credit.creditInput, 999) // .type(selectors.credit.creditInput, 999)
// .click(selectors.credit.saveButton) // .click(selectors.credit.saveButton)
@ -107,7 +110,7 @@ describe('Add greuge path', () => {
// done(); // done();
// }) // })
// .catch(catchErrors(done)); // .catch(catchErrors(done));
}); // });
// it('should confirm the credit was updated', done => { // it('should confirm the credit was updated', done => {
// nightmare // nightmare