Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
0233bf59
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看板
未验证
提交
0233bf59
编写于
11月 21, 2022
作者:
O
openharmony_ci
提交者:
Gitee
11月 21, 2022
浏览文件
操作
浏览文件
下载
差异文件
!6608 radiostatistic测试套整改
Merge pull request !6608 from zhangfuzhi/master
上级
0cf7e125
a99063cc
变更
10
展开全部
隐藏空白更改
内联
并排
Showing
10 changed file
with
1753 addition
and
1908 deletion
+1753
-1908
telephony/telephonyjstest/radiostatistic/entry/src/main/ets/TestAbility/app.ets
...est/radiostatistic/entry/src/main/ets/TestAbility/app.ets
+3
-3
telephony/telephonyjstest/radiostatistic/entry/src/main/ets/test/CallJsunit.test.ets
...adiostatistic/entry/src/main/ets/test/CallJsunit.test.ets
+90
-378
telephony/telephonyjstest/radiostatistic/entry/src/main/ets/test/ConvertOptionsJsunit.test.ets
...tic/entry/src/main/ets/test/ConvertOptionsJsunit.test.ets
+1377
-779
telephony/telephonyjstest/radiostatistic/entry/src/main/ets/test/DataJsunit.test.ets
...adiostatistic/entry/src/main/ets/test/DataJsunit.test.ets
+3
-5
telephony/telephonyjstest/radiostatistic/entry/src/main/ets/test/List.test.ets
...test/radiostatistic/entry/src/main/ets/test/List.test.ets
+7
-9
telephony/telephonyjstest/radiostatistic/entry/src/main/ets/test/RadioJsunit.test.ets
...diostatistic/entry/src/main/ets/test/RadioJsunit.test.ets
+30
-191
telephony/telephonyjstest/radiostatistic/entry/src/main/ets/test/RadioSecondJsunit.test.ets
...tistic/entry/src/main/ets/test/RadioSecondJsunit.test.ets
+189
-263
telephony/telephonyjstest/radiostatistic/entry/src/main/ets/test/SmsMmsJsunit.test.ets
...iostatistic/entry/src/main/ets/test/SmsMmsJsunit.test.ets
+54
-125
telephony/telephonyjstest/radiostatistic/entry/src/main/ets/test/Utils.ets
...nyjstest/radiostatistic/entry/src/main/ets/test/Utils.ets
+0
-119
telephony/telephonyjstest/radiostatistic/entry/src/main/ets/test/lib/Const.js
...stest/radiostatistic/entry/src/main/ets/test/lib/Const.js
+0
-36
未找到文件。
telephony/telephonyjstest/radiostatistic/entry/src/main/ets/TestAbility/app.ets
浏览文件 @
0233bf59
...
@@ -12,9 +12,9 @@
...
@@ -12,9 +12,9 @@
* See the License for the specific language governing permissions and
* See the License for the specific language governing permissions and
* limitations under the License.
* limitations under the License.
*/
*/
import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'
import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'
;
import { Hypium } from '
hypium/index'
import { Hypium } from '
@ohos/hypium';
import testsuite from '../test/List.test'
import testsuite from '../test/List.test'
;
export default {
export default {
onCreate() {
onCreate() {
...
...
telephony/telephonyjstest/radiostatistic/entry/src/main/ets/test/CallJsunit.test.ets
浏览文件 @
0233bf59
此差异已折叠。
点击以展开。
telephony/telephonyjstest/radiostatistic/entry/src/main/ets/test/ConvertOptionsJsunit.test.ets
浏览文件 @
0233bf59
此差异已折叠。
点击以展开。
telephony/telephonyjstest/radiostatistic/entry/src/main/ets/test/DataJsunit.test.ets
浏览文件 @
0233bf59
/**
/**
* 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")
* Licensed under the Apache License, Version 2.0 (the "License")
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* You may obtain a copy of the License at
...
@@ -12,7 +12,7 @@
...
@@ -12,7 +12,7 @@
* See the License for the specific language governing permissions and
* See the License for the specific language governing permissions and
* limitations under the License.
* limitations under the License.
*/
*/
import {describe,
beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'hypium/index'
import {describe,
it, expect} from '@ohos/hypium';
import data from '@ohos.telephony.data';
import data from '@ohos.telephony.data';
...
@@ -22,7 +22,7 @@ export function toString(data) {
...
@@ -22,7 +22,7 @@ export function toString(data) {
} else {
} else {
return data;
return data;
}
}
}
}
;
export default function dataJsunit() {
export default function dataJsunit() {
describe('dataTest', function () {
describe('dataTest', function () {
...
@@ -158,8 +158,6 @@ export default function dataJsunit() {
...
@@ -158,8 +158,6 @@ export default function dataJsunit() {
console.log(`==========> ${caseName} Test end ==========>`);
console.log(`==========> ${caseName} Test end ==========>`);
done();
done();
});
});
});
});
}
}
...
...
telephony/telephonyjstest/radiostatistic/entry/src/main/ets/test/List.test.ets
浏览文件 @
0233bf59
/**
/**
* 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");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* You may obtain a copy of the License at
...
@@ -13,16 +13,14 @@
...
@@ -13,16 +13,14 @@
* limitations under the License.
* limitations under the License.
*/
*/
//other import
import convertOptionsJsunit from './ConvertOptionsJsunit.test';
import convertOptionsJsunit from './ConvertOptionsJsunit.test.ets'
import radioJsunit from './RadioJsunit.test';
import radioJsunit from './RadioJsunit.test.ets'
import radioSecondJsunit from './RadioSecondJsunit.test';
import radioSecondJsunit from './RadioSecondJsunit.test.ets'
import smsUiJsunit from './SmsMmsJsunit.test';
import smsUiJsunit from './SmsMmsJsunit.test.ets';
import callJsunit from './CallJsunit.test';
import callJsunit from './CallJsunit.test.ets';
import dataJsunit from './DataJsunit.test';
import dataJsunit from './DataJsunit.test.ets';
export default function testsuite() {
export default function testsuite() {
//other
dataJsunit();
dataJsunit();
smsUiJsunit();
smsUiJsunit();
convertOptionsJsunit();
convertOptionsJsunit();
...
...
telephony/telephonyjstest/radiostatistic/entry/src/main/ets/test/RadioJsunit.test.ets
浏览文件 @
0233bf59
// @ts-nocheck
/**
/**
* 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");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* You may obtain a copy of the License at
...
@@ -14,228 +13,68 @@
...
@@ -14,228 +13,68 @@
* limitations under the License.
* limitations under the License.
*/
*/
import {
describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index'
import {
describe, expect, it } from '@ohos/hypium';
import radio from '@ohos.telephony.radio';
import radio from '@ohos.telephony.radio';
import utils from './Utils.ets'
export default function radioJsunit() {
export default function radioJsunit() {
describe('ActsNetworkSearchTest',function () {
describe('ActsNetworkSearchTest',
function () {
const SLOT_2 = -1;
const SLOT_0 = 0;
const SLOT_0 = 0;
/**
/**
* @tc.number
Telephony_NetworkSearch_getPrimarySlotId_Async_0200
* @tc.number Telephony_NetworkSearch_getPrimarySlotId_Async_0200
* @tc.name
Test getPrimarySlotId(-1) to check the callback result
* @tc.name Test getPrimarySlotId(-1) to check the callback result
* @tc.desc
Function test
* @tc.desc Function test
*/
*/
it('Telephony_NetworkSearch_getPrimarySlotId_Async_0200', 0, async function (done) {
it('Telephony_NetworkSearch_getPrimarySlotId_Async_0200', 0, async function (done) {
if(utils.notCheck){
done();
return;
}
radio.getPrimarySlotId((err, data) => {
radio.getPrimarySlotId((err, data) => {
if (err) {
if (err) {
console.log(
`Telephony_NetworkSearch_getPrimarySlotId_Async_0200 fail: ${err}`
);
console.log(
"Telephony_NetworkSearch_getPrimarySlotId_Async_0200 err:" + JSON.stringify(err)
);
expect(
data === undefined
).assertTrue();
expect(
false
).assertTrue();
done();
done();
return;
return;
}
}
console.log(
`Telephony_NetworkSearch_getPrimarySlotId_Async_0200 end data: ${data}`
);
console.log(
"Telephony_NetworkSearch_getPrimarySlotId_Async_0200 data:" + JSON.stringify(data)
);
expect(data ==
= ''
).assertTrue();
expect(data ==
0 || data == 1
).assertTrue();
done();
done();
});
});
});
});
/**
/**
* @tc.number
Telephony_NetworkSearch_getPrimarySlotId_Async_0300
* @tc.number Telephony_NetworkSearch_getPrimarySlotId_Async_0300
* @tc.name
testGetPrimarySlotId_0300
* @tc.name testGetPrimarySlotId_0300
* @tc.desc
Test getPrimarySlotId api by promise.
* @tc.desc Test getPrimarySlotId api by promise.
*/
*/
it('Telephony_NetworkSearch_getPrimarySlotId_Promise_0200', 0, async function (done) {
it('Telephony_NetworkSearch_getPrimarySlotId_Promise_0200', 0, async function (done) {
if(utils.notCheck){
done();
return;
}
try {
let data = await radio.getPrimarySlotId();
console.log(`Telephony_NetworkSearch_getPrimarySlotId_Promise_0200 pass data: ${data}`);
expect(true).assertTrue();
} catch (err) {
console.log(`Telephony_NetworkSearch_getPrimarySlotId_Promise_0200 fail err: ${err}`);
expect().assertFail();
done();
return;
}
done();
});
/**
* @tc.number Telephony_NetworkSearch_isNrSupported_Promise_0400
* @tc.name Test The function setPrimarySlotId(0)
* @tc.desc Function test
*/
it('Telephony_NetworkSearch_isNrSupported_Promise_0400', 0, async function (done) {
if(utils.notCheck){
done();
return;
}
try {
try {
await radio.isNrSupported(SLOT_0
);
let data = await radio.getPrimarySlotId(
);
console.log(
'radio.isNrSupported(SLOT_0) = ' + radio.isNrSupported(SLOT_0
));
console.log(
"Telephony_NetworkSearch_getPrimarySlotId_Promise_0200 data:" + JSON.stringify(data
));
console.log('Telephony_NetworkSearch_isNrSupported_Promise_0400 success'
);
expect(data == 0 || data == 1).assertTrue(
);
done();
done();
} catch (err) {
} catch (err) {
console.log(`Telephony_NetworkSearch_isNrSupported_Promise_0400 fail ${err}`);
console.log("Telephony_NetworkSearch_getPrimarySlotId_Promise_0200 err:" + JSON.stringify(err));
done();
expect(false).assertTrue();
}
});
/**
* @tc.number Telephony_radio_PreferredNetworkMode_0500
* @tc.name Test The PreferredNetworkMode enum
* @tc.desc Function test
*/
it('Telephony_radio_PreferredNetworkMode_0500', 0, async function (done) {
console.info("Telephony_radio_PreferredNetworkMode_0500 start")
if(utils.notCheck){
done();
return;
}
expect(PreferredNetworkMode.PREFERRED_NETWORK_MODE_WCDMA === 2).assertTrue();
expect(PreferredNetworkMode.PREFERRED_NETWORK_MODE_LTE === 3).assertTrue();
expect(PreferredNetworkMode.PREFERRED_NETWORK_MODE_LTE_WCDMA === 4).assertTrue();
expect(PreferredNetworkMode.PREFERRED_NETWORK_MODE_LTE_WCDMA_GSM === 5).assertTrue();
expect(PreferredNetworkMode.PREFERRED_NETWORK_MODE_WCDMA_GSM === 6).assertTrue();
console.info("Telephony_radio_PreferredNetworkMode_0500 end")
done();
});
/**
* @tc.number Telephony_radio_PreferredNetworkMode_0600
* @tc.name Test The PreferredNetworkMode enum
* @tc.desc Function test
*/
it('Telephony_radio_PreferredNetworkMode_0600', 0, async function (done) {
if(utils.notCheck){
done();
done();
return;
}
}
console.info("Telephony_radio_PreferredNetworkMode_0600 start")
expect(PreferredNetworkMode.PREFERRED_NETWORK_MODE_CDMA === 7).assertTrue();
expect(PreferredNetworkMode.PREFERRED_NETWORK_MODE_EVDO === 8).assertTrue();
expect(PreferredNetworkMode.PREFERRED_NETWORK_MODE_EVDO_CDMA === 9).assertTrue();
expect(PreferredNetworkMode.PREFERRED_NETWORK_MODE_WCDMA_GSM_EVDO_CDMA === 10).assertTrue();
expect(PreferredNetworkMode.PREFERRED_NETWORK_MODE_LTE_EVDO_CDMA === 11).assertTrue();
console.info("Telephony_radio_PreferredNetworkMode_0600 end")
done();
});
});
/**
/**
* @tc.number
Telephony_radio_PreferredNetworkMode_07
00
* @tc.number
Telephony_NetworkSearch_isNrSupported_Promise_04
00
* @tc.name
Test The PreferredNetworkMode enum
* @tc.name
Test The function setPrimarySlotId(0)
* @tc.desc
Function test
* @tc.desc Function test
*/
*/
it('Telephony_radio_PreferredNetworkMode_0700', 0, async function (done) {
it('Telephony_NetworkSearch_isNrSupported_Promise_0400', 0, async function (done) {
if(utils.notCheck){
try {
done();
let result = radio.isNrSupported();
return;
console.log("Result: " + result);
}
let result0 = radio.isNrSupported(SLOT_0);
console.info("Telephony_radio_PreferredNetworkMode_0700 start")
console.log("Result0: " + result0);
expect(PreferredNetworkMode.PREFERRED_NETWORK_MODE_LTE_WCDMA_GSM_EVDO_CDMA === 12).assertTrue();
expect(PreferredNetworkMode.PREFERRED_NETWORK_MODE_TDSCDMA === 13).assertTrue();
expect(PreferredNetworkMode.PREFERRED_NETWORK_MODE_TDSCDMA_GSM === 14).assertTrue();
expect(PreferredNetworkMode.PREFERRED_NETWORK_MODE_TDSCDMA_WCDMA === 15).assertTrue();
expect(PreferredNetworkMode.PREFERRED_NETWORK_MODE_TDSCDMA_WCDMA_GSM === 16).assertTrue();
console.info("Telephony_radio_PreferredNetworkMode_0700 end")
done();
});
/**
* @tc.number Telephony_radio_PreferredNetworkMode_0800
* @tc.name Test The PreferredNetworkMode enum
* @tc.desc Function test
*/
it('Telephony_radio_PreferredNetworkMode_0800', 0, async function (done) {
if(utils.notCheck){
done();
return;
}
console.info("Telephony_radio_PreferredNetworkMode_0800 start")
expect(PreferredNetworkMode.PREFERRED_NETWORK_MODE_LTE_TDSCDMA === 17).assertTrue();
expect(PreferredNetworkMode.PREFERRED_NETWORK_MODE_LTE_TDSCDMA_GSM === 18).assertTrue();
expect(PreferredNetworkMode.PREFERRED_NETWORK_MODE_LTE_TDSCDMA_WCDMA === 19).assertTrue();
expect(PreferredNetworkMode.PREFERRED_NETWORK_MODE_LTE_TDSCDMA_WCDMA_GSM === 20).assertTrue();
expect(PreferredNetworkMode.PREFERRED_NETWORK_MODE_TDSCDMA_WCDMA_GSM_EVDO_CDMA ===21).assertTrue();
console.info("Telephony_radio_PreferredNetworkMode_0800 end")
done();
});
/**
* @tc.number Telephony_radio_PreferredNetworkMode_0900
* @tc.name Test The PreferredNetworkMode enum
* @tc.desc Function test
*/
it('Telephony_radio_PreferredNetworkMode_0900', 0, async function (done) {
if(utils.notCheck){
done();
return;
}
console.info("Telephony_radio_PreferredNetworkMode_0900 start")
expect(PreferredNetworkMode.PREFERRED_NETWORK_MODE_LTE_TDSCDMA === 17).assertTrue();
expect(PreferredNetworkMode.PREFERRED_NETWORK_MODE_LTE_TDSCDMA_GSM === 18).assertTrue();
expect(PreferredNetworkMode.PREFERRED_NETWORK_MODE_LTE_TDSCDMA_WCDMA === 19).assertTrue();
expect(PreferredNetworkMode.PREFERRED_NETWORK_MODE_LTE_TDSCDMA_WCDMA_GSM === 20).assertTrue();
expect(PreferredNetworkMode.PREFERRED_NETWORK_MODE_TDSCDMA_WCDMA_GSM_EVDO_CDMA ===21).assertTrue();
console.info("Telephony_radio_PreferredNetworkMode_0900 end")
done();
});
/**
* @tc.number Telephony_radio_PreferredNetworkMode_1000
* @tc.name Test The PreferredNetworkMode enum
* @tc.desc Function test
*/
it('Telephony_radio_PreferredNetworkMode_1000', 0, async function (done) {
if(utils.notCheck){
done();
done();
return;
} catch (err) {
}
console.log("Telephony_NetworkSearch_isNrSupported_Promise_0400 err" + JSON.stringify(err));
console.info("Telephony_radio_PreferredNetworkMode_1000 start")
expect(false).assertTrue();
expect(PreferredNetworkMode.PREFERRED_NETWORK_MODE_LTE_TDSCDMA_WCDMA_GSM_EVDO_CDMA === 22).assertTrue();
expect(PreferredNetworkMode.PREFERRED_NETWORK_MODE_NR === 31).assertTrue();
expect(PreferredNetworkMode.PREFERRED_NETWORK_MODE_NR_LTE === 32).assertTrue();
expect(PreferredNetworkMode.PREFERRED_NETWORK_MODE_NR_LTE_WCDMA === 33).assertTrue();
expect(PreferredNetworkMode.PREFERRED_NETWORK_MODE_NR_LTE_WCDMA_GSM ===34).assertTrue();
console.info("Telephony_radio_PreferredNetworkMode_1000 end")
done();
});
/**
* @tc.number Telephony_radio_PreferredNetworkMode_1100
* @tc.name Test The PreferredNetworkMode enum
* @tc.desc Function test
*/
it('Telephony_radio_PreferredNetworkMode_1100', 0, async function (done) {
if(utils.notCheck){
done();
done();
return;
}
}
console.info("Telephony_radio_PreferredNetworkMode_1100 start")
expect(PreferredNetworkMode.PREFERRED_NETWORK_MODE_NR_LTE_EVDO_CDMA === 35).assertTrue();
expect(PreferredNetworkMode.PREFERRED_NETWORK_MODE_NR_LTE_WCDMA_GSM_EVDO_CDMA === 36).assertTrue();
expect(PreferredNetworkMode.PREFERRED_NETWORK_MODE_NR_LTE_TDSCDMA === 37).assertTrue();
expect(PreferredNetworkMode.PREFERRED_NETWORK_MODE_NR_LTE_TDSCDMA_GSM === 38).assertTrue();
expect(PreferredNetworkMode.PREFERRED_NETWORK_MODE_NR_LTE_TDSCDMA_WCDMA ===39).assertTrue();
expect(PreferredNetworkMode.PREFERRED_NETWORK_MODE_NR_LTE_TDSCDMA_WCDMA_GSM === 40).assertTrue();
expect(PreferredNetworkMode.PREFERRED_NETWORK_MODE_NR_LTE_TDSCDMA_WCDMA_GSM_EVDO_CDMA === 41).assertTrue();
expect(PreferredNetworkMode.PREFERRED_NETWORK_MODE_MAX_VALUE === 99).assertTrue();
console.info("Telephony_radio_PreferredNetworkMode_1100 end")
done();
});
});
})
})
}
}
telephony/telephonyjstest/radiostatistic/entry/src/main/ets/test/RadioSecondJsunit.test.ets
浏览文件 @
0233bf59
此差异已折叠。
点击以展开。
telephony/telephonyjstest/radiostatistic/entry/src/main/ets/test/SmsMmsJsunit.test.ets
浏览文件 @
0233bf59
// @ts-nocheck
/**
/**
* 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");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* You may obtain a copy of the License at
...
@@ -13,30 +12,18 @@
...
@@ -13,30 +12,18 @@
* See the License for the specific language governing permissions and
* See the License for the specific language governing permissions and
* limitations under the License.
* limitations under the License.
*/
*/
import {
describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "deccjsunit/index.ets"
;
import {
describe, expect, it } from '@ohos/hypium'
;
import
m
ms from '@ohos.telephony.sms';
import
s
ms from '@ohos.telephony.sms';
import utils from './Utils.ets'
export default function smsUiJsunit() {
export default function smsUiJsunit() {
describe('appInfoTest', function () {
describe('smsUiJsunit', function () {
const SMS_SEND_DST_NUMBER = '';
const TRUE_SLOT_ID = 0;
const FALSE_SLOT_ID = 9;
const OTHER_SLOT_ID = 1;
const SECOND_SLOT_ID = 2;
const IDENTIFIER_MIN = 0;
const IDENTIFIER_MAX = 0xFFFF;
const RANTYPE_GSM = 1;
const RANTYPE_CDMA = 2;
const RANTYPE_ERROR = 3;
var rawArray = [
var rawArray = [
0x08, 0x91, 0x68, 0x31, 0x08, 0x20, 0x00, 0x75, 0xF4, 0x24, 0x0D, 0x91,
0x08, 0x91, 0x68, 0x31, 0x08, 0x20, 0x00, 0x75, 0xF4, 0x24, 0x0D, 0x91,
0x68, 0x81, 0x29, 0x56, 0x29, 0x83, 0xF6, 0x00, 0x00, 0x12, 0x40, 0x80,
0x68, 0x81, 0x29, 0x56, 0x29, 0x83, 0xF6, 0x00, 0x00, 0x12, 0x40, 0x80,
0x01, 0x02, 0x14, 0x23, 0x02, 0xC1, 0x30
0x01, 0x02, 0x14, 0x23, 0x02, 0xC1, 0x30
]
]
;
/*
/*
* @tc.number Telephony_SmsMms_createMessage_Async_0100
* @tc.number Telephony_SmsMms_createMessage_Async_0100
* @tc.name Call interface CreateMessage,
* @tc.name Call interface CreateMessage,
...
@@ -45,11 +32,6 @@ export default function smsUiJsunit() {
...
@@ -45,11 +32,6 @@ export default function smsUiJsunit() {
* @tc.desc Function test
* @tc.desc Function test
*/
*/
it('Telephony_SmsMms_createMessage_Async_0100', 0, async function (done) {
it('Telephony_SmsMms_createMessage_Async_0100', 0, async function (done) {
if (true) {
expect(true).assertTrue();
done();
return;
}
sms.createMessage(rawArray, '3gpp', (err, shortMessage) => {
sms.createMessage(rawArray, '3gpp', (err, shortMessage) => {
if (err) {
if (err) {
expect().assertFail();
expect().assertFail();
...
@@ -57,74 +39,59 @@ export default function smsUiJsunit() {
...
@@ -57,74 +39,59 @@ export default function smsUiJsunit() {
done();
done();
return;
return;
}
}
expect(shortMessage.visibleMessageBody === MESSAGEBODY).assertTrue();
console.log("dxj fail shortMessage:" + JSON.stringify(shortMessage));
expect(shortMessage.visibleRawAddress.length === ADDR_LENGTH).assertTrue();
expect(shortMessage.visibleMessageBody == "Aa").assertTrue();
expect(shortMessage.messageClass === sms.FORWARD_MESSAGE).assertTrue();
console.log("dxj fail visibleMessageBody:" + shortMessage.visibleMessageBody);
expect(shortMessage.protocolId === 0).assertTrue();
expect(shortMessage.visibleRawAddress.length !== 0).assertTrue();
expect(shortMessage.scAddress.length === ADDR_LENGTH).assertTrue();
console.log("dxj fail visibleRawAddress:" + shortMessage.visibleRawAddress);
expect(shortMessage.scTimestamp === SC_TIMESTAMP).assertTrue();
expect(shortMessage.messageClass !== -1).assertTrue();
console.log("dxj fail messageClass:" + shortMessage.messageClass);
expect(shortMessage.protocolId !== -1).assertTrue();
console.log("dxj fail protocolId:" + shortMessage.protocolId);
expect(shortMessage.scAddress.length !== 0).assertTrue();
console.log("dxj fail scAddress:" + shortMessage.scAddress);
expect(shortMessage.scTimestamp !== 0).assertTrue();
console.log("dxj fail scTimestamp:" + shortMessage.scTimestamp);
expect(shortMessage.isReplaceMessage).assertFalse();
expect(shortMessage.isReplaceMessage).assertFalse();
console.log("dxj fail isReplaceMessage:" + shortMessage.isReplaceMessage);
expect(shortMessage.hasReplyPath).assertFalse();
expect(shortMessage.hasReplyPath).assertFalse();
expect(shortMessage.pdu.length > 0).assertTrue();
console.log("dxj fail hasReplyPath:" + shortMessage.hasReplyPath);
expect(shortMessage.status === 0).assertTrue();
expect(shortMessage.pdu == undefined).assertFalse();
console.log("dxj fail pdu:" + shortMessage.pdu);
expect(shortMessage.status !== -1).assertTrue();
console.log("dxj fail status:" + shortMessage.status);
expect(shortMessage.isSmsStatusReportMessage).assertTrue();
expect(shortMessage.isSmsStatusReportMessage).assertTrue();
console.log(
'Telephony_SmsMms_createMessage_Async_0100 finish'
);
console.log(
"dxj fail isSmsStatusReportMessage:" + shortMessage.isSmsStatusReportMessage
);
done();
done();
});
});
});
});
/*
/*
* @tc.number Telephony_SmsMms_createMessage_Async_0300
* @tc.number Telephony_SmsMms_createMessage_Async_0300
* @tc.name testCreateMessage_0300
* @tc.name testCreateMessage_0300
* @tc.desc Call interface CreateMessage,
* @tc.desc Call interface CreateMessage,
* pass in the PDU(rawArray) in line with the coding specification, the specification is 3GPP,
* pass in the PDU(rawArray) in line with the coding specification, the specification is 3GPP,
* shortMessage Don't empty
* shortMessage Don't empty
*/
*/
it('Telephony_SmsMms_createMessage_Promise_0100', 0, async function (done) {
it('Telephony_SmsMms_createMessage_Promise_0100', 0, async function (done) {
if (true) {
expect(true).assertTrue();
done();
return;
}
sms.createMessage(rawArray, '3gpp').then(shortMessage => {
sms.createMessage(rawArray, '3gpp').then(shortMessage => {
expect(shortMessage.visibleMessageBody ==
= MESSAGEBODY
).assertTrue();
expect(shortMessage.visibleMessageBody ==
"Aa"
).assertTrue();
expect(shortMessage.visibleRawAddress.length
=== ADDR_LENGTH
).assertTrue();
expect(shortMessage.visibleRawAddress.length
!== 0
).assertTrue();
expect(shortMessage.messageClass
=== sms.FORWARD_MESSAGE
).assertTrue();
expect(shortMessage.messageClass
!== -1
).assertTrue();
expect(shortMessage.protocolId
=== 0
).assertTrue();
expect(shortMessage.protocolId
!== -1
).assertTrue();
expect(shortMessage.scAddress.length
=== ADDR_LENGTH
).assertTrue();
expect(shortMessage.scAddress.length
!== 0
).assertTrue();
expect(shortMessage.scTimestamp
=== SC_TIMESTAMP
).assertTrue();
expect(shortMessage.scTimestamp
!== 0
).assertTrue();
expect(shortMessage.isReplaceMessage).assertFalse();
expect(shortMessage.isReplaceMessage).assertFalse();
expect(shortMessage.hasReplyPath).assertFalse();
expect(shortMessage.hasReplyPath).assertFalse();
expect(shortMessage.pdu
.length > 0).assertTru
e();
expect(shortMessage.pdu
== undefined).assertFals
e();
expect(shortMessage.status
=== 0
).assertTrue();
expect(shortMessage.status
!== -1
).assertTrue();
expect(shortMessage.isSmsStatusReportMessage).assertTrue();
expect(shortMessage.isSmsStatusReportMessage).assertTrue();
console.log('Telephony_SmsMms_createMessage_Promise_0100 finish');
done();
done();
}).catch(err => {
}).catch(err => {
expect().assertFail();
expect().assertFail();
console.log('Telephony_SmsMms_createMessage_Promise_0100 fail');
console.log('Telephony_SmsMms_createMessage_Promise_0100 fail' + JSON.stringify(err));
done();
return;
});
});
/*
* @tc.number Telephony_SmsMms_getSmsEncodingScheme_Async_0100
* @tc.name
* @tc.desc Function test
*/
it('Telephony_SmsMms_getSmsEncodingScheme_Async_0100', 0, async function (done) {
if (true) {
expect(true).assertTrue();
done();
done();
return;
});
}
expect(sms.SMS_ENCODING_UNKNOWN == 0).assertTrue();
expect(sms.SMS_ENCODING_7BIT == 1).assertTrue();
expect(sms.SMS_ENCODING_8BIT == 2).assertTrue();
expect(sms.SMS_ENCODING_16BIT == 3).assertTrue();
done();
});
});
/*
/*
...
@@ -133,18 +100,10 @@ export default function smsUiJsunit() {
...
@@ -133,18 +100,10 @@ export default function smsUiJsunit() {
* @tc.desc Function test
* @tc.desc Function test
*/
*/
it('Telephony_SmsMms_getSendSmsResult_Async_0100', 0, async function (done) {
it('Telephony_SmsMms_getSendSmsResult_Async_0100', 0, async function (done) {
if (true) {
expect(sms.SendSmsResult.SEND_SMS_SUCCESS == 0).assertTrue();
expect(true).assertTrue();
expect(sms.SendSmsResult.SEND_SMS_FAILURE_UNKNOWN == 1).assertTrue();
done();
expect(sms.SendSmsResult.SEND_SMS_FAILURE_RADIO_OFF == 2).assertTrue();
return;
expect(sms.SendSmsResult.SEND_SMS_FAILURE_SERVICE_UNAVAILABLE == 3).assertTrue();
}
expect(sms.SEND_SMS_SUCCESS == 0).assertTrue();
expect(sms.SEND_SMS_FAILURE_UNKNOWN == 1).assertTrue();
expect(sms.SEND_SMS_FAILURE_RADIO_OFF == 2).assertTrue();
expect(sms.SEND_SMS_FAILURE_SERVICE_UNAVAILABLE == 3).assertTrue();
expect(sms.SIM_MESSAGE_STATUS_FREE == 0).assertTrue();
expect(sms.INSTANT_MESSAGE == 1).assertTrue();
expect(sms.OPTIONAL_MESSAGE == 2).assertTrue();
done();
done();
});
});
...
@@ -154,41 +113,11 @@ export default function smsUiJsunit() {
...
@@ -154,41 +113,11 @@ export default function smsUiJsunit() {
* @tc.desc Function test
* @tc.desc Function test
*/
*/
it('Telephony_SmsMms_ShortMessageClass_Async_0100', 0, async function (done) {
it('Telephony_SmsMms_ShortMessageClass_Async_0100', 0, async function (done) {
if (true) {
expect(sms.ShortMessageClass.UNKNOWN == 0).assertTrue();
expect(true).assertTrue();
expect(sms.ShortMessageClass.INSTANT_MESSAGE == 1).assertTrue();
done();
expect(sms.ShortMessageClass.OPTIONAL_MESSAGE == 2).assertTrue();
return;
expect(sms.ShortMessageClass.SIM_MESSAGE == 3).assertTrue();
}
expect(sms.ShortMessageClass.FORWARD_MESSAGE == 4).assertTrue();
expect(sms.SIM_MESSAGE_STATUS_FREE == 0).assertTrue();
expect(sms.INSTANT_MESSAGE == 1).assertTrue();
expect(sms.OPTIONAL_MESSAGE == 2).assertTrue();
done();
});
/*
* @tc.number Telephony_SmsMms_getMmsCharSets_Async_0100
* @tc.name
* @tc.desc Function test
*/
it('Telephony_SmsMms_getMmsCharSets_Async_0100', 0, async function (done) {
if (true) {
expect(true).assertTrue();
done();
return;
}
expect(sms.BIG5 == 0X07EA).assertTrue();
expect(sms.ISO_10646_UCS_2 == 0X03E8).assertTrue();
expect(sms.ISO_8859_1 == 0X04).assertTrue();
expect(sms.ISO_8859_2 == 0X05).assertTrue();
expect(sms.ISO_8859_3 == 0X06).assertTrue();
expect(sms.ISO_8859_4 == 0X07).assertTrue();
expect(sms.ISO_8859_5 == 0X08).assertTrue();
expect(sms.ISO_8859_6 == 0X09).assertTrue();
expect(sms.ISO_8859_7 == 0X10).assertTrue();
expect(sms.ISO_8859_8 == 0X12).assertTrue();
expect(sms.ISO_8859_9 == 0X13).assertTrue();
expect(sms.SHIFT_JIS == 0X11).assertTrue();
expect(sms.US_ASCII == 0X03).assertTrue();
expect(sms.UTF_8 == 0X6A).assertTrue();
done();
done();
});
});
})
})
...
...
telephony/telephonyjstest/radiostatistic/entry/src/main/ets/test/Utils.ets
已删除
100644 → 0
浏览文件 @
0cf7e125
// @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/radiostatistic/entry/src/main/ets/test/lib/Const.js
已删除
100644 → 0
浏览文件 @
0cf7e125
/**
* 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.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录