Cucumber + testing JS alert

前端 未结 5 618
失恋的感觉
失恋的感觉 2021-02-04 07:05

I\'m trying to test a JS confirmation dialog with Cucumber on Rails. I have a window.onbeforeunload event handler that will prompt you with a confirmation dialog if you try to n

5条回答
  •  Happy的楠姐
    2021-02-04 07:36

    This gist has steps to test a JS confirm dialog in Rails 2 and 3 with any Capybara driver, should be easy to adapt to an alert box.

提交回复
热议问题