These are chat archives for rosshinkley/nightmare

25th
Apr 2017
Sergio Crisostomo
@SergioCrisostomo
Apr 25 2017 03:46
morning! trying to trigger copy/ paste, any one that can give some pointers?
Sergio Crisostomo
@SergioCrisostomo
Apr 25 2017 05:35
Ah! got it working! ^ and posted a answer
Andrew Alanis
@EnlightenedCode
Apr 25 2017 20:59
I have issues getting nightmare to do a simple "click" action on a login form... I run the css selector ".login-submit" in my console in chrome and it gets it just fine and can use the click function....however... when nightmare does it with the electron browser...it just sits and never clicks the button....the project is an ionic 2 / angular 2 web app...if that helps... anyone have any problems with click issues like this? below is the simple test code I am running.

``` "use strict";
const Nightmare = require('nightmare');
const expect = require('chai').expect;
const BASE_URL = 'http://localhost:8100/';
const onError = (err) => {
console.error("Test-runner failed: ", err);
};
const assert = require('assert');

describe('Login Workflow', function () {
this.timeout('15s');

let nightmare = null;
beforeEach(() => {
nightmare = new Nightmare({
show: true,
typeInterval: 20,
pollInterval: 50
});;
});

describe('given bad Login', () => {
it('should fail', done => {
nightmare.goto(BASE_URL)
.evaluate(() => {
return localStorage.clear();
})
.on('page', (type, message) => {
if (type == 'alert') done()
})
.type('.login-email-input .text-input', 'notgonnawork')
.type('.login-pass-input .text-input', 'invalid password')
.wait(2000)
.click('.login-submit')
.end()
.then()
.catch(done)
});
});
}); ```

Andrew Alanis
@EnlightenedCode
Apr 25 2017 21:27
another thing I noticed is...in the chrome debugger I can click the button on the console doing document.querySelector('.login-submit').click() but when I try to do that in electron browser....it doesn't work...the querySelector by itself pulls up the element though on both browsers...