提交 1c4929b2 编写于 作者: W WOSHIMAHAIFENG

修改file测试用例超时问题

上级 aeb77f2e
...@@ -1156,7 +1156,7 @@ describe('ExtApi-FileManagerTest', () => { ...@@ -1156,7 +1156,7 @@ describe('ExtApi-FileManagerTest', () => {
return return
} }
console.log('start saveFileSyncTest')
let globalTempPath = await getData('globalTempPath') let globalTempPath = await getData('globalTempPath')
let basePath = await getData('basePath') let basePath = await getData('basePath')
await page.setData({ await page.setData({
...@@ -1164,6 +1164,7 @@ describe('ExtApi-FileManagerTest', () => { ...@@ -1164,6 +1164,7 @@ describe('ExtApi-FileManagerTest', () => {
basePath: basePath basePath: basePath
}) })
await clearDir('') await clearDir('')
console.log('end saveFileSyncTest1')
await page.setData({ await page.setData({
logAble: false, logAble: false,
basePath: globalTempPath, basePath: globalTempPath,
...@@ -1173,22 +1174,26 @@ describe('ExtApi-FileManagerTest', () => { ...@@ -1173,22 +1174,26 @@ describe('ExtApi-FileManagerTest', () => {
accessFile: '2.txt' accessFile: '2.txt'
}) })
await createFile() await createFile()
console.log('end saveFileSyncTest2')
await page.setData({ await page.setData({
basePath: basePath, basePath: basePath,
writeFile: 'save/2.txt', writeFile: 'save/2.txt',
}) })
btnSaveFile = await page.$('#btn-save-file-sync') btnSaveFile = await page.$('#btn-save-file-sync')
await btnSaveFile.tap() await btnSaveFile.tap()
console.log('end saveFileSyncTest3')
let btnRemoveSavedFileRet = await page.$('#btn-remove-saved-file') let btnRemoveSavedFileRet = await page.$('#btn-remove-saved-file')
await btnRemoveSavedFileRet.tap() await btnRemoveSavedFileRet.tap()
await isDone()
console.log('end saveFileSyncTest4')
let removeSavedFileRet = await getData("removeSavedFileRet") let removeSavedFileRet = await getData("removeSavedFileRet")
expect(removeSavedFileRet).toEqual('removeSavedFile:ok') expect(removeSavedFileRet).toEqual('removeSavedFile:ok')
await isDone()
await page.setData({ await page.setData({
removeSavedFileRet: '' removeSavedFileRet: ''
}) })
await clearDir('') await clearDir('')
console.log('end saveFileSyncTest')
}); });
it('getSavedFileListTest', it('getSavedFileListTest',
...@@ -1224,8 +1229,8 @@ describe('ExtApi-FileManagerTest', () => { ...@@ -1224,8 +1229,8 @@ describe('ExtApi-FileManagerTest', () => {
let btnSavedFileList = await page.$('#btn-getsaved-filelist') let btnSavedFileList = await page.$('#btn-getsaved-filelist')
await btnSavedFileList.tap() await btnSavedFileList.tap()
await isDone() await isDone()
let fileListSuccess = await getData("fileListSuccess") let fileListSuccess = await getData("getSavedFileListRet")
expect(fileListSuccess.length > 0).toEqual(true) expect(fileListSuccess).toEqual('getSavedFileList:ok')
await clearDir('') await clearDir('')
}); });
......
...@@ -135,6 +135,7 @@ ...@@ -135,6 +135,7 @@
fstat: new Stats(), fstat: new Stats(),
ftruncateRet: '', ftruncateRet: '',
readZipFile: 'to.zip', readZipFile: 'to.zip',
getSavedFileListRet:'',
/** /**
* 待测试的全局环境变量 * 待测试的全局环境变量
*/ */
...@@ -812,6 +813,7 @@ ...@@ -812,6 +813,7 @@
} }
console.log("getSavedFileListTest success", res) console.log("getSavedFileListTest success", res)
this.fileListSuccess = res.fileList this.fileListSuccess = res.fileList
this.getSavedFileListRet = "getSavedFileList:ok"
}, },
fail: (res : UniError) => { fail: (res : UniError) => {
if (this.logAble) { if (this.logAble) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册