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 */
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;

View File

@ -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