Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/file/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 如何使用Cypress上传txt文件?_Javascript_File_Automation_Cypress - Fatal编程技术网

Javascript 如何使用Cypress上传txt文件?

Javascript 如何使用Cypress上传txt文件?,javascript,file,automation,cypress,Javascript,File,Automation,Cypress,我无法使用cypress上传txt文件,测试通过了,但文件不会上传。我正在使用cypress文件上传插件。我的文件在fixtures文件夹中 这是html代码片段 这是我的功能: 您是否使用type=“file”的输入标记?如果没有,试试看。因此,与其这样做 cy.get('.col-xs-12 > .btn') 你可以试试 cy.get('#id-of-input-tag') 没有输入标记,按钮的html代码是:更正,它存在,只是被隐藏。

我无法使用cypress上传txt文件,测试通过了,但文件不会上传。我正在使用cypress文件上传插件。我的文件在fixtures文件夹中

这是html代码片段

这是我的功能:


您是否使用
type=“file”
输入标记?如果没有,试试看。因此,与其这样做

cy.get('.col-xs-12 > .btn')
你可以试试

cy.get('#id-of-input-tag')

没有输入标记,按钮的html代码是:更正,它存在,只是被隐藏。