Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
ae933e2a
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看板
未验证
提交
ae933e2a
编写于
11月 21, 2022
作者:
O
openharmony_ci
提交者:
Gitee
11月 21, 2022
浏览文件
操作
浏览文件
下载
差异文件
!6593 observer 测试套整改
Merge pull request !6593 from zhangfuzhi/monthly_20221018
上级
112ff45b
f4800c0b
变更
6
展开全部
隐藏空白更改
内联
并排
Showing
6 changed file
with
385 addition
and
662 deletion
+385
-662
telephony/telephonyjstest/observer/entry/src/main/config.json
...phony/telephonyjstest/observer/entry/src/main/config.json
+0
-40
telephony/telephonyjstest/observer/entry/src/main/ets/TestAbility/app.ets
...onyjstest/observer/entry/src/main/ets/TestAbility/app.ets
+4
-4
telephony/telephonyjstest/observer/entry/src/main/ets/test/List.test.ets
...honyjstest/observer/entry/src/main/ets/test/List.test.ets
+3
-7
telephony/telephonyjstest/observer/entry/src/main/ets/test/ObserverJsunit.test.ets
.../observer/entry/src/main/ets/test/ObserverJsunit.test.ets
+378
-456
telephony/telephonyjstest/observer/entry/src/main/ets/test/Utils.ets
...elephonyjstest/observer/entry/src/main/ets/test/Utils.ets
+0
-119
telephony/telephonyjstest/observer/entry/src/main/ets/test/lib/Const.js
...phonyjstest/observer/entry/src/main/ets/test/lib/Const.js
+0
-36
未找到文件。
telephony/telephonyjstest/observer/entry/src/main/config.json
浏览文件 @
ae933e2a
...
...
@@ -68,49 +68,9 @@
}
],
"reqPermissions"
:
[
{
"name"
:
"ohos.permission.LOCATION"
,
"reason"
:
"need use ohos.permission.LOCATION"
},
{
"name"
:
"ohos.permission.SET_TELEPHONY_STATE"
,
"reason"
:
"need use ohos.permission.SET_TELEPHONY_STATE"
},
{
"name"
:
"ohos.permission.GET_TELEPHONY_STATE"
,
"reason"
:
"need use ohos.permission.GET_TELEPHONY_STATE"
},
{
"name"
:
"ohos.permission.PLACE_CALL"
,
"reason"
:
"need use ohos.permission.PLACE_CALL"
},
{
"name"
:
"ohos.permission.READ_CONTACTS"
,
"reason"
:
"need use ohos.permission.READ_CONTACTS"
},
{
"name"
:
"ohos.permission.WRITE_CONTACTS"
,
"reason"
:
"need use ohos.permission.WRITE_CONTACTS"
},
{
"name"
:
"ohos.permission.SEND_MESSAGES"
,
"reason"
:
"need use ohos.permission.SEND_MESSAGES"
},
{
"name"
:
"ohos.permission.RECEIVE_SMS"
,
"reason"
:
"need use ohos.permission.RECEIVE_SMS"
},
{
"name"
:
"ohos.permission.READ_CALL_LOG"
,
"reason"
:
"need use ohos.permission.READ_CALL_LOG"
},
{
"name"
:
"ohos.permission.GET_NETWORK_INFO"
,
"reason"
:
"need use ohos.permission.GET_NETWORK_INFO"
},
{
"name"
:
"ohos.permission.INTERNET"
,
"reason"
:
"need use ohos.permission.INTERNET"
}
],
"js"
:
[
...
...
telephony/telephonyjstest/observer/entry/src/main/ets/TestAbility/app.ets
浏览文件 @
ae933e2a
...
...
@@ -12,13 +12,13 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'
import { Hypium } from '
hypium/index'
import testsuite from '../test/List.test'
import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'
;
import { Hypium } from '
@ohos/hypium';
import testsuite from '../test/List.test'
;
export default {
onCreate() {
console.info('Application onCreate')
console.info('Application onCreate')
;
var abilityDelegator: any
abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator()
var abilityDelegatorArguments: any
...
...
telephony/telephonyjstest/observer/entry/src/main/ets/test/List.test.ets
浏览文件 @
ae933e2a
/**
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2021
-2022
Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
...
...
@@ -13,12 +13,8 @@
* limitations under the License.
*/
//other import
import observer from './ObserverJsunit.test.ets'
import ObserverJsunit from './ObserverJsunit.test';
export default function testsuite() {
observer();
ObserverJsunit();
}
\ No newline at end of file
telephony/telephonyjstest/observer/entry/src/main/ets/test/ObserverJsunit.test.ets
浏览文件 @
ae933e2a
此差异已折叠。
点击以展开。
telephony/telephonyjstest/observer/entry/src/main/ets/test/Utils.ets
已删除
100644 → 0
浏览文件 @
112ff45b
// @ts-nocheck
/**
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export default class Utils {
static rect_left;
static rect_top;
static rect_right;
static rect_bottom;
static rect_value;
static notCheck = true;
static sleep(time) {
return new Promise((resolve, reject) => {
setTimeout(() => {
resolve()
}, time)
}).then(() => {
console.info(`sleep ${time} over...`)
})
}
static getComponentRect(key) {
let strJson = getInspectorByKey(key);
let obj = JSON.parse(strJson);
console.info("[getInspectorByKey] current component obj is: " + JSON.stringify(obj));
let rectInfo = JSON.parse('[' + obj.$rect + ']')
console.info("[getInspectorByKey] rectInfo is: " + rectInfo);
this.rect_left = JSON.parse('[' + rectInfo[0] + ']')[0]
this.rect_top = JSON.parse('[' + rectInfo[0] + ']')[1]
this.rect_right = JSON.parse('[' + rectInfo[1] + ']')[0]
this.rect_bottom = JSON.parse('[' + rectInfo[1] + ']')[1]
return this.rect_value = {
"left": this.rect_left, "top": this.rect_top, "right": this.rect_right, "bottom": this.rect_bottom
}
}
static async swipe(downX, downY, upX, upY, steps) {
console.info('start to swipe')
this.drags(downX, downY, upX, upY, steps, false)
}
static async drag(downX, downY, upX, upY, steps) {
console.info('start to drag')
this.drags(downX, downY, upX, upY, steps, true)
}
static async drags(downX, downY, upX, upY, steps, drag) {
var xStep;
var yStep;
var swipeSteps;
var ret;
xStep = 0;
yStep = 0;
ret = false;
swipeSteps = steps;
if (swipeSteps == 0) {
swipeSteps = 1;
}
xStep = (upX - downX) / swipeSteps;
yStep = (upY - downY) / swipeSteps;
console.info('move step is: ' + 'xStep: ' + xStep + ' yStep: ' + yStep)
var downPonit: TouchObject = {
id: 1,
x: downX,
y: downY,
type: TouchType.Down,
}
console.info('down touch started: ' + JSON.stringify(downPonit))
sendTouchEvent(downPonit);
console.info('start to move')
if (drag) {
await this.sleep(500)
}
for (var i = 1;i <= swipeSteps; i++) {
var movePoint: TouchObject = {
id: 1,
x: downX + (xStep * i),
y: downY + (yStep * i),
type: TouchType.Move
}
console.info('move touch started: ' + JSON.stringify(movePoint))
ret = sendTouchEvent(movePoint)
if (ret == false) {
break;
}
await this.sleep(5)
}
console.info('start to up')
if (drag) {
await this.sleep(100)
}
var upPoint: TouchObject = {
id: 1,
x: upX,
y: upY,
type: TouchType.Up,
}
console.info('up touch started: ' + JSON.stringify(upPoint))
sendTouchEvent(upPoint)
await this.sleep(500)
}
}
telephony/telephonyjstest/observer/entry/src/main/ets/test/lib/Const.js
已删除
100644 → 0
浏览文件 @
112ff45b
/**
* Copyright (C) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the 'License');
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an 'AS IS' BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// sim slot id
export
const
DEFAULT_SLOTID
=
0
;
export
const
SLOTID3
=
3
;
export
const
SLOTID2
=
2
;
export
const
SLOTID_MINUS1
=
-
1
;
// sim correct password
export
const
CORRECT_PIN
=
'
1234
'
;
export
const
CORRECT_PIN2
=
'
18099014
'
;
// sim incorrect password
export
const
INCORRECT_PIN
=
'
134679
'
;
export
const
INCORRECT_PIN_LEN3
=
'
123
'
;
export
const
INCORRECT_PUK
=
'
134679
'
;
export
const
INCORRECT_PIN2
=
'
134679
'
;
export
const
INCORRECT_PIN2_LEN3
=
'
123
'
;
export
const
INCORRECT_PIN2_LEN9
=
'
123456789
'
;
export
const
INCORRECT_PUK2
=
'
134679
'
;
// lock status response
export
const
LOCK_RESULT
=
{
SUCCESS
:
0
,
FAILURE
:
-
1
,
EXCEPTION
:
-
2
};
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录