We recently released a new version of Chimp that has deeper integration with Meteor to allow you to do next-generation testing. Here are some highlights:
Reactive Testing
If you change your application files, Chimp will detect the hot-code deployment and reruns in an instant. As soon as you save changes to a spec, Chimp runs in an instant. You can also add adhoc directories to watch. All of this is happening without Velocity.
Synchronous Testing
No callback hells or promise headaches, we took the original WebdriverIO and made it synchronous! So you can write easy-to-read tests. We also wrapped the node DDP library and made that synchronous. This means you can do a server call, then a client call, then a server call then an assertion from an opto-decoupled test.
Contextual Objects In Your Specs
Within the context of your steps, you get a client object. This is a pre-configured WebdriverIO instance that you can use to control the front-end using ANY browser and you get a server object is a pre-connected DDP instance. This allows you to test Meteor methods and publications or to use data fixtures. You also get a request object that allows you to test REST api’s or to use data fixtures over HTTP
Remote Code Execution
WebdriverIO already comes with a method called client.execute, which runs code on the client. We added a server.execute method that does exactly the same thing as the client. This means you can employ some seriously advanced test-driving techniques, like Modeling by Example for instance.
Use Mocha Or Cucumber (Jasmine soon)
Choose the testing framework what you’re most comfortable with and enjoy the same benefits listed above in all of them.
Using Chimp has been pure bliss… i’ve been used to beating my head against the wall using other selenium based products and I’ve always spent more time getting my failing tests to pass (when I know they should pass).
Chimp just seems to work
I’ve been using Capybara and Rspec for a long time and Chimp is now actually faster with productivity and also when running. I can’t wait for the Jasmine support! (Mocha is nice too but all my unit tests are in Jasmine).
Is there a chance that in the future Chimp will be able to split features up per core and run 4 browsers at once?
Also will mocha support coffeescript via it’s internal transpiling? I’m not super concerned about this but it would be make for some seriously readable acceptance tests! Example: (using some capybara helpers with mocha)
require "capy-js"
describe "Create comment", ->
before ->
visit "/posts"
it "should create a blog post", ->
fill_in "Title", "Chimp is Awesome!"
fill_in "Description", "How now brown cow"
click_button "Create Post"
expect(browser).to_have_content "Chimp is Awesome!"
expect(browser).to_have_content "Billy Bob", within: ".author"
Velocity relies on the MDG to progress where as Chimp relies only on us. We have written it as a framework agnostic NPM package and we sprinkled some Meteor toys on top
Glad it’s working for you and we’ll add Jasmine soon, promise.
This is exactly why we wrote Whirlwind! It can run multiple anything (not just Chimp) against anything (Not just Meteor)! We’ve used it to bring a build on CI from 1.5 hours to 12 minutes
Under the hood we’re using plain old Mocha so I don’t see why not. I guess we just need a mechanism to allow people to control Mocha at a raw level through Chimp so advanced users such as yourself can get more freedom.
Though I would love to see how you got it working on CI services, I haven’t had much luck yet. But on my local machine it’s been much easier to work with and nicer to use, it actually made it much easier to figure out why one of my tests were failing as well.
To get it working on CI, you need to write a script that will start a Meteor app then launch Chimp. We do need a sample project out there that with a circle/travis config that you can copy and roll with. I’ll get onto that and post back here.
That’s cool, thanks. All I needed was the prod to the idea of starting it with a script.
I also assume that Whirlwind works properly with CircleCI’s parallelism so there’s nothing I would need extra on that is there? I took a glance and it seems like something useful to set up while I have vacation rather than as I wait for tests to build in the future.
Those are great suggestions. Let me find some time in the next few days and I will do exactly that.
We actually use Chimp with React on our app and we go below the UI by doing things like
// this is in the test context (Mocha/Cucumber)
client.execute(widgets.myComponent.doSomething);
which is referring to a widget library that we have that looks something like this:
widgets.myComponent = {
doSomething : function() {
// this is the client context so we can bypass going through the UI and
// access the components directly to get them to doSomething
}
}
I’m looking at various acceptance test frameworks and like the looks of Chimp, but I’ve noticed that in your docs you state that the widgets API doesn’t user fibers yet for synchronous calls and should be updated soon. Looking at the chimp-widgets GitHub issues, it looks like it may be done. Is this just a case of outdated docs? If so do you have an example of updated docs that include the synchronous widgets API?