Poltergeist Stripe checkout.js

后端 未结 2 1329
旧时难觅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条回答
  •  闹比i
    闹比i (楼主)
    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.

提交回复
热议问题