salix/e2e/helpers/nightmare.js

24 lines
588 B
JavaScript
Raw Normal View History

/* eslint no-console: 0 */
import Nightmare from 'nightmare';
export default function createNightmare(width = 1280, height = 720) {
const nightmare = new Nightmare({show: process.env.E2E_SHOW, typeInterval: 10, x: 0, y: 0, waitTimeout: 2000})
.viewport(width, height);
nightmare.on('console', (type, message) => {
2018-11-21 15:59:09 +00:00
if (type === 'error')
fail(message);
});
nightmare.header('Accept-Language', 'en');
afterAll(() => {
return nightmare
2018-11-21 15:59:09 +00:00
.end();
});
return nightmare;
}
jasmine.DEFAULT_TIMEOUT_INTERVAL = 10000;