Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
f9fd9445
X
Xts Acts
项目概览
OpenHarmony
/
Xts Acts
1 年多 前同步成功
通知
9
Star
22
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
X
Xts Acts
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
f9fd9445
编写于
8月 19, 2023
作者:
O
openharmony_ci
提交者:
Gitee
8月 19, 2023
浏览文件
操作
浏览文件
下载
差异文件
!9789 给documentPicker新增参数添加XTS测试用例
Merge pull request !9789 from yxn22/dev
上级
da5336d9
890eb13e
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
210 addition
and
2 deletion
+210
-2
storage/storagepickerjstest/entry/src/main/ets/test/documentPickerPromise.test.ets
...st/entry/src/main/ets/test/documentPickerPromise.test.ets
+210
-2
未找到文件。
storage/storagepickerjstest/entry/src/main/ets/test/documentPickerPromise.test.ets
浏览文件 @
f9fd9445
...
...
@@ -47,7 +47,7 @@ export default function documentPickerPromise(abilityContext) {
}
}
async
function
selectWithOption
(
testNum
,
done
,
option
,
dirName
,
fileName
)
{
async
function
selectWithOption
(
testNum
,
done
,
option
,
dirName
?
,
fileName
?
)
{
try
{
let
documentPicker
=
new
picker
.
DocumentViewPicker
();
documentPicker
.
select
(
option
)
.
then
((
result
)
=>
{
...
...
@@ -144,6 +144,118 @@ export default function documentPickerPromise(abilityContext) {
await
select
(
testNum
,
done
,
dirName
,
fileName
);
});
/**
* @tc.number : SUB_STORAGE_DOCUMENTPICKER_SELECT_PROMISE_0200
* @tc.name : documentpicker_select_promise_002
* @tc.desc : select with option
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 1
*/
it
(
"documentpicker_select_promise_002"
,
0
,
async
function
(
done
)
{
let
testNum
=
"documentpicker_select_promise_002"
;
let
option
=
new
picker
.
DocumentSelectOptions
();
option
.
maxSelectNumber
=
3
;
let
dirName
=
"Pictures"
;
await
selectWithOption
(
testNum
,
done
,
option
,
dirName
);
});
/**
* @tc.number : SUB_STORAGE_DOCUMENTPICKER_SELECT_PROMISE_0300
* @tc.name : documentpicker_select_promise_003
* @tc.desc : select with option
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 1
*/
it
(
"documentpicker_select_promise_003"
,
0
,
async
function
(
done
)
{
let
testNum
=
"documentpicker_select_promise_003"
;
let
option
=
new
picker
.
DocumentSelectOptions
();
option
.
defaultFilePathUri
=
"file://media/file/8"
;
let
dirName
=
"Pictures"
;
await
selectWithOption
(
testNum
,
done
,
option
,
dirName
);
});
/**
* @tc.number : SUB_STORAGE_DOCUMENTPICKER_SELECT_PROMISE_0400
* @tc.name : documentpicker_select_promise_004
* @tc.desc : select with option
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 1
*/
it
(
"documentpicker_select_promise_004"
,
0
,
async
function
(
done
)
{
let
testNum
=
"documentpicker_select_promise_004"
;
let
option
=
new
picker
.
DocumentSelectOptions
();
option
.
defaultFilePathUri
=
"file://docs/storage/Users/currentUser/test/test1"
;
let
dirName
=
"Pictures"
;
await
selectWithOption
(
testNum
,
done
,
option
,
dirName
);
});
/**
* @tc.number : SUB_STORAGE_DOCUMENTPICKER_SELECT_PROMISE_0500
* @tc.name : documentpicker_select_promise_005
* @tc.desc : select with option
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 1
*/
it
(
"documentpicker_select_promise_005"
,
0
,
async
function
(
done
)
{
let
testNum
=
"documentpicker_select_promise_005"
;
let
option
=
new
picker
.
DocumentSelectOptions
();
option
.
fileSuffixFilters
=
[
'.png'
,
'.jpg'
];
let
dirName
=
"Pictures"
;
await
selectWithOption
(
testNum
,
done
,
option
,
dirName
);
});
/**
* @tc.number : SUB_STORAGE_DOCUMENTPICKER_SELECT_PROMISE_0500
* @tc.name : documentpicker_select_promise_005
* @tc.desc : select with option
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 1
*/
it
(
"documentpicker_select_promise_005"
,
0
,
async
function
(
done
)
{
let
testNum
=
"documentpicker_select_promise_005"
;
let
option
=
new
picker
.
DocumentSelectOptions
();
option
.
fileSuffixFilters
=
[
'.pptx'
,
'.docx'
,
'.xlsx'
,
'.txt'
];
let
dirName
=
"Documents"
;
await
selectWithOption
(
testNum
,
done
,
option
,
dirName
);
});
/**
* @tc.number : SUB_STORAGE_DOCUMENTPICKER_SELECT_PROMISE_0600
* @tc.name : documentpicker_select_promise_006
* @tc.desc : select with option
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 1
*/
it
(
"documentpicker_select_promise_006"
,
0
,
async
function
(
done
)
{
let
testNum
=
"documentpicker_select_promise_006"
;
let
option
=
new
picker
.
DocumentSelectOptions
();
option
.
fileSuffixFilters
=
[
'.mp4'
];
let
dirName
=
"Videos"
;
await
selectWithOption
(
testNum
,
done
,
option
,
dirName
);
});
/**
* @tc.number : SUB_STORAGE_DOCUMENTPICKER_SELECT_PROMISE_0700
* @tc.name : documentpicker_select_promise_007
* @tc.desc : select with option
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 1
*/
it
(
"documentpicker_select_promise_007"
,
0
,
async
function
(
done
)
{
let
testNum
=
"documentpicker_select_promise_007"
;
let
option
=
new
picker
.
DocumentSelectOptions
();
option
.
fileSuffixFilters
=
[
'.mp3'
];
let
dirName
=
"Audios"
;
await
selectWithOption
(
testNum
,
done
,
option
,
dirName
);
});
/**
* @tc.number : SUB_STORAGE_DOCUMENTPICKER_SAVE_PROMISE_0000
* @tc.name : documentpicker_save_promise_000
...
...
@@ -207,5 +319,101 @@ export default function documentPickerPromise(abilityContext) {
let
saveDir
=
"Audios"
;
await
saveWithOption
(
testNum
,
done
,
option
,
saveDir
);
});
/**
* @tc.number : SUB_STORAGE_DOCUMENTPICKER_SAVE_PROMISE_0400
* @tc.name : documentpicker_save_promise_004
* @tc.desc : save uri in Pictures
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 3
*/
it
(
"documentpicker_save_promise_004"
,
0
,
async
function
(
done
)
{
let
testNum
=
"documentpicker_save_promise_004"
;
let
option
=
new
picker
.
DocumentSaveOptions
();
option
.
defaultFilePathUri
=
"file://media/file/8"
;
let
saveDir
=
"Pictures"
;
await
saveWithOption
(
testNum
,
done
,
option
,
saveDir
);
});
/**
* @tc.number : SUB_STORAGE_DOCUMENTPICKER_SAVE_PROMISE_0500
* @tc.name : documentpicker_save_promise_005
* @tc.desc : save png in Pictures
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 3
*/
it
(
"documentpicker_save_promise_005"
,
0
,
async
function
(
done
)
{
let
testNum
=
"documentpicker_save_promise_005"
;
let
option
=
new
picker
.
DocumentSaveOptions
();
option
.
defaultFilePathUri
=
"file://docs/storage/Users/currentUser/test/test1/202308171505.png"
;
let
saveDir
=
"Pictures"
;
await
saveWithOption
(
testNum
,
done
,
option
,
saveDir
);
});
/**
* @tc.number : SUB_STORAGE_DOCUMENTPICKER_SAVE_PROMISE_0600
* @tc.name : documentpicker_save_promise_006
* @tc.desc : save suffix in Pictures
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 3
*/
it
(
"documentpicker_save_promise_006"
,
0
,
async
function
(
done
)
{
let
testNum
=
"documentpicker_save_promise_006"
;
let
option
=
new
picker
.
DocumentSaveOptions
();
option
.
fileSuffixChoices
=
[
'.png'
,
'.jpg'
];
let
saveDir
=
"Pictures"
;
await
saveWithOption
(
testNum
,
done
,
option
,
saveDir
);
});
/**
* @tc.number : SUB_STORAGE_DOCUMENTPICKER_SAVE_PROMISE_0700
* @tc.name : documentpicker_save_promise_007
* @tc.desc : save suffix in Documents
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 3
*/
it
(
"documentpicker_save_promise_007"
,
0
,
async
function
(
done
)
{
let
testNum
=
"documentpicker_save_promise_007"
;
let
option
=
new
picker
.
DocumentSaveOptions
();
option
.
fileSuffixChoices
=
[
'.pptx'
,
'.docx'
,
'.xlsx'
,
'.txt'
];
let
saveDir
=
"Documents"
;
await
saveWithOption
(
testNum
,
done
,
option
,
saveDir
);
});
/**
* @tc.number : SUB_STORAGE_DOCUMENTPICKER_SAVE_PROMISE_0800
* @tc.name : documentpicker_save_promise_008
* @tc.desc : save mp4 in Videos
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 3
*/
it
(
"documentpicker_save_promise_008"
,
0
,
async
function
(
done
)
{
let
testNum
=
"documentpicker_save_promise_008"
;
let
option
=
new
picker
.
DocumentSaveOptions
();
option
.
fileSuffixChoices
=
[
'.mp4'
];
let
saveDir
=
"Videos"
;
await
saveWithOption
(
testNum
,
done
,
option
,
saveDir
);
});
/**
* @tc.number : SUB_STORAGE_DOCUMENTPICKER_SAVE_PROMISE_0900
* @tc.name : documentpicker_save_promise_009
* @tc.desc : save mp3 in Audios
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 3
*/
it
(
"documentpicker_save_promise_009"
,
0
,
async
function
(
done
)
{
let
testNum
=
"documentpicker_save_promise_009"
;
let
option
=
new
picker
.
DocumentSaveOptions
();
option
.
fileSuffixChoices
=
[
'.mp3'
];
let
saveDir
=
"Audios"
;
await
saveWithOption
(
testNum
,
done
,
option
,
saveDir
);
});
});
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录