Cucumber + testing JS alert

前端 未结 5 565
失恋的感觉
失恋的感觉 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条回答
  •  星月不相逢
    2021-02-04 07:20

    I would recommend using screw-unit for testing javascript behavior on a page. You can also take a look at Relevance's blue-ridge plugin which incorporates screw-unit and adds support for command line and in browser js testing. You can find it on github under relevance/blue-ridge. (I don't have the rep yet to post more than one link :(

    It would be an interesting exercise to use screw-unit and/or blue-ridge to drive cucumber tests, and probably not that hard to pull off.

提交回复
热议问题