I\'m trying to test in my Rails app the Stripe checkout popup (http://www.stripe.com/checkout).
I was using Capybara + selenium-driver and everything worked well. When t
If you have a similar issue with phantomjs 1.9.7
, it's because of the SSL settings. You can disable checking using:
Capybara.register_driver :poltergeist do |app|
options = {
phantomjs_options: ['--ssl-protocol=any', '--ignore-ssl-errors=yes'],
inspector: false
}
Capybara::Poltergeist::Driver.new(app, options)
end
For anybody interested, I found a way to access the iframe without using 'within_frame', just by using the Poltergeist switch window method.
stripe = page.driver.window_handles.last
page.within_window stripe do
fill_in "Name", :with => "Name"
fill_in "Street", :with => "Street"
fill_in "Postal", :with => 10000
fill_in "City", :with => "Berlin"
click_button "Payment Info"
end
For spanish people, I found the solution here: numerica latina.