Created
December 8, 2017 14:12
-
-
Save kenshinji/685a70e929895419d66ad08d3b03cf1d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const Nightmare = require('nightmare'); | |
const nightmare = Nightmare({show:true}); | |
//nightmare.useragent('Headless') | |
nightmare.cookies.set({ | |
url: 'https://mastering-phoenix-framework-federicoesparza.c9users.io:8081/', | |
name: 'c9.live.user.click-through', | |
value: 'ok', | |
path: '/', | |
secure: true, | |
domain: '.mastering-phoenix-framework-federicoesparza.c9users.io', | |
expires: '2187-08-16T13:12:47.580Z' | |
}) | |
.goto('https://mastering-phoenix-framework-federicoesparza.c9users.io:8081') | |
// .click('a.solid.fat.info.button') | |
// .wait('.App-title') | |
// .type("#yt_link", "http://yt.link") | |
// .click("input[name = 'Submit']") | |
// .wait(1000) | |
.click("#videos_page_link") | |
//.wait(1000) | |
// .goto('https://mastering-phoenix-framework-federicoesparza.c9users.io:8081/videos') | |
.evaluate(() => | |
document.body.textContent | |
// document.querySelector('.App-title') # not working for some reason | |
) | |
.end() | |
.then((text) => { | |
console.log(text); | |
//expect(text).to.include('http://yt.link'); | |
//done(); | |
}) | |
// .catch(done); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment