-
Notifications
You must be signed in to change notification settings - Fork 11
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
On documentation #56
Comments
I managed to run nightwatch unittests by calling nightwatch directly.
How do you pass |
Looking at the code, I assume that the way to do it would be something like:
Unit is described in the help output, but the case for it is not defined. |
Hi!
You'll need to edit your nightwatch.json config though. StarryNight can do that for you, if you |
Thanks for your answers.
For phantomjs: |
Sweet! If you got all that working, the rest of the Nightwatch/StarryNight features should all fall into place, like tagging, screenshots, logging, chai expect syntax, scaffolding, environment analysis, refactoring, etc. Thanks for the feedback and have fun! |
I think that claimed victory too soon. |
Interesting question. There's a couple of different approaches, depending on whether you're wanting to test server, client, or package code. The primary issue though, is whether or not you've written your code to be accessible in the first place. And that generally means naming functions, and cleanly attaching them to known objects (ie. Meteor, Templates, or on an isomorphic object exposed from a package). But lets assume you are. Take a look at the following code, which uses unittests in the acceptance test runner, and which can hook into a running app and test code on the client and from packages. That's one way to access running code. (This is akin to running an engine diagnostics meter while your car is running.) https://gist.github.com/awatson1978/e9fd118781e68c5e851e To access static non-running code, the functions need to be attached to an object that can be found by the runner. This is similar to opening the hood of your car and looking at the engine while the engine if off. It's also where I'm a little less clear on how to use Nightwatch, as it's a new feature and being developed by others. But I'm more than happy to help. If we look at the unittest example, we see the following line:
We need to extend this with something Meteorish... var Foo = require('client/components/foo.js'); But that var Template.foo = require('client/components/foo.js'); My guess is we're getting close to needing to stub the various default Meteor objects. Velocity has a project which is relevant; and I'm thinking we may want to grab the following file and figure out how it gets integrated. So, here's what I'd recommend trying:
See if you can get anywhere with that. I'm writing documentation, and will be trying to get some of these answers written up and posted. |
Maybe this is naive but... |
Oh, I don't think that's naive at all. Not 100% sure it will work. But it may be an excellent approach. For that, we'd need to reference files in the |
I've been trying munit and package testing (both tintytest and velocity). Integration tests and scope issuesRegular package testing seems to be much better supported than velocity integration tests. Which runner to use?I definitely do not want to rewrite my tests because I choose another runner. The ideal would be to write the tests in one framework, and then be able to choose runner freely. For example, as a Webstorm user I'd like to have a runner that is integrated with my IDE. At the moment it seems that jasmine is the best supported runner in velocity, and velocity seems to be MDG's choice (right or wrong, that is the reality). My guess is that there many other users in my situation, and if you'd like a wider adoption of starrynight, a path compatible with velocity could a wise strategy. |
Hi Alex, As you may have read about, my clients and our partner organizations are in the process of publishing a Clinical Meteor Track, where we'll be adding D3 back in, and replacing Velocity with Nightwatch. Because of the way that management of the Velocity project was handled, it's actually going to get murkier as the Clinical Meteor Track is published, since Velocity is not going to be the Clinical Meteor Track's official runner. (Similar to how some people use React or Angular instead of Blaze). As for compatibility between StarryNight and Velocity, it would be fairly straight-forward to integrate the two. Simply need to add Velocity as a framework in the same way TinyTest was added. If somebody else wants to write that code, I can provide a pattern and files to follow, and would accept pull request for it. But I'm also not going to personally waste any more of my own time trying to integrate it. As for getting additional people using StarryNight, there's already the healthcare working group and our partner organizations who are invested in using its features. It will grow simply because we've got a stable and growing base of clients, are currently interviewing and hiring developers for StarryNight/Nightwatch, it's going to be the official runner of the Clinical Meteor Track, and graduate students and interns are being assigned to use StarryNight instead of Velocity. |
Thanks for the extra info. Great to know that you've got funding to get this working. |
Hi Abigail,
Thanks for your efforts!
In the docs I did not find your email, so I started this issue instead.
I've just given starrynight a try and these are my notes on the docs.
starrynight.meteor.com
So you can get help spotting and fixing the docs.
Shouldn't i be 3.2.6.1?
I suppose the examples in the doc site.
I guess so, but it wouldn't hurt to state it.
Can I specify a different one than the default? How?
github.com/awatson1978/starrynight
Maybe keep a really simple readme pointing to the doc site?
General questions
I see in the generated nightwatch.json that tests can be run with phantomjs. How?
As starrynight did not install on OSX, I created a Meteor project in cloud9 (Ubuntu). But I did not manage to get Nightwatch connecting to selenium. It would be good with a checklist of things to check for troubleshooting.
At the end of the day, I still did not manage to get nightwatch tests running.
The text was updated successfully, but these errors were encountered: