在cucumber/ruby中使用selenium-webdriver时,有没有方法可以确认文件的下载过程?
在运行headless时,我使用了一个简单的rspec-expectation expect(response_headers['Content-Disposition']).to include("attachment;filename#{pdf_filename}")
当我在Selenium (Chrome)中运行时,这不再起作用。我得到了错误:
Capybara::NotSupportedByDriverError: Capybara::Driver::Base#response_headers在通过Selenium运行时,有什么方法可以实现这一点吗?
发布于 2016-09-09 21:22:12
您可以检查下载目录中是否存在您期望的文件:
File.exists? "/Users/mesutgunes/Downloads/#{pdf_filename}"https://stackoverflow.com/questions/39392037
复制相似问题