问题描述
我正在自动执行数据捕获表单。 此表单的第一个元素是图像文件上传控件,我正在上传5KB图像。 但是在此步骤之后,测试将执行下一步,即将文本写入文本框,然后将其暂停近30秒。 如何减少这种不必要的等待?
test('Test 1',async t => {
await listingPage.uploadImage();
await listingPage.listAnItem();
..
上传图片代码
async uploadImage() {
await t.setFilesToUpload(this.imageInput,['../../uploads/photo02.jpg']);
}
**数据输入代码块**
async listAnItem() {
await t
.typeText(Selector('#description'),this.DESCRIPTION) /* --> Application is slowing after this step */
.click(this.categorySelect)
.click(Selector('#react-select-2-option-0-0'))
.testcaferc.json文件
{
"browsers": [ "chrome","safari" ],"remoteChromeVersion": "80","src": "specs","reporter": [
{
"name": "spec"
}
],"speed": 1,"debugOnFail": false,"skipJsErrors": true,"selectorTimeout": 20000,"assertionTimeout": 20000,"pageLoadTimeout": 8000
}
文件上传的DOM代码段
<input aria-describedby="error__images" aria-label="Upload an image" tabindex="0" type="file" multiple="" accept="image/jpeg,image/png" data-testid="imageInput" class="ImageInputstyles__Input-sc-2l692w-7 aosWu">
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)