Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
574a5237
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,发现更多精彩内容 >>
提交
574a5237
编写于
6月 21, 2022
作者:
G
gaoxi
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
os
Signed-off-by:
N
gaoxi
<
gaoxi785@huawei.com
>
上级
a6e883dd
变更
51
隐藏空白更改
内联
并排
Showing
51 changed file
with
173 addition
and
694 deletion
+173
-694
telephony/telephonyjstest/BUILD.gn
telephony/telephonyjstest/BUILD.gn
+1
-1
telephony/telephonyjstest/netmanager_http/BUILD.gn
telephony/telephonyjstest/netmanager_http/BUILD.gn
+0
-4
telephony/telephonyjstest/netmanager_http/Test.json
telephony/telephonyjstest/netmanager_http/Test.json
+4
-5
telephony/telephonyjstest/netmanager_http/entry/src/main/config.json
...elephonyjstest/netmanager_http/entry/src/main/config.json
+1
-28
telephony/telephonyjstest/netmanager_http/entry/src/main/ets/MainAbility/pages/index.ets
...nager_http/entry/src/main/ets/MainAbility/pages/index.ets
+28
-0
telephony/telephonyjstest/netmanager_http/entry/src/main/ets/MainAbility/test/HttpJsunit.test.ets
...p/entry/src/main/ets/MainAbility/test/HttpJsunit.test.ets
+2
-2
telephony/telephonyjstest/netmanager_http/entry/src/main/ets/MainAbility/test/HttpRequestJsunit.test.ets
.../src/main/ets/MainAbility/test/HttpRequestJsunit.test.ets
+2
-2
telephony/telephonyjstest/netmanager_http/entry/src/main/ets/MainAbility/test/HttpRequestOptionsJsunit.test.ets
...in/ets/MainAbility/test/HttpRequestOptionsJsunit.test.ets
+2
-2
telephony/telephonyjstest/netmanager_http/entry/src/main/ets/MainAbility/test/HttpResponseJsunit.test.ets
...src/main/ets/MainAbility/test/HttpResponseJsunit.test.ets
+2
-2
telephony/telephonyjstest/netmanager_http/entry/src/main/ets/MainAbility/test/List.test.ets
...er_http/entry/src/main/ets/MainAbility/test/List.test.ets
+6
-6
telephony/telephonyjstest/netmanager_http/entry/src/main/ets/MainAbility/test/RequestMethodJsunit.test.ets
...rc/main/ets/MainAbility/test/RequestMethodJsunit.test.ets
+2
-2
telephony/telephonyjstest/netmanager_http/entry/src/main/ets/MainAbility/test/ResponseCodeJsunit.test.ets
...src/main/ets/MainAbility/test/ResponseCodeJsunit.test.ets
+2
-2
telephony/telephonyjstest/netmanager_http/entry/src/main/ets/MainAbility/test/Utils.ets
...anager_http/entry/src/main/ets/MainAbility/test/Utils.ets
+0
-0
telephony/telephonyjstest/netmanager_http/entry/src/main/ets/MainAbility/test/lib/Const.js
...ger_http/entry/src/main/ets/MainAbility/test/lib/Const.js
+0
-0
telephony/telephonyjstest/netmanager_http/entry/src/main/ets/TestAbility/app.ets
...st/netmanager_http/entry/src/main/ets/TestAbility/app.ets
+0
-32
telephony/telephonyjstest/netmanager_http/entry/src/main/ets/TestAbility/pages/index.ets
...nager_http/entry/src/main/ets/TestAbility/pages/index.ets
+0
-49
telephony/telephonyjstest/netmanager_http/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts
...tp/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts
+0
-77
telephony/telephonyjstest/netmanager_http/entry/src/main/resources/base/element/string.json
...er_http/entry/src/main/resources/base/element/string.json
+0
-8
telephony/telephonyjstest/netmanager_socket/BUILD.gn
telephony/telephonyjstest/netmanager_socket/BUILD.gn
+0
-4
telephony/telephonyjstest/netmanager_socket/Test.json
telephony/telephonyjstest/netmanager_socket/Test.json
+4
-5
telephony/telephonyjstest/netmanager_socket/entry/src/main/config.json
...ephonyjstest/netmanager_socket/entry/src/main/config.json
+1
-28
telephony/telephonyjstest/netmanager_socket/entry/src/main/ets/MainAbility/pages/index.ets
...ger_socket/entry/src/main/ets/MainAbility/pages/index.ets
+28
-0
telephony/telephonyjstest/netmanager_socket/entry/src/main/ets/MainAbility/test/ConnectionJsunit.test.ets
...y/src/main/ets/MainAbility/test/ConnectionJsunit.test.ets
+2
-2
telephony/telephonyjstest/netmanager_socket/entry/src/main/ets/MainAbility/test/ConnectionSecondJsUnit.test.ets
...main/ets/MainAbility/test/ConnectionSecondJsUnit.test.ets
+2
-2
telephony/telephonyjstest/netmanager_socket/entry/src/main/ets/MainAbility/test/List.test.ets
..._socket/entry/src/main/ets/MainAbility/test/List.test.ets
+0
-0
telephony/telephonyjstest/netmanager_socket/entry/src/main/ets/MainAbility/test/SocketJsunit.test.ets
...entry/src/main/ets/MainAbility/test/SocketJsunit.test.ets
+13
-11
telephony/telephonyjstest/netmanager_socket/entry/src/main/ets/MainAbility/test/Utils.ets
...ager_socket/entry/src/main/ets/MainAbility/test/Utils.ets
+0
-0
telephony/telephonyjstest/netmanager_socket/entry/src/main/ets/MainAbility/test/WebSocketJsunit.test.ets
...ry/src/main/ets/MainAbility/test/WebSocketJsunit.test.ets
+2
-3
telephony/telephonyjstest/netmanager_socket/entry/src/main/ets/MainAbility/test/lib/Const.js
...r_socket/entry/src/main/ets/MainAbility/test/lib/Const.js
+0
-0
telephony/telephonyjstest/netmanager_socket/entry/src/main/ets/TestAbility/app.ets
.../netmanager_socket/entry/src/main/ets/TestAbility/app.ets
+0
-32
telephony/telephonyjstest/netmanager_socket/entry/src/main/ets/TestAbility/pages/index.ets
...ger_socket/entry/src/main/ets/TestAbility/pages/index.ets
+0
-58
telephony/telephonyjstest/netmanager_socket/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts
...et/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts
+0
-77
telephony/telephonyjstest/netmanager_socket/entry/src/main/resources/base/element/string.json
..._socket/entry/src/main/resources/base/element/string.json
+0
-8
telephony/telephonyjstest/radiostatistic/BUILD.gn
telephony/telephonyjstest/radiostatistic/BUILD.gn
+2
-6
telephony/telephonyjstest/radiostatistic/Test.json
telephony/telephonyjstest/radiostatistic/Test.json
+5
-6
telephony/telephonyjstest/radiostatistic/entry/src/main/config.json
...telephonyjstest/radiostatistic/entry/src/main/config.json
+1
-28
telephony/telephonyjstest/radiostatistic/entry/src/main/ets/MainAbility/pages/index.ets
...ostatistic/entry/src/main/ets/MainAbility/pages/index.ets
+28
-0
telephony/telephonyjstest/radiostatistic/entry/src/main/ets/MainAbility/test/CallJsunit.test.ets
...c/entry/src/main/ets/MainAbility/test/CallJsunit.test.ets
+2
-3
telephony/telephonyjstest/radiostatistic/entry/src/main/ets/MainAbility/test/ConvertOptionsJsunit.test.ets
...c/main/ets/MainAbility/test/ConvertOptionsJsunit.test.ets
+3
-4
telephony/telephonyjstest/radiostatistic/entry/src/main/ets/MainAbility/test/DataJsunit.test.ets
...c/entry/src/main/ets/MainAbility/test/DataJsunit.test.ets
+2
-2
telephony/telephonyjstest/radiostatistic/entry/src/main/ets/MainAbility/test/List.test.ets
...atistic/entry/src/main/ets/MainAbility/test/List.test.ets
+0
-0
telephony/telephonyjstest/radiostatistic/entry/src/main/ets/MainAbility/test/RadioJsunit.test.ets
.../entry/src/main/ets/MainAbility/test/RadioJsunit.test.ets
+1
-2
telephony/telephonyjstest/radiostatistic/entry/src/main/ets/MainAbility/test/RadioSecondJsunit.test.ets
.../src/main/ets/MainAbility/test/RadioSecondJsunit.test.ets
+19
-17
telephony/telephonyjstest/radiostatistic/entry/src/main/ets/MainAbility/test/SmsMmsJsunit.test.ets
...entry/src/main/ets/MainAbility/test/SmsMmsJsunit.test.ets
+3
-4
telephony/telephonyjstest/radiostatistic/entry/src/main/ets/MainAbility/test/StatisticsJsunit.test.ets
...y/src/main/ets/MainAbility/test/StatisticsJsunit.test.ets
+3
-4
telephony/telephonyjstest/radiostatistic/entry/src/main/ets/MainAbility/test/Utils.ets
...iostatistic/entry/src/main/ets/MainAbility/test/Utils.ets
+0
-0
telephony/telephonyjstest/radiostatistic/entry/src/main/ets/MainAbility/test/lib/Const.js
...tatistic/entry/src/main/ets/MainAbility/test/lib/Const.js
+0
-0
telephony/telephonyjstest/radiostatistic/entry/src/main/ets/TestAbility/app.ets
...est/radiostatistic/entry/src/main/ets/TestAbility/app.ets
+0
-32
telephony/telephonyjstest/radiostatistic/entry/src/main/ets/TestAbility/pages/index.ets
...ostatistic/entry/src/main/ets/TestAbility/pages/index.ets
+0
-49
telephony/telephonyjstest/radiostatistic/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts
...ic/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts
+0
-77
telephony/telephonyjstest/radiostatistic/entry/src/main/resources/base/element/string.json
...atistic/entry/src/main/resources/base/element/string.json
+0
-8
未找到文件。
telephony/telephonyjstest/BUILD.gn
浏览文件 @
574a5237
...
...
@@ -21,7 +21,7 @@ group("telephonyjstest") {
"netmanager_socket:ActsNetManagerSocketEtsTest",
"network_search:network_search",
"observer:ActsObserverEtsTest",
"radiostatistic:ActsRadio
s
tatisticEtsTest",
"radiostatistic:ActsRadio
S
tatisticEtsTest",
"sim:sim",
"sms_mms:sms_mms",
]
...
...
telephony/telephonyjstest/netmanager_http/BUILD.gn
浏览文件 @
574a5237
...
...
@@ -18,7 +18,6 @@ ohos_js_hap_suite("ActsNetManagerHttpEtsTest") {
deps = [
":ace_demo_ets_assets",
":ace_demo_ets_resources",
":ace_demo_ets_test_assets",
]
ets2abc = true
certificate_profile = "./signature/openharmony_sx.p7b"
...
...
@@ -27,9 +26,6 @@ ohos_js_hap_suite("ActsNetManagerHttpEtsTest") {
ohos_js_assets("ace_demo_ets_assets") {
source_dir = "./entry/src/main/ets/MainAbility"
}
ohos_js_assets("ace_demo_ets_test_assets") {
source_dir = "./entry/src/main/ets/TestAbility"
}
ohos_resources("ace_demo_ets_resources") {
sources = [ "./entry/src/main/resources" ]
hap_profile = "./entry/src/main/config.json"
...
...
telephony/telephonyjstest/netmanager_http/Test.json
浏览文件 @
574a5237
{
"description"
:
"Configuration for hjunit demo Tests"
,
"driver"
:
{
"type"
:
"OHJSUnitTest"
,
"test-timeout"
:
"1800000"
,
"bundle-name"
:
"com.ohos.netmanagerhttp"
,
"package-name"
:
"com.ohos.netmanagerhttp"
,
"shell-timeout"
:
"1800000"
"type"
:
"JSUnitTest"
,
"test-timeout"
:
"1500000"
,
"package"
:
"com.ohos.netmanagerhttp"
,
"shell-timeout"
:
"60000"
},
"kits"
:
[
{
...
...
telephony/telephonyjstest/netmanager_http/entry/src/main/config.json
浏览文件 @
574a5237
...
...
@@ -17,7 +17,7 @@
"package"
:
"com.ohos.netmanagerhttp"
,
"name"
:
".MyApplication"
,
"mainAbility"
:
".MainAbility"
,
"srcPath"
:
""
,
"srcPath"
:
"
MainAbility
"
,
"deviceType"
:
[
"phone"
],
...
...
@@ -50,19 +50,6 @@
"label"
:
"$string:entry_MainAbility"
,
"type"
:
"page"
,
"launchType"
:
"standard"
},
{
"orientation"
:
"unspecified"
,
"visible"
:
true
,
"srcPath"
:
"TestAbility"
,
"name"
:
".TestAbility"
,
"srcLanguage"
:
"ets"
,
"icon"
:
"$media:icon"
,
"description"
:
"$string:TestAbility_desc"
,
"formsEnabled"
:
false
,
"label"
:
"$string:TestAbility_label"
,
"type"
:
"page"
,
"launchType"
:
"standard"
}
],
"reqPermissions"
:
[
...
...
@@ -146,20 +133,6 @@
"designWidth"
:
720
,
"autoDesignWidth"
:
false
}
},
{
"mode"
:
{
"syntax"
:
"ets"
,
"type"
:
"pageAbility"
},
"pages"
:
[
"pages/index"
],
"name"
:
".TestAbility"
,
"window"
:
{
"designWidth"
:
720
,
"autoDesignWidth"
:
false
}
}
]
}
...
...
telephony/telephonyjstest/netmanager_http/entry/src/main/ets/MainAbility/pages/index.ets
浏览文件 @
574a5237
...
...
@@ -13,11 +13,39 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import file from '@system.file';
import {Core, ExpectExtend, InstrumentLog, ReportExtend} from "deccjsunit/index.ets";
import testsuite from "../test/List.test.ets";
import featureAbility from "@ohos.ability.featureAbility";
@Entry
@Component
struct MyComponent {
aboutToAppear() {
console.info("start run testcase!!!!")
featureAbility.getWant()
.then((Want) => {
const core = Core.getInstance();
const expectExtend = new ExpectExtend({
'id': 'extend'
});
core.addService('expect', expectExtend);
const reportExtend = new ReportExtend(file);
core.addService('report', reportExtend);
core.init();
core.subscribeEvent('task', reportExtend);
const configService = core.getDefaultService('config');
Want.parameters['timeout'] = 100000
console.info('parameters---->' + JSON.stringify(Want.parameters));
configService.setConfig(Want.parameters);
testsuite();
core.execute();
console.info('Operation successful. Data: ' + JSON.stringify(Want));
})
.catch((error) => {
console.error('Operation failed. Cause: ' + JSON.stringify(error));
})
}
build() {
...
...
telephony/telephonyjstest/netmanager_http/entry/src/main/ets/test/HttpJsunit.test.ets
→
telephony/telephonyjstest/netmanager_http/entry/src/main/ets/
MainAbility/
test/HttpJsunit.test.ets
浏览文件 @
574a5237
/*
* Copyright (C) 202
1
Huawei Device Co., Ltd.
* Copyright (C) 202
2
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
...
...
@@ -12,7 +12,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import {describe, beforeAll, afterAll, it, expect, afterEach} from '
hypium
/index';
import {describe, beforeAll, afterAll, it, expect, afterEach} from '
deccjsunit
/index';
import http from '@ohos.net.http';
export default function httpJsunit() {
...
...
telephony/telephonyjstest/netmanager_http/entry/src/main/ets/test/HttpRequestJsunit.test.ets
→
telephony/telephonyjstest/netmanager_http/entry/src/main/ets/
MainAbility/
test/HttpRequestJsunit.test.ets
浏览文件 @
574a5237
/*
* Copyright (C) 202
1
Huawei Device Co., Ltd.
* Copyright (C) 202
2
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
...
...
@@ -12,7 +12,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import {describe, beforeAll, afterAll, it, expect, afterEach} from 'deccjsunit/index
.ets
';
import {describe, beforeAll, afterAll, it, expect, afterEach} from 'deccjsunit/index';
import http from '@ohos.net.http';
import utils from './Utils.ets'
...
...
telephony/telephonyjstest/netmanager_http/entry/src/main/ets/test/HttpRequestOptionsJsunit.test.ets
→
telephony/telephonyjstest/netmanager_http/entry/src/main/ets/
MainAbility/
test/HttpRequestOptionsJsunit.test.ets
浏览文件 @
574a5237
/*
* Copyright (C) 202
1
Huawei Device Co., Ltd.
* Copyright (C) 202
2
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
...
...
@@ -12,7 +12,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import {describe, beforeAll, afterAll, it, expect, afterEach} from '
hypium
/index';
import {describe, beforeAll, afterAll, it, expect, afterEach} from '
deccjsunit
/index';
import http from '@ohos.net.http';
import utils from './Utils.ets'
...
...
telephony/telephonyjstest/netmanager_http/entry/src/main/ets/test/HttpResponseJsunit.test.ets
→
telephony/telephonyjstest/netmanager_http/entry/src/main/ets/
MainAbility/
test/HttpResponseJsunit.test.ets
浏览文件 @
574a5237
/*
* Copyright (C) 202
1
Huawei Device Co., Ltd.
* Copyright (C) 202
2
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
...
...
@@ -12,7 +12,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import {describe, beforeAll, afterAll, it, expect, afterEach} from '
hypium
/index';
import {describe, beforeAll, afterAll, it, expect, afterEach} from '
deccjsunit
/index';
import http from '@ohos.net.http';
import utils from './Utils.ets'
...
...
telephony/telephonyjstest/netmanager_http/entry/src/main/ets/test/List.test.ets
→
telephony/telephonyjstest/netmanager_http/entry/src/main/ets/
MainAbility/
test/List.test.ets
浏览文件 @
574a5237
...
...
@@ -14,12 +14,12 @@
*/
//other import
import httpJsunit from './HttpJsunit.test
.ets
'
import responseCodeJsunit from './ResponseCodeJsunit.test
.ets
';
import requestMethodJsunit from './RequestMethodJsunit.test
.ets
';
import httpResponseJsunit from './HttpResponseJsunit.test
.ets
';
import HttpRequestOptionsJsunit from './HttpRequestOptionsJsunit.test
.ets
';
import httpRequestJsunit from './HttpRequestJsunit.test
.ets
';
import httpJsunit from './HttpJsunit.test'
import responseCodeJsunit from './ResponseCodeJsunit.test';
import requestMethodJsunit from './RequestMethodJsunit.test';
import httpResponseJsunit from './HttpResponseJsunit.test';
import HttpRequestOptionsJsunit from './HttpRequestOptionsJsunit.test';
import httpRequestJsunit from './HttpRequestJsunit.test';
export default function testsuite() {
//other
...
...
telephony/telephonyjstest/netmanager_http/entry/src/main/ets/test/RequestMethodJsunit.test.ets
→
telephony/telephonyjstest/netmanager_http/entry/src/main/ets/
MainAbility/
test/RequestMethodJsunit.test.ets
浏览文件 @
574a5237
/*
* Copyright (C) 202
1
Huawei Device Co., Ltd.
* Copyright (C) 202
2
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
...
...
@@ -12,7 +12,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import {describe, beforeAll, afterAll, it, expect, afterEach} from '
hypium
/index';
import {describe, beforeAll, afterAll, it, expect, afterEach} from '
deccjsunit
/index';
import http from '@ohos.net.http';
import utils from './Utils.ets'
...
...
telephony/telephonyjstest/netmanager_http/entry/src/main/ets/test/ResponseCodeJsunit.test.ets
→
telephony/telephonyjstest/netmanager_http/entry/src/main/ets/
MainAbility/
test/ResponseCodeJsunit.test.ets
浏览文件 @
574a5237
/*
* Copyright (C) 202
1
Huawei Device Co., Ltd.
* Copyright (C) 202
2
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
...
...
@@ -12,7 +12,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import {describe, beforeAll, afterAll, it, expect, afterEach} from '
hypium
/index';
import {describe, beforeAll, afterAll, it, expect, afterEach} from '
deccjsunit
/index';
import http from '@ohos.net.http';
export default function responseCodeJsunit() {
...
...
telephony/telephonyjstest/netmanager_http/entry/src/main/ets/test/Utils.ets
→
telephony/telephonyjstest/netmanager_http/entry/src/main/ets/
MainAbility/
test/Utils.ets
浏览文件 @
574a5237
文件已移动
telephony/telephonyjstest/netmanager_http/entry/src/main/ets/test/lib/Const.js
→
telephony/telephonyjstest/netmanager_http/entry/src/main/ets/
MainAbility/
test/lib/Const.js
浏览文件 @
574a5237
文件已移动
telephony/telephonyjstest/netmanager_http/entry/src/main/ets/TestAbility/app.ets
已删除
100644 → 0
浏览文件 @
a6e883dd
/*
* Copyright (C) 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
*
* 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.
*/
import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'
import { Hypium } from 'hypium/index'
import testsuite from '../test/List.test'
export default {
onCreate() {
console.info('Application onCreate')
var abilityDelegator: any
abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator()
var abilityDelegatorArguments: any
abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments()
console.info('start run testcase!!!')
Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite)
},
onDestroy() {
console.info('Application onDestroy')
},
}
\ No newline at end of file
telephony/telephonyjstest/netmanager_http/entry/src/main/ets/TestAbility/pages/index.ets
已删除
100644 → 0
浏览文件 @
a6e883dd
/*
* Copyright (C) 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
*
* 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.
*/
import router from '@system.router';
@Entry
@Component
struct Index {
aboutToAppear() {
console.info('TestAbility index aboutToAppear')
}
@State message: string = 'Hello World'
build() {
Row() {
Column() {
Text(this.message)
.fontSize(50)
.fontWeight(FontWeight.Bold)
Button() {
Text('next page')
.fontSize(20)
.fontWeight(FontWeight.Bold)
}.type(ButtonType.Capsule)
.margin({
top: 20
})
.backgroundColor('#0D9FFB')
.width('35%')
.height('5%')
.onClick(()=>{
})
}
.width('100%')
}
.height('100%')
}
}
\ No newline at end of file
telephony/telephonyjstest/netmanager_http/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts
已删除
100644 → 0
浏览文件 @
a6e883dd
/*
* Copyright (C) 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
*
* 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.
*/
import
TestRunner
from
'
@ohos.application.testRunner
'
import
AbilityDelegatorRegistry
from
'
@ohos.application.abilityDelegatorRegistry
'
var
abilityDelegator
=
undefined
var
abilityDelegatorArguments
=
undefined
function
translateParamsToString
(
parameters
)
{
const
keySet
=
new
Set
([
'
-s class
'
,
'
-s notClass
'
,
'
-s suite
'
,
'
-s itName
'
,
'
-s level
'
,
'
-s testType
'
,
'
-s size
'
,
'
-s timeout
'
,
'
-s package
'
])
let
targetParams
=
''
;
for
(
const
key
in
parameters
)
{
if
(
keySet
.
has
(
key
))
{
targetParams
+=
'
'
+
key
+
'
'
+
parameters
[
key
]
}
}
return
targetParams
.
trim
()
}
async
function
onAbilityCreateCallback
()
{
console
.
log
(
'
onAbilityCreateCallback
'
);
}
async
function
addAbilityMonitorCallback
(
err
:
any
)
{
console
.
info
(
'
addAbilityMonitorCallback :
'
+
JSON
.
stringify
(
err
))
}
export
default
class
OpenHarmonyTestRunner
implements
TestRunner
{
constructor
()
{
}
onPrepare
()
{
console
.
info
(
'
OpenHarmonyTestRunner OnPrepare
'
)
}
onRun
()
{
console
.
log
(
'
OpenHarmonyTestRunner onRun run
'
)
abilityDelegatorArguments
=
AbilityDelegatorRegistry
.
getArguments
()
abilityDelegator
=
AbilityDelegatorRegistry
.
getAbilityDelegator
()
let
lMonitor
=
{
abilityName
:
testAbilityName
,
onAbilityCreate
:
onAbilityCreateCallback
,
};
var
testAbilityName
=
abilityDelegatorArguments
.
parameters
[
'
-p
'
]
+
'
.TestAbility
'
abilityDelegator
.
addAbilityMonitor
(
lMonitor
,
addAbilityMonitorCallback
)
var
cmd
=
'
aa start -d 0 -a
'
+
testAbilityName
+
'
-b
'
+
abilityDelegatorArguments
.
bundleName
cmd
+=
'
'
+
translateParamsToString
(
abilityDelegatorArguments
.
parameters
)
console
.
info
(
'
cmd :
'
+
cmd
)
abilityDelegator
.
executeShellCommand
(
cmd
,
(
err
:
any
,
d
:
any
)
=>
{
console
.
info
(
'
executeShellCommand : err :
'
+
JSON
.
stringify
(
err
));
console
.
info
(
'
executeShellCommand : data :
'
+
d
.
stdResult
);
console
.
info
(
'
executeShellCommand : data :
'
+
d
.
exitCode
);
})
console
.
info
(
'
OpenHarmonyTestRunner onRun call abilityDelegator.getAppContext
'
)
var
context
=
abilityDelegator
.
getAppContext
()
console
.
info
(
'
getAppContext :
'
+
JSON
.
stringify
(
context
))
console
.
info
(
'
OpenHarmonyTestRunner onRun end
'
)
}
};
\ No newline at end of file
telephony/telephonyjstest/netmanager_http/entry/src/main/resources/base/element/string.json
浏览文件 @
574a5237
...
...
@@ -7,14 +7,6 @@
{
"name"
:
"description_mainability"
,
"value"
:
"ETS_Empty Ability"
},
{
"name"
:
"TestAbility_desc"
,
"value"
:
"description"
},
{
"name"
:
"TestAbility_label"
,
"value"
:
"label"
}
]
}
\ No newline at end of file
telephony/telephonyjstest/netmanager_socket/BUILD.gn
浏览文件 @
574a5237
...
...
@@ -18,7 +18,6 @@ ohos_js_hap_suite("ActsNetManagerSocketEtsTest") {
deps = [
":ace_demo_ets_assets",
":ace_demo_ets_resources",
":ace_demo_ets_test_assets",
]
ets2abc = true
certificate_profile = "./signature/openharmony_sx.p7b"
...
...
@@ -27,9 +26,6 @@ ohos_js_hap_suite("ActsNetManagerSocketEtsTest") {
ohos_js_assets("ace_demo_ets_assets") {
source_dir = "./entry/src/main/ets/MainAbility"
}
ohos_js_assets("ace_demo_ets_test_assets") {
source_dir = "./entry/src/main/ets/TestAbility"
}
ohos_resources("ace_demo_ets_resources") {
sources = [ "./entry/src/main/resources" ]
hap_profile = "./entry/src/main/config.json"
...
...
telephony/telephonyjstest/netmanager_socket/Test.json
浏览文件 @
574a5237
{
"description"
:
"Configuration for hjunit demo Tests"
,
"driver"
:
{
"type"
:
"OHJSUnitTest"
,
"test-timeout"
:
"1800000"
,
"bundle-name"
:
"com.ohos.netmanagersocket"
,
"package-name"
:
"com.ohos.netmanagersocket"
,
"shell-timeout"
:
"1800000"
"type"
:
"JSUnitTest"
,
"test-timeout"
:
"1500000"
,
"package"
:
"com.ohos.netmanagersocket"
,
"shell-timeout"
:
"60000"
},
"kits"
:
[
{
...
...
telephony/telephonyjstest/netmanager_socket/entry/src/main/config.json
浏览文件 @
574a5237
...
...
@@ -17,7 +17,7 @@
"package"
:
"com.ohos.netmanagersocket"
,
"name"
:
".MyApplication"
,
"mainAbility"
:
".MainAbility"
,
"srcPath"
:
""
,
"srcPath"
:
"
MainAbility
"
,
"deviceType"
:
[
"phone"
],
...
...
@@ -50,19 +50,6 @@
"label"
:
"$string:entry_MainAbility"
,
"type"
:
"page"
,
"launchType"
:
"standard"
},
{
"orientation"
:
"unspecified"
,
"visible"
:
true
,
"srcPath"
:
"TestAbility"
,
"name"
:
".TestAbility"
,
"srcLanguage"
:
"ets"
,
"icon"
:
"$media:icon"
,
"description"
:
"$string:TestAbility_desc"
,
"formsEnabled"
:
false
,
"label"
:
"$string:TestAbility_label"
,
"type"
:
"page"
,
"launchType"
:
"standard"
}
],
"reqPermissions"
:
[
...
...
@@ -146,20 +133,6 @@
"designWidth"
:
720
,
"autoDesignWidth"
:
false
}
},
{
"mode"
:
{
"syntax"
:
"ets"
,
"type"
:
"pageAbility"
},
"pages"
:
[
"pages/index"
],
"name"
:
".TestAbility"
,
"window"
:
{
"designWidth"
:
720
,
"autoDesignWidth"
:
false
}
}
]
}
...
...
telephony/telephonyjstest/netmanager_socket/entry/src/main/ets/MainAbility/pages/index.ets
浏览文件 @
574a5237
...
...
@@ -13,11 +13,39 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import file from '@system.file';
import {Core, ExpectExtend, InstrumentLog, ReportExtend} from "deccjsunit/index.ets";
import testsuite from "../test/List.test.ets";
import featureAbility from "@ohos.ability.featureAbility";
@Entry
@Component
struct MyComponent {
aboutToAppear() {
console.info("start run testcase!!!!")
featureAbility.getWant()
.then((Want) => {
const core = Core.getInstance();
const expectExtend = new ExpectExtend({
'id': 'extend'
});
core.addService('expect', expectExtend);
const reportExtend = new ReportExtend(file);
core.addService('report', reportExtend);
core.init();
core.subscribeEvent('task', reportExtend);
const configService = core.getDefaultService('config');
Want.parameters['timeout'] = 100000
console.info('parameters---->' + JSON.stringify(Want.parameters));
configService.setConfig(Want.parameters);
testsuite();
core.execute();
console.info('Operation successful. Data: ' + JSON.stringify(Want));
})
.catch((error) => {
console.error('Operation failed. Cause: ' + JSON.stringify(error));
})
}
build() {
...
...
telephony/telephonyjstest/netmanager_socket/entry/src/main/ets/test/ConnectionJsunit.test.ets
→
telephony/telephonyjstest/netmanager_socket/entry/src/main/ets/
MainAbility/
test/ConnectionJsunit.test.ets
浏览文件 @
574a5237
// @ts-nocheck
/**
* Copyright (c) 202
1
Huawei Device Co., Ltd.
* Copyright (c) 202
2
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,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import {describe, it, expect} from '
hypium
/index';
import {describe, it, expect} from '
deccjsunit
/index';
import connection from '@ohos.net.connection'
import utils from './Utils.ets'
...
...
telephony/telephonyjstest/netmanager_socket/entry/src/main/ets/test/ConnectionSecondJsUnit.test.ets
→
telephony/telephonyjstest/netmanager_socket/entry/src/main/ets/
MainAbility/
test/ConnectionSecondJsUnit.test.ets
浏览文件 @
574a5237
// @ts-nocheck
/*
* Copyright (C) 202
1
Huawei Device Co., Ltd.
* Copyright (C) 202
2
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
...
...
@@ -14,7 +14,7 @@
* limitations under the License.
*/
import connection from '@ohos.net.connection';
import {describe, it, expect} from '
hypium
/index';
import {describe, it, expect} from '
deccjsunit
/index';
import utils from './Utils.ets'
export default function connectionSecondJsUnit() {
...
...
telephony/telephonyjstest/netmanager_socket/entry/src/main/ets/test/List.test.ets
→
telephony/telephonyjstest/netmanager_socket/entry/src/main/ets/
MainAbility/
test/List.test.ets
浏览文件 @
574a5237
文件已移动
telephony/telephonyjstest/netmanager_socket/entry/src/main/ets/test/SocketJsunit.test.ets
→
telephony/telephonyjstest/netmanager_socket/entry/src/main/ets/
MainAbility/
test/SocketJsunit.test.ets
浏览文件 @
574a5237
// @ts-nocheck
/**
* Copyright (c) 202
1
Huawei Device Co., Ltd.
* Copyright (c) 202
2
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
...
...
@@ -14,7 +14,7 @@
* limitations under the License.
*/
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from '
hypium
/index';
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from '
deccjsunit
/index';
import socket from '@ohos.net.socket'
import utils from './Utils.ets'
...
...
@@ -655,7 +655,7 @@ export default function socketJsunit() {
broadcast: true
}
try{
udp.setExtraOptions(udpExtraOptions, funtion(error,data) {
udp.setExtraOptions(udpExtraOptions, fun
c
tion(error,data) {
if (error) {
expect().assertFail();
console.log(`${caseName} error, case failed,error: ` + JSON.stringify(error));
...
...
@@ -901,10 +901,11 @@ export default function socketJsunit() {
it('Telephony_Socket_UDPSocket_off_error_0100', 0, function (done) {
console.log("************* Telephony_Socket_UDPSocket_off_error_0100 Test start*************");
let caseName = "Telephony_Socket_UDPSocket_off_error_0100"
udp.off("error", error => {
console.log(`${caseName} fail, error:${toString(error)}`);
expect().assertFail();
});
let callback = err =>{
console.log(caseName +" on error, err:" + JSON.stringify(err));
}
udp.on('error', callback);
udp.off('error', callback);
expect(true).assertTrue();
console.log("************* Telephony_Socket_UDPSocket_off_error_0100 Test end*************");
done();
...
...
@@ -1611,10 +1612,11 @@ export default function socketJsunit() {
it('Telephony_Socket_TCPSocket_off_error_0100', 0, function (done) {
console.log("************* Telephony_Socket_TCPSocket_off_error_0100 Test start*************");
let caseName = "Telephony_Socket_TCPSocket_off_error_0100"
tcp.off("error", error => {
console.log(`${caseName} fail, error:${toString(error)}`);
expect().assertFail();
});
let callback = err =>{
console.log(caseName +" on error, err:" + JSON.stringify(err));
}
tcp.on('error', callback);
tcp.off('error', callback);
expect(true).assertTrue();
console.log("************* Telephony_Socket_TCPSocket_off_error_0100 Test end*************");
done();
...
...
telephony/telephonyjstest/netmanager_socket/entry/src/main/ets/test/Utils.ets
→
telephony/telephonyjstest/netmanager_socket/entry/src/main/ets/
MainAbility/
test/Utils.ets
浏览文件 @
574a5237
文件已移动
telephony/telephonyjstest/netmanager_socket/entry/src/main/ets/test/WebSocketJsunit.test.ets
→
telephony/telephonyjstest/netmanager_socket/entry/src/main/ets/
MainAbility/
test/WebSocketJsunit.test.ets
浏览文件 @
574a5237
// @ts-nocheck
/**
* Copyright (c) 202
1
Huawei Device Co., Ltd.
* Copyright (c) 202
2
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
...
...
@@ -14,7 +13,7 @@
* limitations under the License.
*/
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from '
hypium
/index';
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from '
deccjsunit
/index';
import webSocket from '@ohos.net.webSocket'
import utils from './Utils.ets'
...
...
telephony/telephonyjstest/netmanager_socket/entry/src/main/ets/test/lib/Const.js
→
telephony/telephonyjstest/netmanager_socket/entry/src/main/ets/
MainAbility/
test/lib/Const.js
浏览文件 @
574a5237
文件已移动
telephony/telephonyjstest/netmanager_socket/entry/src/main/ets/TestAbility/app.ets
已删除
100644 → 0
浏览文件 @
a6e883dd
/*
* Copyright (C) 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
*
* 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.
*/
/*import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'
import { Hypium } from 'hypium/index'
import testsuite from '../test/List.test'*/
export default {
onCreate() {
console.info('TestApplication onCreate')
/*var abilityDelegator: any
abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator()
var abilityDelegatorArguments: any
abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments()
console.info('start run testcase!!!')
Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite)*/
},
onDestroy() {
console.info('TestApplication onDestroy')
},
}
\ No newline at end of file
telephony/telephonyjstest/netmanager_socket/entry/src/main/ets/TestAbility/pages/index.ets
已删除
100644 → 0
浏览文件 @
a6e883dd
/*
* Copyright (C) 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
*
* 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.
*/
import router from '@system.router';
import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'
import { Hypium } from 'hypium/index'
import testsuite from '../../test/List.test'
@Entry
@Component
struct Index {
aboutToAppear() {
console.info('TestAbility index aboutToAppear')
var abilityDelegator: any
abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator()
var abilityDelegatorArguments: any
abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments()
console.info('start run testcase!!!')
Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite)
}
@State message: string = 'Hello World'
build() {
Row() {
Column() {
Text(this.message)
.fontSize(50)
.fontWeight(FontWeight.Bold)
Button() {
Text('next page')
.fontSize(20)
.fontWeight(FontWeight.Bold)
}.type(ButtonType.Capsule)
.margin({
top: 20
})
.backgroundColor('#0D9FFB')
.width('35%')
.height('5%')
.onClick(()=>{
})
}
.width('100%')
}
.height('100%')
}
}
\ No newline at end of file
telephony/telephonyjstest/netmanager_socket/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts
已删除
100644 → 0
浏览文件 @
a6e883dd
/*
* Copyright (C) 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
*
* 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.
*/
import
TestRunner
from
'
@ohos.application.testRunner
'
import
AbilityDelegatorRegistry
from
'
@ohos.application.abilityDelegatorRegistry
'
var
abilityDelegator
=
undefined
var
abilityDelegatorArguments
=
undefined
function
translateParamsToString
(
parameters
)
{
const
keySet
=
new
Set
([
'
-s class
'
,
'
-s notClass
'
,
'
-s suite
'
,
'
-s itName
'
,
'
-s level
'
,
'
-s testType
'
,
'
-s size
'
,
'
-s timeout
'
,
'
-s package
'
])
let
targetParams
=
''
;
for
(
const
key
in
parameters
)
{
if
(
keySet
.
has
(
key
))
{
targetParams
+=
'
'
+
key
+
'
'
+
parameters
[
key
]
}
}
return
targetParams
.
trim
()
}
async
function
onAbilityCreateCallback
()
{
console
.
log
(
'
onAbilityCreateCallback
'
);
}
async
function
addAbilityMonitorCallback
(
err
:
any
)
{
console
.
info
(
'
addAbilityMonitorCallback :
'
+
JSON
.
stringify
(
err
))
}
export
default
class
OpenHarmonyTestRunner
implements
TestRunner
{
constructor
()
{
}
onPrepare
()
{
console
.
info
(
'
OpenHarmonyTestRunner OnPrepare
'
)
}
onRun
()
{
console
.
log
(
'
OpenHarmonyTestRunner onRun run
'
)
abilityDelegatorArguments
=
AbilityDelegatorRegistry
.
getArguments
()
abilityDelegator
=
AbilityDelegatorRegistry
.
getAbilityDelegator
()
let
lMonitor
=
{
abilityName
:
testAbilityName
,
onAbilityCreate
:
onAbilityCreateCallback
,
};
var
testAbilityName
=
abilityDelegatorArguments
.
parameters
[
'
-p
'
]
+
'
.TestAbility
'
abilityDelegator
.
addAbilityMonitor
(
lMonitor
,
addAbilityMonitorCallback
)
var
cmd
=
'
aa start -d 0 -a
'
+
testAbilityName
+
'
-b
'
+
abilityDelegatorArguments
.
bundleName
cmd
+=
'
'
+
translateParamsToString
(
abilityDelegatorArguments
.
parameters
)
console
.
info
(
'
cmd :
'
+
cmd
)
abilityDelegator
.
executeShellCommand
(
cmd
,
(
err
:
any
,
d
:
any
)
=>
{
console
.
info
(
'
executeShellCommand : err :
'
+
JSON
.
stringify
(
err
));
console
.
info
(
'
executeShellCommand : data :
'
+
d
.
stdResult
);
console
.
info
(
'
executeShellCommand : data :
'
+
d
.
exitCode
);
})
console
.
info
(
'
OpenHarmonyTestRunner onRun call abilityDelegator.getAppContext
'
)
var
context
=
abilityDelegator
.
getAppContext
()
console
.
info
(
'
getAppContext :
'
+
JSON
.
stringify
(
context
))
console
.
info
(
'
OpenHarmonyTestRunner onRun end
'
)
}
};
\ No newline at end of file
telephony/telephonyjstest/netmanager_socket/entry/src/main/resources/base/element/string.json
浏览文件 @
574a5237
...
...
@@ -7,14 +7,6 @@
{
"name"
:
"description_mainability"
,
"value"
:
"ETS_Empty Ability"
},
{
"name"
:
"TestAbility_desc"
,
"value"
:
"description"
},
{
"name"
:
"TestAbility_label"
,
"value"
:
"label"
}
]
}
\ No newline at end of file
telephony/telephonyjstest/radiostatistic/BUILD.gn
浏览文件 @
574a5237
...
...
@@ -13,23 +13,19 @@
import("//test/xts/tools/build/suite.gni")
ohos_js_hap_suite("ActsRadio
s
tatisticEtsTest") {
ohos_js_hap_suite("ActsRadio
S
tatisticEtsTest") {
hap_profile = "./entry/src/main/config.json"
deps = [
":ace_demo_ets_assets",
":ace_demo_ets_resources",
":ace_demo_ets_test_assets",
]
ets2abc = true
certificate_profile = "./signature/openharmony_sx.p7b"
hap_name = "ActsRadio
s
tatisticEtsTest"
hap_name = "ActsRadio
S
tatisticEtsTest"
}
ohos_js_assets("ace_demo_ets_assets") {
source_dir = "./entry/src/main/ets/MainAbility"
}
ohos_js_assets("ace_demo_ets_test_assets") {
source_dir = "./entry/src/main/ets/TestAbility"
}
ohos_resources("ace_demo_ets_resources") {
sources = [ "./entry/src/main/resources" ]
hap_profile = "./entry/src/main/config.json"
...
...
telephony/telephonyjstest/radiostatistic/Test.json
浏览文件 @
574a5237
{
"description"
:
"Configuration for hjunit demo Tests"
,
"driver"
:
{
"type"
:
"OHJSUnitTest"
,
"test-timeout"
:
"2000000"
,
"bundle-name"
:
"com.ohos.radiostatistic"
,
"package-name"
:
"com.ohos.radiostatistic"
,
"shell-timeout"
:
"2000000"
"type"
:
"JSUnitTest"
,
"test-timeout"
:
"1500000"
,
"package"
:
"com.ohos.radiostatistic"
,
"shell-timeout"
:
"60000"
},
"kits"
:
[
{
"test-file-name"
:
[
"ActsRadio
s
tatisticEtsTest.hap"
"ActsRadio
S
tatisticEtsTest.hap"
],
"type"
:
"AppInstallKit"
,
"cleanup-apps"
:
true
...
...
telephony/telephonyjstest/radiostatistic/entry/src/main/config.json
浏览文件 @
574a5237
...
...
@@ -17,7 +17,7 @@
"package"
:
"com.ohos.radiostatistic"
,
"name"
:
".MyApplication"
,
"mainAbility"
:
".MainAbility"
,
"srcPath"
:
""
,
"srcPath"
:
"
MainAbility
"
,
"deviceType"
:
[
"phone"
],
...
...
@@ -50,19 +50,6 @@
"label"
:
"$string:entry_MainAbility"
,
"type"
:
"page"
,
"launchType"
:
"standard"
},
{
"orientation"
:
"unspecified"
,
"visible"
:
true
,
"srcPath"
:
"TestAbility"
,
"name"
:
".TestAbility"
,
"srcLanguage"
:
"ets"
,
"icon"
:
"$media:icon"
,
"description"
:
"$string:TestAbility_desc"
,
"formsEnabled"
:
false
,
"label"
:
"$string:TestAbility_label"
,
"type"
:
"page"
,
"launchType"
:
"standard"
}
],
"reqPermissions"
:
[
...
...
@@ -146,20 +133,6 @@
"designWidth"
:
720
,
"autoDesignWidth"
:
false
}
},
{
"mode"
:
{
"syntax"
:
"ets"
,
"type"
:
"pageAbility"
},
"pages"
:
[
"pages/index"
],
"name"
:
".TestAbility"
,
"window"
:
{
"designWidth"
:
720
,
"autoDesignWidth"
:
false
}
}
]
}
...
...
telephony/telephonyjstest/radiostatistic/entry/src/main/ets/MainAbility/pages/index.ets
浏览文件 @
574a5237
...
...
@@ -13,11 +13,39 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import file from '@system.file';
import {Core, ExpectExtend, InstrumentLog, ReportExtend} from "deccjsunit/index.ets";
import testsuite from "../test/List.test.ets";
import featureAbility from "@ohos.ability.featureAbility";
@Entry
@Component
struct MyComponent {
aboutToAppear() {
console.info("start run testcase!!!!")
featureAbility.getWant()
.then((Want) => {
const core = Core.getInstance();
const expectExtend = new ExpectExtend({
'id': 'extend'
});
core.addService('expect', expectExtend);
const reportExtend = new ReportExtend(file);
core.addService('report', reportExtend);
core.init();
core.subscribeEvent('task', reportExtend);
const configService = core.getDefaultService('config');
Want.parameters['timeout'] = 100000
console.info('parameters---->' + JSON.stringify(Want.parameters));
configService.setConfig(Want.parameters);
testsuite();
core.execute();
console.info('Operation successful. Data: ' + JSON.stringify(Want));
})
.catch((error) => {
console.error('Operation failed. Cause: ' + JSON.stringify(error));
})
}
build() {
...
...
telephony/telephonyjstest/radiostatistic/entry/src/main/ets/test/CallJsunit.test.ets
→
telephony/telephonyjstest/radiostatistic/entry/src/main/ets/
MainAbility/
test/CallJsunit.test.ets
浏览文件 @
574a5237
// @ts-nocheck
/**
* Copyright (C) 202
1
Huawei Device Co., Ltd.
* Copyright (C) 202
2
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,7 +12,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '
hypium
/index'
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '
deccjsunit
/index'
import call from '@ohos.telephony.call';
import utils from './Utils.ets'
...
...
telephony/telephonyjstest/radiostatistic/entry/src/main/ets/test/ConvertOptionsJsunit.test.ets
→
telephony/telephonyjstest/radiostatistic/entry/src/main/ets/
MainAbility/
test/ConvertOptionsJsunit.test.ets
浏览文件 @
574a5237
// @ts-nocheck
/**
* Copyright (c) 202
1
Huawei Device Co., Ltd.
* Copyright (c) 202
2
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
...
...
@@ -14,10 +13,10 @@
* limitations under the License.
*/
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from '
hypium
/index'
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from '
deccjsunit
/index'
import convertxml from '@ohos.convertxml'
export default function convertOptionsJsunit() {
describe('XmlTest
_telephony1
',function () {
describe('XmlTest',function () {
console.log("************* settings Test start*************");
it('Telephony_convertxml_ConvertXML_0100', 0, async function (done) {
var xml =
...
...
telephony/telephonyjstest/radiostatistic/entry/src/main/ets/test/DataJsunit.test.ets
→
telephony/telephonyjstest/radiostatistic/entry/src/main/ets/
MainAbility/
test/DataJsunit.test.ets
浏览文件 @
574a5237
/**
* Copyright (C) 202
1
Huawei Device Co., Ltd.
* Copyright (C) 202
2
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
...
...
@@ -12,7 +12,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from '
hypium
/index'
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from '
deccjsunit
/index'
import data from '@ohos.telephony.data';
...
...
telephony/telephonyjstest/radiostatistic/entry/src/main/ets/test/List.test.ets
→
telephony/telephonyjstest/radiostatistic/entry/src/main/ets/
MainAbility/
test/List.test.ets
浏览文件 @
574a5237
文件已移动
telephony/telephonyjstest/radiostatistic/entry/src/main/ets/test/RadioJsunit.test.ets
→
telephony/telephonyjstest/radiostatistic/entry/src/main/ets/
MainAbility/
test/RadioJsunit.test.ets
浏览文件 @
574a5237
// @ts-nocheck
/**
* Copyright (c) 202
1
Huawei Device Co., Ltd.
* Copyright (c) 202
2
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
...
...
telephony/telephonyjstest/radiostatistic/entry/src/main/ets/test/RadioSecondJsunit.test.ets
→
telephony/telephonyjstest/radiostatistic/entry/src/main/ets/
MainAbility/
test/RadioSecondJsunit.test.ets
浏览文件 @
574a5237
// @ts-nocheck
/**
* Copyright (c) 202
1
Huawei Device Co., Ltd.
* Copyright (c) 202
2
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,7 +12,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "deccjsunit/index
.ets
";
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "deccjsunit/index";
import radio from '@ohos.telephony.radio';
import utils from './Utils.ets'
...
...
@@ -65,10 +64,8 @@ export default function radioSecondJsunit() {
const CELL_INFO_MIN = 0;
const TIME_RADIO_TURNON = 10000;
console.log("************* radio Test start*************");
/**
/**
* @tc.number Telephony_NetworkSearch_NetworkState_Async_0100
* @tc.name Test getNrOptionMode() to check the callback result
* @tc.desc Function test
...
...
@@ -195,34 +192,35 @@ export default function radioSecondJsunit() {
})
/**
* @tc.number
Telephony_NetworkSearch_getRadioTech_Async_0500
* @tc.name
TestGetRadioTech_0500
* @tc.desc Test getRadioTech() api by callback .
SlotId parameter input is 0
*/
* @tc.number
Telephony_NetworkSearch_getRadioTech_Async_0500
* @tc.name
TestGetRadioTech_0500
* @tc.desc Test getRadioTech() api by callback,
SlotId parameter input is 0
*/
it("Telephony_NetworkSearch_getRadioTech_Async_0500", 0, async function(done){
radio.getRadioTech(0, (err, data) => {
if (err) {
console.
log(`Telephony_NetworkSearch_getRadioTech_Async_0500 fail err: ${err}`);
console.
info(`Telephony_NetworkSearch_getRadioTech_Async_0500 fail err: ${err}`);
expect(err.code === '-1').assertTrue();
done();
return;
}
console.
log
(`Telephony_NetworkSearch_getRadioTech_Async_0500 success ${data}`);
console.
info
(`Telephony_NetworkSearch_getRadioTech_Async_0500 success ${data}`);
expect(true).assertTrue();
done();
});
});
/**
* @tc.number
Telephony_NetworkSearch_getRadioTech_Promise_0500
* @tc.name T
estGetRadioTech_0500
* @tc.desc SlotId parameter input is 0 ,Test getRadioTech() api by promise
*/
* @tc.number
Telephony_NetworkSearch_getRadioTech_Promise_0500
* @tc.name t
estGetRadioTech_0500
* @tc.desc SlotId parameter input is 0, test getRadioTech() api by promise.
*/
it("Telephony_NetworkSearch_getRadioTech_Promise_0500", 0, async function(done){
try {
let data = await radio.getRadioTech(0);
console.log(`Telephony_NetworkSearch_getRadioTech_Promise_0500 success`);
expect(true).assertTrue();
done();
} catch (err) {
console.log(`Telephony_NetworkSearch_getRadioTech_Promise_0500 fail err: ${err}`);
expect(err.code === '-1').assertTrue();
...
...
@@ -359,6 +357,10 @@ export default function radioSecondJsunit() {
done();
});
console.log("************* radio Test end*************");
function assertCellInformation(data) {
expect(data !== '' && data != undefined && data != null).assertTrue();
...
...
telephony/telephonyjstest/radiostatistic/entry/src/main/ets/test/SmsMmsJsunit.test.ets
→
telephony/telephonyjstest/radiostatistic/entry/src/main/ets/
MainAbility/
test/SmsMmsJsunit.test.ets
浏览文件 @
574a5237
// @ts-nocheck
/**
* Copyright (c) 202
1
Huawei Device Co., Ltd.
* Copyright (c) 202
2
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,11 +12,11 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "deccjsunit/index
.ets
";
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "deccjsunit/index";
import mms from '@ohos.telephony.sms';
import utils from './Utils.ets'
export default function smsUiJsunit() {
describe('appInfoTest
_telephony1
', function () {
describe('appInfoTest', function () {
const SMS_SEND_DST_NUMBER = '';
const TRUE_SLOT_ID = 0;
...
...
telephony/telephonyjstest/radiostatistic/entry/src/main/ets/test/StatisticsJsunit.test.ets
→
telephony/telephonyjstest/radiostatistic/entry/src/main/ets/
MainAbility/
test/StatisticsJsunit.test.ets
浏览文件 @
574a5237
// @ts-nocheck
/**
* Copyright (c) 202
1
Huawei Device Co., Ltd.
* Copyright (c) 202
2
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,11 +12,11 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from '
hypium
/index';
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from '
deccjsunit
/index';
import statistics from '@ohos.net.statistics';
import utils from './Utils.ets'
export default function statisticsUiJsunit() {
describe('appInfoTest
_telephony2
', function () {
describe('appInfoTest', function () {
const DATA_0 = 0;
/**
...
...
telephony/telephonyjstest/radiostatistic/entry/src/main/ets/test/Utils.ets
→
telephony/telephonyjstest/radiostatistic/entry/src/main/ets/
MainAbility/
test/Utils.ets
浏览文件 @
574a5237
文件已移动
telephony/telephonyjstest/radiostatistic/entry/src/main/ets/test/lib/Const.js
→
telephony/telephonyjstest/radiostatistic/entry/src/main/ets/
MainAbility/
test/lib/Const.js
浏览文件 @
574a5237
文件已移动
telephony/telephonyjstest/radiostatistic/entry/src/main/ets/TestAbility/app.ets
已删除
100644 → 0
浏览文件 @
a6e883dd
/*
* Copyright (C) 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
*
* 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.
*/
import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'
import { Hypium } from 'hypium/index'
import testsuite from '../test/List.test'
export default {
onCreate() {
console.info('Application onCreate')
var abilityDelegator: any
abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator()
var abilityDelegatorArguments: any
abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments()
console.info('start run testcase!!!')
Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite)
},
onDestroy() {
console.info('Application onDestroy')
},
}
\ No newline at end of file
telephony/telephonyjstest/radiostatistic/entry/src/main/ets/TestAbility/pages/index.ets
已删除
100644 → 0
浏览文件 @
a6e883dd
/*
* Copyright (C) 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
*
* 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.
*/
import router from '@system.router';
@Entry
@Component
struct Index {
aboutToAppear() {
console.info('TestAbility index aboutToAppear')
}
@State message: string = 'Hello World'
build() {
Row() {
Column() {
Text(this.message)
.fontSize(50)
.fontWeight(FontWeight.Bold)
Button() {
Text('next page')
.fontSize(20)
.fontWeight(FontWeight.Bold)
}.type(ButtonType.Capsule)
.margin({
top: 20
})
.backgroundColor('#0D9FFB')
.width('35%')
.height('5%')
.onClick(()=>{
})
}
.width('100%')
}
.height('100%')
}
}
\ No newline at end of file
telephony/telephonyjstest/radiostatistic/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts
已删除
100644 → 0
浏览文件 @
a6e883dd
/*
* Copyright (C) 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
*
* 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.
*/
import
TestRunner
from
'
@ohos.application.testRunner
'
import
AbilityDelegatorRegistry
from
'
@ohos.application.abilityDelegatorRegistry
'
var
abilityDelegator
=
undefined
var
abilityDelegatorArguments
=
undefined
function
translateParamsToString
(
parameters
)
{
const
keySet
=
new
Set
([
'
-s class
'
,
'
-s notClass
'
,
'
-s suite
'
,
'
-s itName
'
,
'
-s level
'
,
'
-s testType
'
,
'
-s size
'
,
'
-s timeout
'
,
'
-s package
'
])
let
targetParams
=
''
;
for
(
const
key
in
parameters
)
{
if
(
keySet
.
has
(
key
))
{
targetParams
+=
'
'
+
key
+
'
'
+
parameters
[
key
]
}
}
return
targetParams
.
trim
()
}
async
function
onAbilityCreateCallback
()
{
console
.
log
(
'
onAbilityCreateCallback
'
);
}
async
function
addAbilityMonitorCallback
(
err
:
any
)
{
console
.
info
(
'
addAbilityMonitorCallback :
'
+
JSON
.
stringify
(
err
))
}
export
default
class
OpenHarmonyTestRunner
implements
TestRunner
{
constructor
()
{
}
onPrepare
()
{
console
.
info
(
'
OpenHarmonyTestRunner OnPrepare
'
)
}
onRun
()
{
console
.
log
(
'
OpenHarmonyTestRunner onRun run
'
)
abilityDelegatorArguments
=
AbilityDelegatorRegistry
.
getArguments
()
abilityDelegator
=
AbilityDelegatorRegistry
.
getAbilityDelegator
()
let
lMonitor
=
{
abilityName
:
testAbilityName
,
onAbilityCreate
:
onAbilityCreateCallback
,
};
var
testAbilityName
=
abilityDelegatorArguments
.
parameters
[
'
-p
'
]
+
'
.TestAbility
'
abilityDelegator
.
addAbilityMonitor
(
lMonitor
,
addAbilityMonitorCallback
)
var
cmd
=
'
aa start -d 0 -a
'
+
testAbilityName
+
'
-b
'
+
abilityDelegatorArguments
.
bundleName
cmd
+=
'
'
+
translateParamsToString
(
abilityDelegatorArguments
.
parameters
)
console
.
info
(
'
cmd :
'
+
cmd
)
abilityDelegator
.
executeShellCommand
(
cmd
,
(
err
:
any
,
d
:
any
)
=>
{
console
.
info
(
'
executeShellCommand : err :
'
+
JSON
.
stringify
(
err
));
console
.
info
(
'
executeShellCommand : data :
'
+
d
.
stdResult
);
console
.
info
(
'
executeShellCommand : data :
'
+
d
.
exitCode
);
})
console
.
info
(
'
OpenHarmonyTestRunner onRun call abilityDelegator.getAppContext
'
)
var
context
=
abilityDelegator
.
getAppContext
()
console
.
info
(
'
getAppContext :
'
+
JSON
.
stringify
(
context
))
console
.
info
(
'
OpenHarmonyTestRunner onRun end
'
)
}
};
\ No newline at end of file
telephony/telephonyjstest/radiostatistic/entry/src/main/resources/base/element/string.json
浏览文件 @
574a5237
...
...
@@ -7,14 +7,6 @@
{
"name"
:
"description_mainability"
,
"value"
:
"ETS_Empty Ability"
},
{
"name"
:
"TestAbility_desc"
,
"value"
:
"description"
},
{
"name"
:
"TestAbility_label"
,
"value"
:
"label"
}
]
}
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录