-
Notifications
You must be signed in to change notification settings - Fork 130
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
FakeWeb stops @javascript (capybara & selenium) cukes from running. #25
Comments
same on my side but with a timeout::Error ;( |
Somehow, Artifice does the job of removing itself when deactivated much better. As cool as Artifice is, it's a bit outdated compared to FakeWeb or WebMock, and it would be nice to have the option to switch, at least. I wonder if it's possible to do like Artifice does and save the original version of Net::HTTP in a constant and simply swap it in when FakeWeb is deactivated. |
+1 on the timeout issue, mine is with capybara and selenium.. seems to be random. |
+1 for the Timeout::Error (capybara & selenium) |
+1 capybara 1.0.0 |
Ditto, I'm seeing the same behavior. FWIW, I can specify :require => false on fakeweb in Bundler and then the problem goes away. |
I guess the whole point for us was to make sure our cucumber scenarios didn't hit outside sources, so even when I added :require => false, I'd still have to include it somewhere in order to block external calls. And we even tried only enabling it for non @javascript cukes, but just the same, I think it messed with Net::HTTP enough to make the selenium tests hang indefinitely. |
I actually want my cucumber scenarios to hit outside resources, which is why my solution worked for me. :-) |
Fair enough :) |
Yup facing the same problem, it tooks me 3 hour that the error related to fake web -_- |
+1 |
1 similar comment
+1 |
http://ahmy.yulrizka.com/2011/08/cucumber-timeouterror-timeouterror-on-fakeweb/ The sollution for me is add :require => false to the Gemfile gem 'fakeweb', :require => false and only require fakeweb on rspec by including it on spec/spec_helper.rb require 'fakeweb' |
Yeah, I think that's what most of us have done so far, but the whole point was to not let cucumber hit outside sources. See my earlier comment here. |
Interestingly enough, on that link you posted, a commenter said this:
If that's the case, I'll probably use WebMock. But it would be cool if FakeWeb could adopt the changes which fixed that. (If it really is fixed for WebMock, that is.) |
@sfsekaran I switched to webmock and work fine. |
Good to know, thanks! |
This is a big issue. Is the recommendation just to switch to WebMock, or will this be fixed at some point? |
+1 |
I found a decent solution was to allow Selenium requests in all specs: selenium_requests = %r{/((__.+__)|(hub/session.*))$}
FakeWeb.allow_net_connect = selenium_requests It's unlikely that other requests would match that expression, but you might be able to make it more restrictive if you were to find such a beast. |
/cc @jsanders |
The selenium requests solution by @jamesarosen didn't work for me. Switched to webmock and everything is great. I only need it for VCR anyhow, so it was no hassle. |
fakeweb 1.3.0
cucumber-rails 0.3.2
capybara 0.4.1.1
When I allow Bundler to require the fakeweb gem, any of the @javascript cukes will hang at certain (seemingly random) steps. Some steps just hang for a long time and then continue. I'm not sure what the catalyst is, but it's really disappointing. I really want to move from Artifice to FakeWeb or WebMock, but both gems do the same thing to our selenium scenarios.
I wonder if anyone else has run into this.
This is the stacktrace when I Ctrl-c after it hangs indefinitely:
The text was updated successfully, but these errors were encountered: