Tag: 恶作剧

Poltergeist Stripe checkout.js

我正在尝试在我的Rails应用程序中测试Stripe checkout弹出窗口( http://www.stripe.com/checkout )。 我正在使用Capybara + selenium-driver,一切运转良好。 加载页面后,checkout.js会添加一个iframe,我可以访问它 within_frame(‘stripe_checkout_app’) do do something end 现在,切换到Poltergeist,我收到此错误: 失败/错误:within_frame(’stripe_checkout_app’)执行Capybara :: Poltergeist :: FrameNotFound:找不到框架’stripe_checkout_app’。 如果我检查页面,就没有iframe。 所以我认为这个脚本 我用Poltergeist运行测试时没有加载。 更新 我尝试用Capybara-webkit运行测试,结果相同。 Failure/Error: Capybara.within_frame(‘stripe_checkout_app’) do Capybara::Webkit::InvalidResponseError: Unable to locate frame. 我也试着等了半分钟! 同 sleep 30 这些是我的webmock设置: RSpec.configure { |config| WebMock.disable_net_connect!(allow_localhost: true) } 更新2: ‘stripe_checkout_app’是iframe的名称。