如何编写下载文件的测试,并以表格形式发布。
it "should support download and upload a file", ->
upload = element(By.id 'UploadInput');
upload.sendKeys 'C:\\path\\to\\file\\file.txt'
目前上传工作正常,但我如何下载文件并获取它的路径?
答案 0 :(得分:2)
通过将文件添加到项目来解决它并得到如下的绝对路径:
it "should support download and upload a file", ->
upload = element(By.id 'UploadInput');
upload.sendKeys path.resolve(__dirname, '../../assets/file.txt')