Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Help with nightmare.goto() #15

Open
kof opened this issue Jun 16, 2017 · 6 comments
Open

Help with nightmare.goto() #15

kof opened this issue Jun 16, 2017 · 6 comments

Comments

@kof
Copy link

kof commented Jun 16, 2017

I'm using karma-nightmare version [0.4.8]

Description

I am struggling to understand how this should work with goto(url), meaning I need to open a url and then run nightmare actions on that page.

Any help is welcome.

Right now as soon as I require('nightmare'), I get errors like this

ERROR in ./~/nightmare/lib/actions.js
Module not found: Error: Can't resolve 'fs' in '/test/node_modules/nightmare/lib'
@bokuweb
Copy link
Owner

bokuweb commented Jun 17, 2017

@kof Thanks for your report. Can you show me the minimum project to reproduce it?

@kof
Copy link
Author

kof commented Jun 17, 2017

npm i && npm test

karma-nightmare-example.zip

All my code is basically this:

import expect from 'expect.js'

// Throws here.
import 'nightmare'

describe('test', () => {
  it('should pass', () => {
    expect(true).to.be(true)
  })
})

@bokuweb
Copy link
Owner

bokuweb commented Jun 17, 2017

@kof Thanks!!

@kof
Copy link
Author

kof commented Jun 17, 2017

Or actually its even simpler, can you make an example how to navigate to pages with nightmare.goto() from the tests?

@bokuweb
Copy link
Owner

bokuweb commented Jun 17, 2017

You can not use nighhtmare.goto on karma. Because karma test is running on renderer pocess on Electron.If you want to use nightmare.goto(), please use nightmare and e.g mocha without karma.

@bokuweb bokuweb closed this as completed Jun 17, 2017
@bokuweb bokuweb reopened this Jun 17, 2017
@kof
Copy link
Author

kof commented Jun 17, 2017

Yeah, but that would be cool.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants