Is there a capybara for Node.js?

Does anyone know whether there is anything similar to capybara for Node.js?

Answers


How about Zombie?

Zombie.js

Insanely fast, headless full-stack testing using Node.js

The Bite

If you're going to write an insanely fast, headless browser, how can you not call it Zombie Zombie it is.

Zombie.js is a lightweight framework for testing client-side JavaScript code in a simulated environment. No browser required.


Cucumber-JS is the closest you will get in Javascript: https://github.com/cucumber/cucumber-js

You can use the library to drive JS, headless and Selenium, however it is missing the 'capybara' shared API between each of the different 'worlds'. There is a good talk at http://skillsmatter.com/podcast/agile-testing/cucumber-js-cuke-up-your-javascript and supporting github code at https://github.com/jbpros/cukecipes

I'm hoping that when the phantomjs webdriver wire protocol is finished (https://github.com/detro/ghostdriver) and if Soda/Selenium (https://github.com/LearnBoost/soda) is able to drive it then the headless tests will be able to be automated via Selenium thus bypassing the need for Capybara.


I'm a rails-turned-node developer and I've always been looking for a analogy in the JS world for the winning RSpec/Capybara combination. Here is what I've found what I like best.

  • Mocha - for running asynchronous tests
  • Chai - for assertions
  • Request - for handling HTTP request/response
  • Cheerio - for selecting HTML elements from responses

Here is a more involved post on how to set up this stack including continuous test running.

Happy Testing!


See jelly.io:

Jellyfish is a Node project that aims to make it easy to launch different JavaScript environments and run your code.


Hy!

I've created a library to help out with cucumber-js. It gives you callable steps and parsed arguments. This works with cucumber and doesn't replace it.

Quick features:

  • Sync step definitions, no more callbacks;
  • Call other step from step definitions;
  • Parse values such as arrays, objects and decimals;

https://github.com/hackhat/cucumberry

Hope you find it useful (:


We created a complete acceptance testing solution in JS

http://xolv.io/products/chimp

It uses CucumberJS (Mocha/Jasmine soon) to drive your acceptance tests

  • Downloads and starts Phantom / Selenium
  • Injects a preconfigured Webdriver.IO instance into the testing context
  • Includes the request npm library (for REST) the assertion library of your choice (Chai / Jasmine-expect)
  • Uses fibers for synchronous testing (no callback hell / promise confusion)
  • Works with SauceLabs / BrowserStacks etc
  • Support outside in testing with a watch mode that continuously runs the scenarios you tag with @focus
  • Supports CI out of the box and tested on Circle/Codeship/Travis (using headless Chrome/Firefox)

It doesn't make you coffee, yet


Yes, see expresso and more here - Unit testing framework for node.js that specifically supports testing async code?


Need Your Help

How to create a dynamic file + link for download in Javascript?

javascript file dynamic download creation

Typically, HTML pages can have link to documents (PDF, etc...) which can be downloaded from the server.

Possible to set singleton back to nil?

ios singleton null

I have implemented a singleton object using the regular pattern. My question is: is it possible to set this object back to nil, so that on a later called to [MySingleton sharedInstance] the object ...