开发者

How to test File Download dialog box using cucumber/capybara

I searched around and couldn't find how t开发者_如何学JAVAo test a file download box using capybara/cucumber?

The following image asks the question much clearer.


How to test File Download dialog box using cucumber/capybara


This was similar to another question I just answered, hope it helps Anybody have idea how to test file download using cucumber?


@Millisami Capybara::NotSupportedByDriverError Fixed for me!

What i had to do is removing the @javascript tag from my cucumber test, which was included. I mean:

@search Scenario: Recieving a file ...

instead of

@search @javascript
Scenario: Recieving a file ...

Hope it helps :-)


The download box is a function of the browser. Capybara simulates a browser but without all the UI etc.. (e.g. it looks like a browser to your application, so using it you'd mostly skip over the whole file download UI stuff. It would look to the browser like someone did whatever they needed to in order to tell the browser where to put the file and start the download)

If you are trying to test a download box, (beyond clicks needed to start the download) you are now testing the browser, not your application. As yourself if that's part of your charter and worth your time.

To actually test the download box you are going to have to have a browser instance going, and use a tool like Firewatir/Watir or Selenium, to actually 'drive' the browser, and some other gem to actually automate up at the OS UI level (on windows we usually use autoit) in order to click things and fill in values of the browser's file download UI.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜