From 1c4929b294e77dee5280be3866b92a3c11d8f3d0 Mon Sep 17 00:00:00 2001 From: WOSHIMAHAIFENG Date: Wed, 17 Apr 2024 16:39:03 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9file=E6=B5=8B=E8=AF=95?= =?UTF-8?q?=E7=94=A8=E4=BE=8B=E8=B6=85=E6=97=B6=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../get-file-system-manager.test.js | 15 ++++++++++----- .../get-file-system-manager.uvue | 2 ++ 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/pages/API/get-file-system-manager/get-file-system-manager.test.js b/pages/API/get-file-system-manager/get-file-system-manager.test.js index 7870ea3f..8c92a1e3 100644 --- a/pages/API/get-file-system-manager/get-file-system-manager.test.js +++ b/pages/API/get-file-system-manager/get-file-system-manager.test.js @@ -1156,7 +1156,7 @@ describe('ExtApi-FileManagerTest', () => { return } - + console.log('start saveFileSyncTest') let globalTempPath = await getData('globalTempPath') let basePath = await getData('basePath') await page.setData({ @@ -1164,6 +1164,7 @@ describe('ExtApi-FileManagerTest', () => { basePath: basePath }) await clearDir('') + console.log('end saveFileSyncTest1') await page.setData({ logAble: false, basePath: globalTempPath, @@ -1173,22 +1174,26 @@ describe('ExtApi-FileManagerTest', () => { accessFile: '2.txt' }) await createFile() + console.log('end saveFileSyncTest2') await page.setData({ basePath: basePath, writeFile: 'save/2.txt', }) btnSaveFile = await page.$('#btn-save-file-sync') await btnSaveFile.tap() - + console.log('end saveFileSyncTest3') let btnRemoveSavedFileRet = await page.$('#btn-remove-saved-file') await btnRemoveSavedFileRet.tap() + await isDone() + console.log('end saveFileSyncTest4') + let removeSavedFileRet = await getData("removeSavedFileRet") expect(removeSavedFileRet).toEqual('removeSavedFile:ok') - await isDone() await page.setData({ removeSavedFileRet: '' }) await clearDir('') + console.log('end saveFileSyncTest') }); it('getSavedFileListTest', @@ -1224,8 +1229,8 @@ describe('ExtApi-FileManagerTest', () => { let btnSavedFileList = await page.$('#btn-getsaved-filelist') await btnSavedFileList.tap() await isDone() - let fileListSuccess = await getData("fileListSuccess") - expect(fileListSuccess.length > 0).toEqual(true) + let fileListSuccess = await getData("getSavedFileListRet") + expect(fileListSuccess).toEqual('getSavedFileList:ok') await clearDir('') }); diff --git a/pages/API/get-file-system-manager/get-file-system-manager.uvue b/pages/API/get-file-system-manager/get-file-system-manager.uvue index a09ce29d..cd3465e8 100644 --- a/pages/API/get-file-system-manager/get-file-system-manager.uvue +++ b/pages/API/get-file-system-manager/get-file-system-manager.uvue @@ -135,6 +135,7 @@ fstat: new Stats(), ftruncateRet: '', readZipFile: 'to.zip', + getSavedFileListRet:'', /** * 待测试的全局环境变量 */ @@ -812,6 +813,7 @@ } console.log("getSavedFileListTest success", res) this.fileListSuccess = res.fileList + this.getSavedFileListRet = "getSavedFileList:ok" }, fail: (res : UniError) => { if (this.logAble) { -- GitLab