だから私はシナリオを持っています:
Given I signed in to my business account
And there is one customer named "Samantha Seeley"
When I go to the customers management page
Then "Delete" should show a confirmation dialog saying "Are you sure?"
リンクは単純です:
<%= link_to 'Delete' customer_path(customer), method: :delete, confirm: 'Are you sure?' do %>
したがって、このコードでは、Chromeでリンクをクリックすると確認ダイアログが表示されますが、ページレンダリングを使用すると次のようになります。
Then /^"(.*?)" should show a confirmation dialog saying "(.*?)"$/ do |arg1, arg2|
click_on arg1
page.driver.render "tmp/screenshot.jpg"
end
スクリーンショットから、JavaScriptが評価されていないように見える(確認ダイアログが表示されていない)ことを確認できると思います。しかし、この仮定は間違っているかもしれませんが、私にはわかりません。
ご協力いただきありがとうございます。