Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
2429be1d
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看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
2429be1d
编写于
3月 16, 2023
作者:
O
openharmony_ci
提交者:
Gitee
3月 16, 2023
浏览文件
操作
浏览文件
下载
差异文件
!7992 【杂散】【输入法】【上传下载】【主题】优化锁屏,输入法,上传下载的用例,挑单到relase-3.2
Merge pull request !7992 from 张育帅/monthly_20221018
上级
7363b871
491a7a70
变更
9
展开全部
隐藏空白更改
内联
并排
Showing
9 changed file
with
553 addition
and
413 deletion
+553
-413
inputmethod/InputMethodTest_Stage/entry/src/main/ets/test/imeAbilityTest.test.ets
...est_Stage/entry/src/main/ets/test/imeAbilityTest.test.ets
+11
-14
inputmethod/InputMethodTest_ets/entry/src/main/ets/test/inputMethodJSUnit.ets
...hodTest_ets/entry/src/main/ets/test/inputMethodJSUnit.ets
+37
-17
request/RequestTest_Stage/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts
...ge/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts
+1
-1
request/RequestTest_Stage/entry/src/main/ets/test/requestDownload.test.ets
...st_Stage/entry/src/main/ets/test/requestDownload.test.ets
+144
-98
request/RequestTest_Stage/entry/src/main/ets/test/requestUpload.test.ets
...Test_Stage/entry/src/main/ets/test/requestUpload.test.ets
+10
-12
request/RequestTest_ets/Test.json
request/RequestTest_ets/Test.json
+2
-1
request/RequestTest_ets/entry/src/main/ets/test/requestDownload.test.ets
...Test_ets/entry/src/main/ets/test/requestDownload.test.ets
+336
-246
request/RequestTest_ets/entry/src/main/ets/test/requestUpload.test.ets
...stTest_ets/entry/src/main/ets/test/requestUpload.test.ets
+10
-22
theme/screenlock_ets/entry/src/main/ets/test/screenLockTest.ets
...screenlock_ets/entry/src/main/ets/test/screenLockTest.ets
+2
-2
未找到文件。
inputmethod/InputMethodTest_Stage/entry/src/main/ets/test/imeAbilityTest.test.ets
浏览文件 @
2429be1d
...
...
@@ -24,13 +24,6 @@ export default function imeAbilityTest(abilityContext) {
id:'',
extra:{}
}
/**
* sleep function.
*/
function sleep(date, time){
while(Date.now() - date <= time);
}
/**
* beforeEach: Prerequisites at the test case level, which are executed before each test case is executed.
...
...
@@ -75,12 +68,14 @@ export default function imeAbilityTest(abilityContext) {
}
inputMethod.switchInputMethod(imExtAbilityProperty).then((data)=>{
console.info('====>SUB_InputMethod_IMEAbility_000
4
switchInputMethod to IME :' + data);
console.info('====>SUB_InputMethod_IMEAbility_000
1
switchInputMethod to IME :' + data);
expect(data == true).assertTrue();
});
sleep(Date.now(), 3000);
console.info('====>----------SUB_InputMethod_IMEAbility_0001 end-------------');
done();
let t = setTimeout(() => {
console.info('====>----------SUB_InputMethod_IMEAbility_0001 end-------------' + t);
clearTimeout(t);
done();
}, 500);
})
/**
...
...
@@ -105,9 +100,11 @@ export default function imeAbilityTest(abilityContext) {
console.info('====>SUB_InputMethod_IMEAbility_0002 switchInputMethod to IME :' + data);
expect(data == true).assertTrue();
});
sleep(Date.now(), 2500);
console.info('====>-----------SUB_InputMethod_IMEAbility_0002 end-------------');
done();
let t = setTimeout(() => {
console.info('====>----------SUB_InputMethod_IMEAbility_0001 end-------------' + t);
clearTimeout(t);
done();
}, 500);
})
})
}
inputmethod/InputMethodTest_ets/entry/src/main/ets/test/inputMethodJSUnit.ets
浏览文件 @
2429be1d
...
...
@@ -196,11 +196,16 @@ export default function inputMethodJSUnit() {
let inputMethodCtrl = inputMethod.getInputMethodController()
inputMethodCtrl.showSoftKeyboard((err) => {
try {
expect(err.code).assertEqual(12800003)
console.info("====>************* inputmethod_test_showSoftKeyboard_001 Test end*************");
done();
if(err == undefined){
expect().assertFail()
done();
}else{
expect(err.code).assertEqual(12800003)
console.info("====>************* inputmethod_test_showSoftKeyboard_001 Test end*************");
done();
}
} catch (err) {
expect().assertFail()
console.info("====>inputmethod_test_showSoftKeyboard_001 err tests fail" + JSON.stringify(err));
done();
}
});
...
...
@@ -215,12 +220,17 @@ export default function inputMethodJSUnit() {
it('inputmethod_test_showSoftKeyboard_002', 0, async function (done) {
let inputMethodCtrl = inputMethod.getInputMethodController()
inputMethodCtrl.showSoftKeyboard().then(() => {
expect().assertFail()
done();
try {
expect().assertFail()
done();
} catch (err) {
console.info("====>inputmethod_test_showSoftKeyboard_002 err tests fail" + JSON.stringify(err));
done();
}
}).catch((err) => {
console.info('====>
showSoftKeyboard
promise failed : ' + JSON.stringify(err))
console.info('====>
showSoftKeyboard
typeof(err.code): ' + typeof(err.code))
console.info('====>
showSoftKeyboard
typeof(err.code): ' + err.code)
console.info('====>
inputmethod_test_showSoftKeyboard_002
promise failed : ' + JSON.stringify(err))
console.info('====>
inputmethod_test_showSoftKeyboard_002
typeof(err.code): ' + typeof(err.code))
console.info('====>
inputmethod_test_showSoftKeyboard_002
typeof(err.code): ' + err.code)
expect(err.code).assertEqual(12800003)
console.info("====>************* inputmethod_test_showSoftKeyboard_002 Test end*************");
done();
...
...
@@ -237,12 +247,17 @@ export default function inputMethodJSUnit() {
let inputMethodCtrl = inputMethod.getInputMethodController()
inputMethodCtrl.hideSoftKeyboard((err) => {
try {
console.info('====>hideSoftKeyboard callbacek failed : ' + JSON.stringify(err))
expect(err.code).assertEqual(12800003)
console.info("====>************* inputmethod_test_hideSoftKeyboard_001 Test end*************");
done();
if(err == undefined){
expect().assertFail()
done();
}else{
console.info('====>inputmethod_test_hideSoftKeyboard_001 callbacek failed : ' + JSON.stringify(err))
expect(err.code).assertEqual(12800003)
console.info("====>************* inputmethod_test_hideSoftKeyboard_001 Test end*************");
done();
}
} catch (err) {
expect().assertFail();
console.info('====>inputmethod_test_hideSoftKeyboard_001 callbacek failed : ' + JSON.stringify(err))
done();
}
})
...
...
@@ -257,10 +272,15 @@ export default function inputMethodJSUnit() {
it('inputmethod_test_hideSoftKeyboard_002', 0, async function (done) {
let inputMethodCtrl = inputMethod.getInputMethodController()
inputMethodCtrl.hideSoftKeyboard().then(() => {
expect().assertFail();
done();
try {
expect().assertFail()
done();
} catch (err) {
console.info("====>inputmethod_test_hideSoftKeyboard_002 err tests fail" + JSON.stringify(err));
done();
}
}).catch((err) => {
console.info('====>
hideSoftKeyboard
promise failed : ' + JSON.stringify(err))
console.info('====>
inputmethod_test_hideSoftKeyboard_002
promise failed : ' + JSON.stringify(err))
expect(err.code).assertEqual(12800003);
console.info("====>************* inputmethod_test_hideSoftKeyboard_002 Test end*************");
done();
...
...
request/RequestTest_Stage/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts
浏览文件 @
2429be1d
...
...
@@ -59,7 +59,7 @@ export default class OpenHarmonyTestRunner implements TestRunner {
}
hilog
.
isLoggable
(
0x0000
,
'
testTag
'
,
hilog
.
LogLevel
.
INFO
);
hilog
.
info
(
0x0000
,
'
testTag
'
,
'
cmd : %{public}s
'
,
cmd
);
abilityDelegator
.
executeShellCommand
(
"
echo
\"
123456
\"
> /data/app/el2/100/base/com.acts.request
test
.test/haps/entry_test/cache/test.txt
"
,
abilityDelegator
.
executeShellCommand
(
"
echo
\"
123456
\"
> /data/app/el2/100/base/com.acts.request.test/haps/entry_test/cache/test.txt
"
,
(
err
:
any
,
d
:
any
)
=>
{
console
.
info
(
'
executeShellCommand : err :
'
+
JSON
.
stringify
(
err
));
console
.
info
(
'
executeShellCommand : data :
'
+
d
.
stdResult
);
...
...
request/RequestTest_Stage/entry/src/main/ets/test/requestDownload.test.ets
浏览文件 @
2429be1d
此差异已折叠。
点击以展开。
request/RequestTest_Stage/entry/src/main/ets/test/requestUpload.test.ets
浏览文件 @
2429be1d
...
...
@@ -77,8 +77,8 @@ export default function requestUploadJSUnit() {
method: 'POST',
files: [File],
data: [RequestData]
};
};
/**
* @tc.number SUB_REQUEST_uploadFile_STAGE_API_CALLBACK_0001
* @tc.desc Starts a upload task.
...
...
@@ -89,8 +89,7 @@ export default function requestUploadJSUnit() {
it('SUB_REQUEST_uploadFile_STAGE_API_CALLBACK_0001', 0, async function (done) {
console.info("-----------------------SUB_REQUEST_uploadFile_STAGE_API_CALLBACK_0001 is starting-----------------------");
try {
request.uploadFile(globalThis.abilityContext, uploadConfig, (err, data)=>{
uploadTask = data;
request.uploadFile(globalThis.abilityContext, uploadConfig, (err, uploadTask)=>{
console.info("====>SUB_REQUEST_uploadFile_STAGE_API_CALLBACK_0001 uploadFile: " + uploadTask);
try{
expect(true).assertEqual(uploadTask != undefined);
...
...
@@ -101,8 +100,9 @@ export default function requestUploadJSUnit() {
} catch (err) {
console.error("====>SUB_REQUEST_uploadFile_STAGE_API_CALLBACK_0001 error: " + err);
};
setTimeout(()=>{
let t =
setTimeout(()=>{
console.info("-----------------------SUB_REQUEST_uploadFile_STAGE_API_CALLBACK_0001 end-----------------------");
clearTimeout(t);
done();
}, 10000);
});
...
...
@@ -117,8 +117,7 @@ export default function requestUploadJSUnit() {
it('SUB_REQUEST_uploadFile_STAGE_API_PROMISE_0001', 0, async function (done) {
console.info("-----------------------SUB_REQUEST_uploadFile_STAGE_API_PROMISE_0001 is starting-----------------------");
try{
request.uploadFile(globalThis.abilityContext, uploadConfig).then(data => {
uploadTask = data;
request.uploadFile(globalThis.abilityContext, uploadConfig).then(uploadTask => {
console.info("====>SUB_REQUEST_uploadFile_STAGE_API_PROMISE_0001 uploadFile: " + uploadTask);
try{
expect(true).assertEqual(uploadTask != undefined);
...
...
@@ -132,8 +131,9 @@ export default function requestUploadJSUnit() {
}catch(err){
console.error("====>SUB_REQUEST_uploadFile_STAGE_API_PROMISE_0001 catch error: " + err);
}
setTimeout(()=>{
let t =
setTimeout(()=>{
console.info("-----------------------SUB_REQUEST_uploadFile_STAGE_API_PROMISE_0001 end-----------------------");
clearTimeout(t);
done();
}, 10000);
});
...
...
@@ -147,9 +147,8 @@ export default function requestUploadJSUnit() {
*/
it('SUB_REQUEST_UPLOAD_API_DELETE_0001', 0, async function (done) {
console.info("====>-----------------------SUB_REQUEST_UPLOAD_API_DELETE_0001 is starting-----------------------");
request.uploadFile(globalThis.abilityContext, uploadConfig, (err,
data
) => {
request.uploadFile(globalThis.abilityContext, uploadConfig, (err,
uploadTask
) => {
try{
uploadTask = data;
console.info("====>SUB_REQUEST_UPLOAD_API_DELETE_0001 uploadTask: " + uploadTask);
expect(uploadTask != undefined).assertEqual(true);
uploadTask.delete((err, data) => {
...
...
@@ -184,8 +183,7 @@ export default function requestUploadJSUnit() {
*/
it('SUB_REQUEST_UPLOAD_API_DELETE_0002', 0, async function (done) {
console.info("====>-----------------------SUB_REQUEST_UPLOAD_API_DELETE_0002 is starting-----------------------");
request.uploadFile(globalThis.abilityContext, uploadConfig, (err, data) => {
uploadTask = data;
request.uploadFile(globalThis.abilityContext, uploadConfig, (err, uploadTask) => {
console.info("====>SUB_REQUEST_UPLOAD_API_DELETE_0002 uploadTask: " + uploadTask);
try{
expect(uploadTask != undefined).assertEqual(true);
...
...
request/RequestTest_ets/Test.json
浏览文件 @
2429be1d
...
...
@@ -5,7 +5,8 @@
"test-timeout"
:
"600000"
,
"bundle-name"
:
"com.acts.requesttest"
,
"package-name"
:
"com.acts.requesttest"
,
"shell-timeout"
:
"600000"
"shell-timeout"
:
"600000"
,
"testcase-timeout"
:
15000
},
"kits"
:
[
{
...
...
request/RequestTest_ets/entry/src/main/ets/test/requestDownload.test.ets
浏览文件 @
2429be1d
此差异已折叠。
点击以展开。
request/RequestTest_ets/entry/src/main/ets/test/requestUpload.test.ets
浏览文件 @
2429be1d
...
...
@@ -49,13 +49,6 @@ export default function requestUploadJSUnit() {
console.info('====>afterAll: Test suite-level cleanup condition is executed');
});
/**
* sleep function.
*/
function sleep(date, time){
while(Date.now() - date <= time);
}
let uploadTask;
let RequestData = {
name: 'name',
...
...
@@ -265,11 +258,9 @@ export default function requestUploadJSUnit() {
console.info("====>-----------------------SUB_REQUEST_UPLOAD_API_CALLBACK_0001 is starting-----------------------");
try {
console.info("====>SUB_REQUEST_UPLOAD_API_CALLBACK_0001 uploadConfig = " + JSON.stringify(uploadConfig));
request.upload(uploadConfig, (err, data) => {
uploadTask = data;
request.upload(uploadConfig, (err, uploadTask) => {
console.info("====>SUB_REQUEST_UPLOAD_API_CALLBACK_0001 progress uploadTask =" + JSON.stringify(uploadTask));
expect(uploadTask != undefined).assertEqual(true);
uploadTask.on('progress', function (data1, data2) {
console.info("====>SUB_REQUEST_UPLOAD_API_CALLBACK_0001 on data1 =" + data1);
console.info("====>SUB_REQUEST_UPLOAD_API_CALLBACK_0001 on data2 =" + data2);
...
...
@@ -282,15 +273,15 @@ export default function requestUploadJSUnit() {
uploadTask.remove((err, data) => {
console.info("====>SUB_REQUEST_UPLOAD_API_CALLBACK_0001 remove =" + data);
expect(data).assertEqual(true);
console.info("====>-----------------------SUB_REQUEST_UPLOAD_API_CALLBACK_0001 end-----------------------");
done();
});
});
} catch (err) {
console.error("====>SUB_REQUEST_UPLOAD_API_CALLBACK_0001 error: " + err);
expect().assertFail();
}
sleep(Date.now(), 20000);
console.info("====>-----------------------SUB_REQUEST_UPLOAD_API_CALLBACK_0001 end-----------------------");
done();
});
/**
...
...
@@ -305,33 +296,30 @@ export default function requestUploadJSUnit() {
console.info("====>-----------------------SUB_REQUEST_UPLOAD_API_PROMISE_0001 is starting-----------------------");
try {
console.info("====>SUB_REQUEST_UPLOAD_API_PROMISE_0001 UploadConfig = " + JSON.stringify(uploadConfig));
request.upload(uploadConfig).then((data) => {
uploadTask = data;
request.upload(uploadConfig).then((uploadTask) => {
console.info("====>SUB_REQUEST_UPLOAD_API_PROMISE_0001 uploadTask = " + uploadTask);
expect(true).assertEqual((uploadTask != undefined) || (uploadTask != "") || (uploadTask != {}));
expect(true).assertEqual((uploadTask != undefined));
uploadTask.on('headerReceive', (header) => {
console.info("====>SUB_REQUEST_UPLOAD_API_PROMISE_0001 header = " + header);
expect(true).assertEqual((header != undefined) || (header != "") || (header != {}
));
expect(true).assertEqual((header != {} || header != undefined
));
});
uploadTask.off('headerReceive', (header) => {
console.info("====>SUB_REQUEST_UPLOAD_API_PROMISE_0001 header = " + header);
expect(true).assertEqual((header != undefined) || (header != "") || (header != {}
));
expect(true).assertEqual((header != {} || header != undefined
));
});
uploadTask.remove().then((result)=>{
console.info("====>SUB_REQUEST_UPLOAD_API_PROMISE_0001 remove result = " + result);
expect(result).assertEqual(true);
console.info("====>-----------------------SUB_REQUEST_UPLOAD_API_PROMISE_0001 end-----------------------");
done();
});
});
} catch (e) {
console.error("====>SUB_REQUEST_UPLOAD_API_PROMISE_0001 error: " + JSON.stringify(e));
expect(true).assertFail(true);
}
sleep(Date.now(), 20000);
console.info("====>-----------------------SUB_REQUEST_UPLOAD_API_PROMISE_0001 end-----------------------");
done();
});
})
}
theme/screenlock_ets/entry/src/main/ets/test/screenLockTest.ets
浏览文件 @
2429be1d
...
...
@@ -170,7 +170,7 @@ export default function screenLockJSUnit() {
screenLock.isSecureMode((err, data) => {
try{
console.info("====>SUB_MISC_THEME_screenLock_API_0003 secureMode's result is " + data);
expect(data ==
result
).assertTrue();
expect(data ==
false
).assertTrue();
console.info("====>------------------end SUB_MISC_THEME_screenLock_API_0003-------------------");
done();
}catch(err){
...
...
@@ -288,7 +288,7 @@ export default function screenLockJSUnit() {
try{
secured = screenLock.isSecure()
console.info('====>SUB_MISC_THEME_screenLock_API_0011 data : ' + JSON.stringify(secured));
if (
typeof secured == "boolean"
) {
if (
secured == false
) {
expect(true).assertTrue();
console.info('====>-------------SUB_MISC_THEME_screenLock_API_0011 end----------------------');
done()
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录