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

Do not require meteor to be running for night watch to work. #85

Open
AChusuei opened this issue Feb 1, 2016 · 2 comments
Open

Do not require meteor to be running for night watch to work. #85

AChusuei opened this issue Feb 1, 2016 · 2 comments

Comments

@AChusuei
Copy link

AChusuei commented Feb 1, 2016

I often run tests locally using nightwatch on a local meteor instance, but there are times when I would like to run those tests against a different environment, and as such having a local meteor instance started should not be required. Is it possible to remove the code that requires meteor to be running?

Or is meteor absolutely required to be running for some reason, if we are conducted tests on a different environment?

@awatson1978
Copy link
Owner

Sure, we can do that.

My initial thought is to watch the --url option, and default to localhost:3000 if it's not detected. The only only real question is whether we ought to check --url before or after we check if meteor is running. (That sort of depends on whether there's an edge case where we might want to check both. Ping-pong testing? Baselining? It's not completely out of the question.)

https://github.com/awatson1978/starrynight/blob/develop/tool/frameworks/nightwatch.js

There's also the ability to specify an external URL in the script using the .url() method. So it's not unheard of to have a devScript.js and prodScript.js, which works reasonably well for basic load testing. But it would be nice to be able to specify the script URLs on the command line. For that, we would need to look at writing to the globals.js file; which is exactly what it's for.

http://nightwatchjs.org/guide#external-globals

Happy to accept a pull-request on this item.

@AChusuei
Copy link
Author

AChusuei commented Feb 1, 2016

For the first part, I would say that since the url is specified in the nightwatch.json file anyways, we should look at whatever url is being looked at for the test, and test that with the http request.

For the second one, I'm not sure we should couple the url being tested with the globals.js file.

If I come up with something, I'll let you know.

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

No branches or pull requests

2 participants