linemanjs / lineman

Lineman helps you build fat-client JavaScript apps. It produces happiness by building assets, mocking servers, running specs on every file change
MIT License
1.18k stars 81 forks source link

Implement CasperJS as Lineman's preferred "e2e" integration test tool #167

Closed searls closed 10 years ago

searls commented 10 years ago

I've played around with a bunch of solutions and I think CasperJS is the least terrible I've found so far. Here are my thoughts on what I'd like to do:

  1. Add a testem adapter for Casper to use the testem runner nicely
  2. Make jasmine-given adaptable such that we can provide a casper-given for users to use normal Given test syntax with casper's test API
  3. Include a casper suite in the Lineman archetype.

I've spiked step 1 a little and I've spent a lot of time planning and prepping for step 2.

Thoughts? If there's something better than Casper for headless driver browsing, speak now!

theotherzach commented 10 years ago

Somewhat related for JSON endpoint testing.

http://frisbyjs.com/

Beyond that, your summary of Casper lines up with what I've heard.

uris77 commented 10 years ago

I tried casperjs some months ago, and even though it was easy to start once we tried to do anything slightly complicated it failed. For example, you can't reuse anything. We wanted to have a definition of our page and just re-use that throughout our tests and we couldn't do that. We had to rewrite the same piece of code over and over. I've started to hear good things about nightwatchjs but haven't tried it. We have been using Geb (in the jvm) but there is too much context switch and we can't really integrate it with our grunt build. So still searching.... For angular, protractor also looks interesting.

searls commented 10 years ago
  1. Agree that Casper's not great.
  2. I have not had positive experiences with protractor, and I also fundamentally believe that integration testing should be done without any coupling to the client-side app framework.
  3. I've had pretty good experiences with node-webdriver-sync for testing Lineman itself, I think that + grunt-jasmine-bundle is currently the leading contender for preferred full-stack test tool.

On Tue, Feb 11, 2014 at 4:57 PM, Roberto Guerra notifications@github.comwrote:

I tried casperjs some months ago, and even though it was easy to start once we tried to do anything slightly complicated it failed. For example, you can't reuse anything. We wanted to have a definition of our page and just re-use that throughout our tests and we couldn't do that. We had to rewrite the same piece of code over and over. I've started to hear good things about nightwatchjs but haven't tried it. We have been using Geb (in the jvm) but there is too much context switch and we can't really integrate it with our grunt build. So still searching.... For angular, protractor also looks interesting.

Reply to this email directly or view it on GitHubhttps://github.com/linemanjs/lineman/issues/167#issuecomment-34812961 .

searls commented 10 years ago

Closing this. Current plan is to implement a e2e test support as a plugin and to do it in a framework-agnostic way with (webdriver-sync)

jcalfee commented 10 years ago

https://www.npmjs.org/package/lineman-spec-browser

searls commented 10 years ago

Yep!