【发布时间】:2018-09-24 17:20:02
【问题描述】:
我的测试设置是 Rspec + Capybara 和 Poltergeist / Phantomjs。
我正在尝试测试 Paypal express 沙盒 - 有时测试通过,有时不通过。看起来是时间问题。
这是我的测试 sn-p 重定向到 Paypal 并成功返回我的页面。我在沙盒帐户上使用我的信用,所以没有信用卡处理...
有人对此有可行的设置或有任何建议吗?
# confirm order and proceed / redirect to paypal
find('button#booking-button').click
using_wait_time(60) do
# login on paypal express sandbox page
within_frame(find('iframe')) do
fill_in 'email', with: Rails.application.secrets.paypal_test_user_email
fill_in 'password', with: Rails.application.secrets.paypal_test_user_password
find('button#btnLogin').click
end
using_wait_time(60) do
# confirm payment and redirect back to my page
find('input#confirmButtonTop').click
using_wait_time(60) do
# check if element on my page exists
expect(page).to have_selector('div#checkout-thank-you')
end
end
end
【问题讨论】:
-
添加您收到的确切错误消息并确定它来自哪一行
-
还有——
using_wait_time为块内的每个水豚动作设置默认的最大等待时间,所以嵌套多个using_wait_time(60)s没有意义。
标签: ruby-on-rails paypal rspec capybara circleci