cucumber test file download

后端 未结 5 1271
渐次进展
渐次进展 2020-12-10 02:32

Anybody have idea how to test file download using cucumber?

5条回答
  •  孤街浪徒
    2020-12-10 03:07

    I run selenium through chrome, when I'm testing that the csv has downloaded, I use the following in Ruby:

    Then /^I should get a downloaded file for fleet: "(.*?)"$/ do |export|       
        puts Dir["C:/Users/**/Downloads/fleet_#{export}_export_all_*.csv"].last
    end
    

    It simply looks in the default download directory and confirms that the file is there and outputs the filename within cmd.

提交回复
热议问题