提交 f8a46ff1 编写于 作者: 杜庆泉's avatar 杜庆泉

file system manager 测试用例调整 确保正常运行

上级 6e378556
...@@ -278,11 +278,11 @@ describe('ExtApi-FileManagerTest', () => { ...@@ -278,11 +278,11 @@ describe('ExtApi-FileManagerTest', () => {
/** /**
* 从资源文件中读取图片为base64,测试写入较大文件场景 * 从资源文件中读取图片为base64,测试写入较大文件场景
* 'static/list-mock/safe.png' 注意,依赖这个资源文件,不能删除 * 'static/test-image/logo.ico' 注意,依赖这个资源文件,不能删除
*/ */
await page.setData({ await page.setData({
basePath: "", basePath: "",
readFile:'static/list-mock/safe.png', readFile:'static/test-image/logo.ico',
readFileEncoding:'base64' readFileEncoding:'base64'
}) })
...@@ -292,10 +292,9 @@ describe('ExtApi-FileManagerTest', () => { ...@@ -292,10 +292,9 @@ describe('ExtApi-FileManagerTest', () => {
await btnReadFileButton.tap() await btnReadFileButton.tap()
await isDone() await isDone()
let readFileRet = await getData('readFileRet') let readFileRet = await getData('readFileRet')
expect(readFileRet.length).toEqual(208544)
expect(readFileRet.length).toEqual(426128)
let endStr = readFileRet.substring(readFileRet.length - 10) let endStr = readFileRet.substring(readFileRet.length - 10)
expect(endStr).toEqual("lFTkSuQmCC") expect(endStr).toEqual("///////w==")
await page.setData({ await page.setData({
basePath: globalTempPath, basePath: globalTempPath,
...@@ -335,9 +334,9 @@ describe('ExtApi-FileManagerTest', () => { ...@@ -335,9 +334,9 @@ describe('ExtApi-FileManagerTest', () => {
await isDone() await isDone()
let getFileInfoSize = await getData('getFileInfoSize') let getFileInfoSize = await getData('getFileInfoSize')
expect(getFileInfoSize).toEqual(426128) expect(getFileInfoSize).toEqual(208544)
let getFileInfoDigest = await getData('getFileInfoDigest') let getFileInfoDigest = await getData('getFileInfoDigest')
expect(getFileInfoDigest).toEqual("795fd5a20b4f0a63504330e9132dcd30") expect(getFileInfoDigest).toEqual("486f75ea76625f8c103cac4bc9c49511")
// 切换为 sha1 // 切换为 sha1
await page.setData({ await page.setData({
...@@ -348,9 +347,9 @@ describe('ExtApi-FileManagerTest', () => { ...@@ -348,9 +347,9 @@ describe('ExtApi-FileManagerTest', () => {
await isDone() await isDone()
getFileInfoSize = await getData('getFileInfoSize') getFileInfoSize = await getData('getFileInfoSize')
expect(getFileInfoSize).toEqual(426128) expect(getFileInfoSize).toEqual(208544)
getFileInfoDigest = await getData('getFileInfoDigest') getFileInfoDigest = await getData('getFileInfoDigest')
expect(getFileInfoDigest).toEqual("74877928eddd0351bd8b3b1c677b56f25db682fc") expect(getFileInfoDigest).toEqual("1830169a16e7c860beff4a3b0975ba0b6f775f9e")
// 测试不支持的摘要算法,期望返回错误 // 测试不支持的摘要算法,期望返回错误
await page.setData({ await page.setData({
...@@ -499,8 +498,8 @@ describe('ExtApi-FileManagerTest', () => { ...@@ -499,8 +498,8 @@ describe('ExtApi-FileManagerTest', () => {
// 准备从资源目录拷贝png // 准备从资源目录拷贝png
await page.setData({ await page.setData({
basePath: "", basePath: "",
unlinkFile:'static/list-mock/safe.png', unlinkFile:'static/test-image/logo.ico',
accessFile:'static/list-mock/safe.png', accessFile:'static/test-image/logo.ico',
}) })
// 检查资源文件,期望存在 // 检查资源文件,期望存在
await btnAccessFileButton.tap() await btnAccessFileButton.tap()
...@@ -522,7 +521,7 @@ describe('ExtApi-FileManagerTest', () => { ...@@ -522,7 +521,7 @@ describe('ExtApi-FileManagerTest', () => {
// 复制资源到 root目录 // 复制资源到 root目录
await page.setData({ await page.setData({
copyToBasePath:globalRootPath, copyToBasePath:globalRootPath,
copyFromFile:"static/list-mock/safe.png", copyFromFile:"static/test-image/logo.ico",
copyToFile:"a/从代码目录拷贝的资源.png" copyToFile:"a/从代码目录拷贝的资源.png"
}) })
const btnCopyFileButton = await page.$('#btn-copy-file') const btnCopyFileButton = await page.$('#btn-copy-file')
...@@ -542,12 +541,11 @@ describe('ExtApi-FileManagerTest', () => { ...@@ -542,12 +541,11 @@ describe('ExtApi-FileManagerTest', () => {
accessFileRet = await getData("accessFileRet") accessFileRet = await getData("accessFileRet")
expect(accessFileRet).toEqual('access:ok') expect(accessFileRet).toEqual('access:ok')
await btnUnLinkFileButton.tap() await btnUnLinkFileButton.tap()
await isDone() await isDone()
await btnAccessFileButton.tap() await btnAccessFileButton.tap()
await isDone() await isDone()
accessFileRet = await getData("accessFileRet") accessFileRet = await getData("accessFileRet")
expect(accessFileRet).toEqual('') expect(accessFileRet).toEqual('')
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册