所以我有一个场景:
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(没有显示确认对话框)。不过,这个假设可能是错误的,我不确定。
谢谢你的帮助。