-
Notifications
You must be signed in to change notification settings - Fork 168
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
can't load stripe.js when running tests with capybara-webkit on linux #60
Comments
Oh and with a pry session open just before the test fails, if I can run uri = URI.parse('https://js.stripe.com/v1/')
Net::HTTP.get_print(uri) and it definitely gets the content from stripe. |
further proof that the browser can't get to https://js.stripe.com/v1/. strange... page.evaluate_script %(
$.get( "https://js.stripe.com/v1/" )
.fail(function( jqXHR, textStatus, errorThrown ) {
console.log(JSON.stringify(jqXHR))
console.log(textStatus)
console.log(errorThrown)
})
)
page.driver.console_messages
# => [{:message=> "{\"readyState\":0,\"responseText\":\"\",\"status\":0,\"statusText\":\"error\"}"}, {:message=>"error"}, {:message=>""}] |
Everything works fine when you're not using the |
Indeed. John Gesimondo |
Anything in the puffing-billy logs during page load? |
OOo is there a separate log for billy? On Tuesday, July 22, 2014, ronwsmith [email protected] wrote:
John Gesimondo |
It uses your Rails.logger (or STDOUT without Rails). You can see a sample line here. Do something along the lines of |
When I try to ajax get google.com, I get this in the logs:
When I ajax get https://js.stripe.com/v1/ nothing appears in the logs. |
FWIW not a single log item is https. And when I try to get https://google.com, the same thing happens. Nothing in the logs and jquery hits the error callback. |
Made a new driver: Capybara.register_driver :webkit2_billy do |app|
driver = Capybara::Webkit::Driver.new(app)
driver.browser.set_proxy(:host => Billy.proxy.host,
:port => Billy.proxy.port)
driver.browser.ignore_ssl_errors
driver.enable_logging # same thing webkit-debug driver uses
driver
end This is very helpful. Here's some stuff from the webkit logs:
Here it is without the proxy:
|
Interesting find, I'm betting it's an issue here. Can you add some logging to see what |
yep trying now. thanks so much for the help. |
This method does not get called for the https requests on the affected machine. It does get called on my mac. |
So it might be a different |
Sorry should have been more specific. on_message_complete isn't being called at all on the non Mac for https requests |
That sounds like an issue with EventMachine as it's what calls that method on callback. |
Could the browser be dropping the connection before completion (because of the self-signed cert)? Are there other EventMachine callbacks we could hook into there? |
Seems like the browser is doing something with the connections. I tried hooking into many parts of
Though I do have that log item Not sure what to try next. Suggestions? |
I'm having this problem now too. I just put a ton of work into getting puffing-billy working and now it won't work on CircleCI. It doesn't look like a solution was found here. How can I help move this along? |
I've wasted two more days on this. Sometimes things work, and then some minor thing changes and they fail again. Here's my console output: This only seems to happen SOME of the time. Sometimes it works! Minor HTML changes on the page are the difference between it working or not. It's pretty messed up and I don't see why that would happen. I verified that switching from :webkit_billy to :webkit for the driver removes the problem, and I'm going to have to leave it like that. I still would love to use puffing-billy and to help support the project. Please let me know what I can do to diagnose and fix this issue. |
I reduced this down to a simple test case where I include stripe, then try to set the public key. I check the console for errors and get an error, but only on Circle. Locally it works fine.
Overall, this really seems like an issue with capybara-webkit or webkit. I tried looking and could not find any related issues for either project. If this has been around since July, there should have been a bug filed /somewhere/. I don't have enough information right now to open an issue on either project, though. @ronwsmith / @oesmith Do you have any suggestions for what I can dig into so I can get enough information to narrow it down and file a bug in the right place? EDIT: Put together a sample project that demonstrates this issue. https://github.com/bmulholland/debug-puffing-billy-stripe |
FYI - as solved in thoughtbot/capybara-webkit#679, this bug is ultimately caused by QTBUG-25542, which is present on Qt 4.8.1. To fix this, upgrade to a Qt version > 4.8.1 (4.8.6 is confirmed working). |
Great, thanks for the update @bmulholland! Can we close this issue as well then? Edit: Just realized you weren't the reporter -- @jmondo, please verify this fixes your issue. |
@ronwsmith My 2 cents is that you can close this :) |
Closing, fixed in capybara-webkit. |
Hey everyone,
I love puffing-billy! But I'm having a pretty critical problem. I am doing an end to end test and on the checkout page, we load stripe from js.stripe.com like so:
We then of course use that library to get a payment token.
When I run the test on my mac, the payment succeeds and the test passes. on ubuntu (and circle CI) however, it does not. The test fails and stripe (ruby) renders:
Turns out that is because the Stripe (js) library isn't loaded and therefore my server is receiving an empty
stripe_card_token
.To confirm: If I interrupt the test and I run
page.driver.console_messages
I get:But this only happens on linux! Not sure what's up. Happy to post whatever info you need. I am running ubuntu 12.04, I am not using the caching feature of puffing-billy, and I have WebMock installed but it is set to
allow_net_connect!
Let me know if you have any ideas or debugging steps.
The text was updated successfully, but these errors were encountered: