-
Notifications
You must be signed in to change notification settings - Fork 959
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
Better testing stack #5
Comments
The library I was talking about on twitter - https://github.com/defunctzombie/zuul - it's my favorite runner, supporting mocha, jasmine, qunit frameworks, using the |
I don't think you should use intern, I've been following it since release and it was promising but it is very inflexible and have heard nothing but complaints from anyone that tries to use it. |
Also, you can use your webpack config as part of zuul using https://www.npmjs.com/package/zuul-builder-webpack |
I'm biased (current maintainer of Karma) but I will suggest to use Karma. There is an issue with changing urls when using Karma, which I'm currently investigating and hope to have a fix for soon (Ref: karma-runner/karma#1101) so after that you should be good to go |
Thanks for the input @dignifiedquire. The reason I'm questioning if karma would be a good fit here is because it seems like karma doesn't want me to ever refresh the page, which is exactly the kind of thing we need to do every so often in a thorough test suite for a history lib. :) For example, we currently have a I guess my question for you is, is this the kind of thing that is within karma's expectations? Or has karma loaded code in the browser that will screw up the test if we do a page refresh? @phated Thanks for the link to zuul (and bonus points for the Ghostbusters reference!). I'll add it to the list of possible candidates and give it a whirl. |
@mjackson I started a similar search last week and Zuul made it to the top of my list as well, followed by Karma (mostly due to mindshare & my history with Angular). Intern went through just the "R" of "R & D" before I decided to try out Zuul first. I've subscribed to this thread so I can share my findings with the group as well. See you on the other side! :) |
As the maintainer of WebdriverIO I can confirm that all of the above mentioned requirements would work since you can execute any arbitrary JS using |
I'm not sure if you've already settled on zuul, but https://github.com/hughsk/smokestack has served me well – I'd recommend taking a look. |
Thanks for the insight @christian-bromann. I still think that WebdriverIO could be a slightly better fit than zuul because it controls a client instance from the outside. It seems like this would be a huge benefit when testing a history lib because we can essentially start with a clean browser session with each test. For example, if I beforeEach(function (done) {
client = webdriverio.remote(...); // Create a brand new client instance.
client.init(done); // Start a new browser session.
});
afterEach(function (done) {
client.end(done); // Destroy the browser session.
}); @christian-bromann Is there anything about creating and destroying multiple |
@joeybaker Thanks for the recommendation, but unless I'm mistaken smokestack follows more or less the same process model as karma/zuul (runs everything in the same tab), right? |
Yea, it does. :( A possible solution would be to separate your tests into many files and launch a new smokestack instance for each file. That's basically what webdriver will do for you, but might make for a complicated test launch script. |
True.
You should use the wdio runner. Like in protractor you define a set of capabilities + the test spec that the capability should test. You should also be able to recreate the Selenium session during a wdio test run. |
Man, spent most of today trying to put together a branch that uses WebdriverIO for testing, but it's a lot of work. Basically, the flow ended up like this:
But it feels clunky. Maybe a single process suite is the way to go... |
Whatever works is good, but for what it's worth, the reason I suggested smokestack is because eveytime I touch selenium I get the same reaction. You might look into saucelabs. It's free for OSS |
Well, as of 3dde5ce our testing story is to use zuul to run our tests locally, on sauce labs, and even on Travis. It was really easy to get everything setup, so that's what we'll go with for now. If someone gets some time/ambition to dig into this further in the future, we can reopen this ticket. But I'm closing for now. |
It's pretty clear to me at this point that jsdom isn't going to work. The support for the HTML5 history API appears to be incomplete, and, given the quirks of the various history implementations, I'd rather test in real browsers anyway.
Stuff we need to be able to do in a single integration test:
hashchange
/popstate
events when the URL changeswindow.history.pushState
/window.history.replaceState
window.location.replace
window.location.href
Stuff we need to be able to do in a test suite:
There are a few options out there, none of which I'm very familiar with. If anyone has any experience with any of these stacks, please chime in.
intern (Doesn't seem very flexible, but could maybe work)We use karma to test React Router, so it would be great if we could stick with that. But it seems like I remember it complaining when we tried to change the URL (which is strange because I thought karma ran all your tests in an
<iframe>
... ?)The text was updated successfully, but these errors were encountered: