Poltergeist Stripe checkout.js

后端 未结 2 1330
旧时难觅i
旧时难觅i 2021-02-09 07:29

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

相关标签:
2条回答
  • 2021-02-09 08:02

    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
    
    0 讨论(0)
  • 2021-02-09 08:03

    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.

    0 讨论(0)
提交回复
热议问题