From 0a4a2f1d1df354ff031ec47f7b3e07c3017fe55e Mon Sep 17 00:00:00 2001 From: Carlos Jimenez <=> Date: Tue, 9 Jan 2018 09:26:45 +0100 Subject: [PATCH] greuge e2e path tests and nightamre config update --- e2e/helpers/nightmare.js | 6 +++--- e2e/paths/09_add_greuge.spec.js | 11 +++++++---- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/e2e/helpers/nightmare.js b/e2e/helpers/nightmare.js index d9847a3ec..b0b9f7d69 100644 --- a/e2e/helpers/nightmare.js +++ b/e2e/helpers/nightmare.js @@ -1,8 +1,8 @@ /* eslint no-console: 0 */ import Nightmare from 'nightmare'; -export default function createNightmare(width = 1100, height = 600) { - const nightmare = new Nightmare({show: true, typeInterval: 10}).viewport(width, height); +export default function createNightmare(width = 1280, height = 720) { + const nightmare = new Nightmare({show: true, typeInterval: 10, x: 0, y: 0}).viewport(width, height); nightmare.on('page', function(type, message, error) { fail(error); @@ -13,7 +13,7 @@ export default function createNightmare(width = 1100, height = 600) { fail(message); } if (type === 'log') { - // console.log(message); + console.log(message); } }); return nightmare; diff --git a/e2e/paths/09_add_greuge.spec.js b/e2e/paths/09_add_greuge.spec.js index 1cac339fe..a062a1eae 100644 --- a/e2e/paths/09_add_greuge.spec.js +++ b/e2e/paths/09_add_greuge.spec.js @@ -87,16 +87,19 @@ describe('Add greuge path', () => { it(`should click on the add greuge button`, done => { nightmare .waitToClick(selectors.greuge.addGreugeFloatButton) - .waitForURL('/greuge/create') + .wait(500) + .waitForURL('greuge/create') + .wait(500) .url() + .wait(500) .then(url => { - expect(url).toContain('/greuge/create'); + expect(url).toContain('greuge/create'); done(); }) .catch(catchErrors(done)); }); - it(`should add a new greuge`, done => { + // it(`should add a new greuge`, done => { // nightmare // .type(selectors.credit.creditInput, 999) // .click(selectors.credit.saveButton) @@ -107,7 +110,7 @@ describe('Add greuge path', () => { // done(); // }) // .catch(catchErrors(done)); - }); + // }); // it('should confirm the credit was updated', done => { // nightmare