Backport part of 5347394c20d47050034b59050c8e9402f2434434 #200

Closed
wants to merge 1 commit into
from

Conversation

Projects
None yet
5 participants

Hello,

This is a backport from master for a bug that happens also on the Rails 2.x version, 0.3.2.

With this patch you might consider releasing 0.3.3.

bráulio

Owner

aslakhellesoy commented May 7, 2012

If I understand correctly this would break cucumber-rails so it no longer works with the current Capybara (1.1.2).

Please request this to be re-opened if you think I'm mistaken.

Contributor

nruth commented May 7, 2012

It's intended for the rails 2 compatible release, which it'd be nice to have a branch for, as people still need to maintain those apps and run those tests.

The locked down gem versions on the wiki don't actually work at present (for the app I'm working on, at least), due to the capybara javascript emulation, which uses the old capybara api & crashes the whole test run. This patch is attempting to fix that.

It doesn't seem to work for me. I get a new error:
I've removed the emulation require from support/env.rb and put this patched code into a support file; I get a new error

undefined local variable or method `node' for #<Capybara::RackTest::Node:0x5019d20> (NameError)
in `link_with_non_get_http_method?'

I'm using cucumber-rails 0.3.2, cucumber 1.1.9, capybara 1.1.1, REE 1.8.7 (and bundler) on Ubuntu.
I've loaded the new code by removing the old emulation require from env.rb (which I had to do to make the tests run at all) then add the patched code as a support file.

aslakhellesoy reopened this May 7, 2012

Owner

aslakhellesoy commented May 7, 2012

Oh I see. So this would be for a cucumber-rails 0.3.3 release?

Contributor

nruth commented May 7, 2012

Yes that's right.

I'll defer to others on whether it works, as I don't have a clean test setup and I've switched the scenarios I needed it for to run with selenium.

Another good solution that I think should be with 0.3.3 is to remove the
require 'cucumber/rails/capybara_javascript_emulation'
from the features/support/env.rb generator.

Removing this also solves the problem.

Contributor

nruth commented May 8, 2012

There are two problems as I see it, one is the generator and the other is existing test suites.

The generator can easily be fixed by removing the require as suggested. Does anyone make new apps with these old versions though?

For me, the real problem is people with existing suites (doing maintenance work on old projects) looking to run their old test suite. It'd be great if they were fully locked down, but bundler wasn't around back then (and requires gem/rails updates), and selenium is dependent on Firefox which updates frequently & requires selenium-webdriver / Capybara updates. I found updating versions tricky, and none of the prescribed version combinations worked with js emulation.

It'd be great if someone fixes it, but given that things have moved on it seems unlikely. A work-around is to use a real javascript driver for these javascript tests. Switching scenarios to selenium is a bit of a pain, but works, so I added a note to the rails 2 installation section on the wiki about it.

@brauliobo it might sound like a strange question, but have you been able to run tests using your patch? Which gem versions do you use? I'm interested whether it's just me that it's not working for.

Vanuan referenced this pull request May 16, 2012

Closed

Cucumber rails2 v0.3.3 #213

Vanuan commented May 16, 2012

@nruth I also had the mentioned error.
To solve it I had to cherry-pick yet another commit: 68044f4 (Fix click_link fails with Capybara >= 0.4.0)
Try my branch #213, please.

@nruth yeah, I was able to run some tests, but then I had to change env.rb like I said. this pull request doesn't fix this last one

Owner

aslakhellesoy commented Feb 27, 2013

I'm not sure which one is best, this PR or #213?

Member

Kosmas commented Feb 5, 2014

Closing old issues. If they are still relevant, please reopen

Member

Kosmas commented Feb 5, 2014

Closing old issues. If they are still relevant, please reopen

Kosmas closed this Feb 5, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment