javascript - 自动文件上传
问题描述
我尝试将文件自动上传到正在处理的项目,但文件名在字段中显示为已上传,但实际上并不是因为提交按钮仍然被禁用,但是当我手动上传时,上传按钮将是可点击的。
describe('Upload Test', function () {
it('Upload Test', function () {
cy.visit('http://localhost:4200')
cy.get('#version-no').type('4')
cy.get('#version-notes').type('test notes ')
const test_upload = "../fixtures/example.csv";
cy.get('#file')
.attachFile(test_upload)
cy.get('#file')
.its('0.files')
.its('0')
.its('name')
.should('eq', 'example.csv')
cy.get('#file')
.trigger('change', { force: true })
cy.get('#file')
.trigger('fileuploadsubmit', { force: true })
cy.get('[data-cy=Submit_Catalogue]').click({ force: true },'center')
})
})
这是 HTML
解决方案
推荐阅读
- azure - 在 Azure 上的免费层上部署 Java 应用程序时出错
- swift - 枚举具有关联值的枚举 - Swift
- gradle - 什么是 Gradle 依赖配置?
- ios - 谷歌地图正在快速显示带有标记的普通页面
- android - 无法取消在 kotlin 中定义的警报
- javascript - 使用 js 或 jquery 更改 inputfile 的图像值
- javascript - 引导箱中的 Href 按钮
- laravel - 如何在 laravel 中获取 hasMany 关系?
- javascript - Vue FullCalendar,设置点击事件
- javascript - 大尺寸视频在 ipad 中不自动播放