提交 ca5deaf3 编写于 作者: S shuxiong

telephony testcase update

Signed-off-by: Nshuxiong <shuxiong@huawei.com>
上级 e3240098
......@@ -13,9 +13,5 @@
group("telephony") {
testonly = true
deps = [
#"telephonycpptest:telephonycpptest",
#"telephonyothertest:telephonyothertest",
"telephonyjstest:telephonyjstest",
]
deps = [ "telephonyjstest:telephonyjstest" ]
}
......@@ -16,9 +16,9 @@ import("//build/ohos_var.gni")
group("telephonyjstest") {
testonly = true
deps = [
#"network_search:network_search",
#"sms_mms:sms_mms",
#"call_manager:call_manager",
"call_manager:call_manager",
"network_search:network_search",
"sim:sim",
"sms_mms:sms_mms",
]
}
......@@ -2,10 +2,10 @@
"description": "Configuration for callmanager Tests",
"driver": {
"type": "JSUnitTest",
"test-timeout": "120000",
"test-timeout": "1200000",
"package": "com.ohos.callmanager",
"shell-timeout": "21600000",
"native-test-timeout":"21600000"
"shell-timeout": "1200000",
"native-test-timeout":"1200000"
},
"kits": [
{
......
......@@ -30,17 +30,16 @@ export default {
this.title = this.$t('strings.world');
},
onShow() {
console.info('onShow finish!')
console.info('onShow finish')
const core = Core.getInstance()
const expectExtend = new ExpectExtend({
'id': 'extend'
})
core.addService('expect', expectExtend)
core.init()
const configService = core.getDefaultService('config')
configService.timeout = 8000;
configService.setConfig(this)
require('../../../test/List.test')
core.execute()
},
......
......@@ -13,7 +13,7 @@
* limitations under the License.
*/
import call from '@ohos.telephony_call';
import call from '@ohos.telephony.call';
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index';
describe('CallManagerMMI', function () {
......
......@@ -2,10 +2,10 @@
"description": "Configuration for callmanager Tests",
"driver": {
"type": "JSUnitTest",
"test-timeout": "360000",
"test-timeout": "3000000",
"package": "com.ohos.callmanager",
"shell-timeout": "21600000",
"native-test-timeout":"21600000"
"shell-timeout": "3000000",
"native-test-timeout":"3000000"
},
"kits": [
{
......
......@@ -30,17 +30,16 @@ export default {
this.title = this.$t('strings.world');
},
onShow() {
console.info('onShow finish!')
console.info('onShow finish')
const core = Core.getInstance()
const expectExtend = new ExpectExtend({
'id': 'extend'
})
core.addService('expect', expectExtend)
core.init()
const configService = core.getDefaultService('config')
configService.timeout = 30000;
configService.setConfig(this)
require('../../../test/List.test')
core.execute()
},
......
......@@ -2,10 +2,10 @@
"description": "Configuration for callmanager Tests",
"driver": {
"type": "JSUnitTest",
"test-timeout": "240000",
"test-timeout": "4800000",
"package": "com.ohos.callmanager",
"shell-timeout": "21600000",
"native-test-timeout":"21600000"
"shell-timeout": "4800000",
"native-test-timeout":"4800000"
},
"kits": [
{
......
......@@ -30,17 +30,16 @@ export default {
this.title = this.$t('strings.world');
},
onShow() {
console.info('onShow finish!')
console.info('onShow finish')
const core = Core.getInstance()
const expectExtend = new ExpectExtend({
'id': 'extend'
})
core.addService('expect', expectExtend)
core.init()
const configService = core.getDefaultService('config')
configService.timeout = 15000;
configService.setConfig(this)
require('../../../test/List.test')
core.execute()
},
......
#!/bin/bash
# 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.
......@@ -11,21 +13,30 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import("//test/xts/tools/build/suite.gni")
ohos_js_hap_suite("SmsMmsPerformance") {
hap_profile = "./entry/src/main/config.json"
deps = [
":hjs_demo_js_assets",
":hjs_demo_resources",
]
certificate_profile = "./signature/openharmony_sx.p7b"
hap_name = "SmsMmsPerformance"
}
ohos_js_assets("hjs_demo_js_assets") {
source_dir = "./entry/src/main/js/default"
}
ohos_resources("hjs_demo_resources") {
sources = [ "./entry/src/main/js/resources" ]
hap_profile = "./entry/src/main/config.json"
}
# 配置发送短信的电话号码
config_const_var[0]="const SMS_SEND_DST_NUMBER = '138xxxxxxxx';"
for((i = 0; i < ${#config_const_var}; i++))
do
if [ "${config_const_var[i]}" == "" ]; then
continue
fi
grep_result=``
key=`echo ${config_const_var[i]}| awk -F= '{print $1}'`
for line in `grep -nr "${key}"| sed 's/ //g'|grep -v "config.sh"`
do
file=`echo ${line}|awk -F: '{print $1}'`
line_no=`echo ${line}|awk -F: '{print $2}'`
echo $file $line_no
echo old:`grep "${key}" $file`
if [ "$1" != "-i" ]; then
echo preview:`sed $1 "s/${key}.*/${config_const_var[i]}/g" $file | grep "${key}"`
else
sed $1 "s/${key}.*/${config_const_var[i]}/g" $file | grep "${key}"
echo new:`sed "s/${key}.*/${config_const_var[i]}/g" $file | grep "${key}"`
fi
done
done
......@@ -37,8 +37,8 @@ export default {
core.init()
const configService = core.getDefaultService('config')
configService.timeout = 8000
configService.setConfig(this)
require('../../../test/List.test')
core.execute()
},
......
......@@ -13,7 +13,7 @@
* limitations under the License.
*/
import radio from '@ohos.telephony_radio';
import radio from '@ohos.telephony.radio';
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit/index';
describe('NetworkSearchTest', function () {
......@@ -65,9 +65,6 @@ describe('NetworkSearchTest', function () {
const ISO_COUNTRY_CODE = 'cn';
const PLMN_SIZE = 5;
afterAll(async function () {
console.log('Telephony_NetworkSearch_InformationTest End!!!');
});
/**
* @tc.number Telephony_NetworkSearch_getNetworkState_Async_0100
......@@ -100,7 +97,7 @@ describe('NetworkSearchTest', function () {
data.plmnNumeric != null
).assertTrue();
expect(data.plmnNumeric.length == 5 && data.plmnNumeric.substr(0, 3) === '460').assertTrue();
expect(data.regStatus === 1).assertTrue();
expect(garrRegState).assertContain(data.regStatus);
expect(data.nsaState === 1).assertTrue();
expect(data.isRoaming === false).assertTrue();
expect(data.isCaActive === false).assertTrue();
......@@ -132,7 +129,7 @@ describe('NetworkSearchTest', function () {
data.shortOperatorName != undefined && data.shortOperatorName != '' && data.shortOperatorName != null
).assertTrue();
expect(data.plmnNumeric.length === PLMN_SIZE && data.plmnNumeric.substr(0, 3) === '460').assertTrue();
expect(data.regStatus === 1).assertTrue();
expect(garrRegState).assertContain(data.regStatus);
expect(data.nsaState === 1).assertTrue();
expect(data.isRoaming === false).assertTrue();
expect(data.isCaActive === false).assertTrue();
......@@ -274,7 +271,7 @@ describe('NetworkSearchTest', function () {
data.shortOperatorName != undefined && data.shortOperatorName != '' && data.shortOperatorName != null
).assertTrue();
expect(data.plmnNumeric.length === PLMN_SIZE && data.plmnNumeric.substr(0, 3) === '460').assertTrue();
expect(data.regStatus === 1).assertTrue();
expect(garrRegState).assertContain(data.regStatus);
expect(data.nsaState === 1).assertTrue();
expect(data.isRoaming === false).assertTrue();
expect(data.isCaActive === false).assertTrue();
......@@ -307,7 +304,7 @@ describe('NetworkSearchTest', function () {
data.shortOperatorName != undefined && data.shortOperatorName != '' && data.shortOperatorName != null
).assertTrue();
expect(data.plmnNumeric.length === PLMN_SIZE && data.plmnNumeric.substr(0, 3) === '460').assertTrue();
expect(data.regStatus === 1).assertTrue();
expect(garrRegState).assertContain(data.regStatus);
expect(data.nsaState === 1).assertTrue();
expect(data.isRoaming === false).assertTrue();
expect(data.isCaActive === false).assertTrue();
......@@ -445,9 +442,9 @@ describe('NetworkSearchTest', function () {
done();
return;
}
expect(data === ISO_COUNTRY_CODE).assertTrue();
console.log(
`Telephony_NetworkSearch_getISOCountryCodeForNetwork_Async_0100 finish data: ${JSON.stringify(data)}`);
expect(data === ISO_COUNTRY_CODE).assertTrue();
done();
});
});
......
# 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.
import("//test/xts/tools/build/suite.gni")
ohos_js_hap_suite("NetworkSearchPerformance") {
hap_profile = "./entry/src/main/config.json"
deps = [
":hjs_demo_js_assets",
":hjs_demo_resources",
]
certificate_profile = "./signature/openharmony_sx.p7b"
hap_name = "NetworkSearchPerformance"
}
ohos_js_assets("hjs_demo_js_assets") {
source_dir = "./entry/src/main/js/default"
}
ohos_resources("hjs_demo_resources") {
sources = [ "./entry/src/main/js/resources" ]
hap_profile = "./entry/src/main/config.json"
}
{
"description": "Configuration for NetworkSearch Tests",
"driver": {
"type": "JSUnitTest",
"test-timeout": "1800",
"package": "com.ohos.networksearch",
"shell-timeout": "1800",
"native-test-timeout":"1800"
},
"kits": [
{
"test-file-name": [
"$module.hap"
],
"type": "AppInstallKit",
"cleanup-apps": true
}
]
}
{
"app": {
"bundleName": "com.ohos.networksearch",
"vendor": "ohos",
"version": {
"code": 1000000,
"name": "1.0.0"
},
"apiVersion": {
"compatible": 4,
"target": 5,
"releaseType": "Release"
}
},
"deviceConfig": {},
"module": {
"package": "com.ohos.networksearch",
"name": ".MyApplication",
"deviceType": [
"phone"
],
"distro": {
"deliveryWithInstall": true,
"moduleName": "entry",
"moduleType": "entry"
},
"abilities": [
{
"visible": true,
"skills": [
{
"entities": [
"entity.system.home"
],
"actions": [
"action.system.home"
]
}
],
"name": "com.ohos.networksearch.MainAbility",
"icon": "$media:icon",
"description": "$string:mainability_description",
"label": "$string:app_name",
"type": "page",
"launchType": "standard"
}
],
"js": [
{
"pages": [
"pages/index/index"
],
"name": "default",
"window": {
"designWidth": 720,
"autoDesignWidth": false
}
}
]
}
}
\ No newline at end of file
/*
* 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 {
onCreate() {
console.info('AceApplication onCreate');
},
onDestroy() {
console.info('AceApplication onDestroy');
}
};
{
"strings": {
"hello": "您好",
"world": "世界"
}
}
\ No newline at end of file
.container {
flex-direction: column;
justify-content: center;
align-items: center;
}
.title {
font-size: 100px;
}
<div class="container">
<text class="title">
{{ $t('strings.hello') }} {{ title }}
</text>
</div>
/*
* 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.
*/
import file from '@system.file'
import app from '@system.app'
import device from '@system.device'
import router from '@system.router'
import {Core, ExpectExtend} from 'deccjsunit/index'
const injectRef = Object.getPrototypeOf(global) || global
injectRef.regeneratorRuntime = require('@babel/runtime/regenerator')
export default {
data: {
title: ""
},
onInit() {
this.title = this.$t('strings.world');
},
onShow() {
console.info('onShow finish!')
const core = Core.getInstance()
const expectExtend = new ExpectExtend({
'id': 'extend'
})
core.addService('expect', expectExtend)
core.init()
const configService = core.getDefaultService('config')
configService.setConfig(this)
require('../../../test/List.test')
core.execute()
},
onReady() {
},
}
\ No newline at end of file
{
"string": [
{
"name": "app_name",
"value": "MyApplication"
},
{
"name": "mainability_description",
"value": "JS_Phone_Empty Feature Ability"
}
]
}
\ No newline at end of file
/*
* 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.
*/
require('./NetworkSearchPerformance.test.js');
{
"string": [
{
"name": "app_name",
"value": "NetworkSearchTest"
},
{
"name": "mainability_description",
"value": "JS_Phone_Empty Feature Ability"
}
]
}
\ No newline at end of file
......@@ -37,6 +37,7 @@ export default {
core.init()
const configService = core.getDefaultService('config')
configService.timeout = 8000
configService.setConfig(this)
require('../../../test/List.test')
......
......@@ -13,7 +13,7 @@
* limitations under the License.
*/
import radio from '@ohos.telephony_radio';
import radio from '@ohos.telephony.radio';
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit/index';
describe('NetworkSearchTest', function () {
......@@ -22,31 +22,21 @@ describe('NetworkSearchTest', function () {
const ISO_COUNTRY_CODE = 'cn';
const PLMN_SIZE = 5;
async function recoverRadioState() {
try {
await radio.turnOnRadio();
console.log('Telephony_NetworkSearch_recoverRadioState success');
} catch (err) {
console.log(`Telephony_NetworkSearch_recoverRadioState fail ${err}`);
}
}
beforeEach(async function () {
recoverRadioState();
});
afterAll(async function () {
//Initialize radio status after all test cases
recoverRadioState();
console.log('Telephony_NetworkSearch_RadioTest End!!!');
});
/**
* @tc.number Telephony_NetworkSearch_turnOnRadio_Async_0100
* @tc.name Radio is off, test The Radio module is turned on and the Radio status is changed to 'true'
* @tc.desc Function test
*/
it('Telephony_NetworkSearch_turnOnRadio_Async_0100', 0, async function (done) {
try {
await radio.turnOnRadio();
console.log('Telephony_NetworkSearch_recoverRadioState success');
} catch (err) {
console.log(`Telephony_NetworkSearch_recoverRadioState fail ${err}`);
expect().assertFail();
done();
return;
}
radio.turnOffRadio((err) => {
if (err) {
console.log(`Telephony_NetworkSearch_turnOnRadio_Async_0100 turnOff fail: ${err}`);
......@@ -84,6 +74,15 @@ describe('NetworkSearchTest', function () {
* @tc.desc Function test
*/
it('Telephony_NetworkSearch_turnOnRadio_Async_0200', 0, async function (done) {
try {
await radio.turnOnRadio();
console.log('Telephony_NetworkSearch_recoverRadioState success');
} catch (err) {
console.log(`Telephony_NetworkSearch_recoverRadioState fail ${err}`);
expect().assertFail();
done();
return;
}
radio.turnOnRadio((err) => {
if (err) {
console.log(`Telephony_NetworkSearch_turnOnRadio_Async_0200 turnOn1 fail: ${err}`);
......@@ -121,6 +120,15 @@ describe('NetworkSearchTest', function () {
* @tc.desc Function test
*/
it('Telephony_NetworkSearch_turnOffRadio_Async_0100', 0, async function (done) {
try {
await radio.turnOnRadio();
console.log('Telephony_NetworkSearch_recoverRadioState success');
} catch (err) {
console.log(`Telephony_NetworkSearch_recoverRadioState fail ${err}`);
expect().assertFail();
done();
return;
}
radio.turnOnRadio((err) => {
if (err) {
console.log(`Telephony_NetworkSearch_turnOffRadio_Async_0100 turnOn fail: ${err}`);
......@@ -158,6 +166,15 @@ describe('NetworkSearchTest', function () {
* @tc.desc Function test
*/
it('Telephony_NetworkSearch_turnOffRadio_Async_0200', 0, async function (done) {
try {
await radio.turnOnRadio();
console.log('Telephony_NetworkSearch_recoverRadioState success');
} catch (err) {
console.log(`Telephony_NetworkSearch_recoverRadioState fail ${err}`);
expect().assertFail();
done();
return;
}
radio.turnOffRadio((err) => {
if (err) {
console.log(`Telephony_NetworkSearch_turnOffRadio_Async_0200 turnOff1 fail: ${err}`);
......@@ -192,11 +209,22 @@ describe('NetworkSearchTest', function () {
/**
* @tc.number Telephony_NetworkSearch_turnOffRadio_Async_0500
* @tc.name Radio is off, test the getNetworkState() longOperatorName is null and shortOperatorName is null and
* plmnNumeric is null and regStatus is REG_STATE_EMERGENCY_CALL_ONLY and nsaState is NSA_STATE_NOT_SUPPORT and
* plmnNumeric is null and regStatus is REG_STATE_EMERGENCY_CALL_ONLY and nsaState is
* NSA_STATE_NOT_SUPPORT and
* isRoaming is false and isCaActive is false and isEmergency is false
* @tc.desc Function test
*/
it('Telephony_NetworkSearch_turnOffRadio_Async_0500', 0, async function (done) {
try {
await radio.turnOnRadio();
console.log('Telephony_NetworkSearch_recoverRadioState success');
} catch (err) {
console.log(`Telephony_NetworkSearch_recoverRadioState fail ${err}`);
expect().assertFail();
done();
return;
}
radio.turnOffRadio((err) => {
if (err) {
console.log(`Telephony_NetworkSearch_turnOffRadio_Async_0500 turnOff fail err: ${err}`);
......@@ -239,6 +267,15 @@ describe('NetworkSearchTest', function () {
* @tc.desc Function test
*/
it('Telephony_NetworkSearch_turnOffRadio_Async_0600', 0, async function (done) {
try {
await radio.turnOnRadio();
console.log('Telephony_NetworkSearch_recoverRadioState success');
} catch (err) {
console.log(`Telephony_NetworkSearch_recoverRadioState fail ${err}`);
expect().assertFail();
done();
return;
}
radio.turnOffRadio((err) => {
if (err) {
console.log(`Telephony_NetworkSearch_turnOffRadio_Async_0600 turnOff fail err: ${err}`);
......@@ -269,6 +306,15 @@ describe('NetworkSearchTest', function () {
* @tc.desc Function test
*/
it('Telephony_NetworkSearch_turnOffRadio_Async_0700', 0, async function (done) {
try {
await radio.turnOnRadio();
console.log('Telephony_NetworkSearch_recoverRadioState success');
} catch (err) {
console.log(`Telephony_NetworkSearch_recoverRadioState fail ${err}`);
expect().assertFail();
done();
return;
}
radio.turnOffRadio((err) => {
if (err) {
console.log(`Telephony_NetworkSearch_turnOffRadio_Async_0700 turnOff fail err: ${err}`);
......@@ -300,6 +346,15 @@ describe('NetworkSearchTest', function () {
* @tc.desc Function test
*/
it('Telephony_NetworkSearch_isRadioOn_Async_0100', 0, async function (done) {
try {
await radio.turnOnRadio();
console.log('Telephony_NetworkSearch_recoverRadioState success');
} catch (err) {
console.log(`Telephony_NetworkSearch_recoverRadioState fail ${err}`);
expect().assertFail();
done();
return;
}
radio.turnOffRadio((err) => {
if (err) {
console.log(`Telephony_NetworkSearch_isRadioOn_Async_0100 turnOff fail err: ${err}`);
......@@ -329,6 +384,15 @@ describe('NetworkSearchTest', function () {
* @tc.desc Function test
*/
it('Telephony_NetworkSearch_isRadioOn_Async_0200', 0, async function (done) {
try {
await radio.turnOnRadio();
console.log('Telephony_NetworkSearch_recoverRadioState success');
} catch (err) {
console.log(`Telephony_NetworkSearch_recoverRadioState fail ${err}`);
expect().assertFail();
done();
return;
}
radio.turnOnRadio((err) => {
if (err) {
console.log(`Telephony_NetworkSearch_isRadioOn_Async_0200 turnOn fail err:${err}`);
......@@ -357,6 +421,15 @@ describe('NetworkSearchTest', function () {
* @tc.desc Function test
*/
it('Telephony_NetworkSearch_turnOnRadio_Promise_0100', 0, async function (done) {
try {
await radio.turnOnRadio();
console.log('Telephony_NetworkSearch_recoverRadioState success');
} catch (err) {
console.log(`Telephony_NetworkSearch_recoverRadioState fail ${err}`);
expect().assertFail();
done();
return;
}
try {
await radio.turnOffRadio();
console.log('Telephony_NetworkSearch_turnOnRadio_Promise_0100 turnOff finish');
......@@ -395,6 +468,15 @@ describe('NetworkSearchTest', function () {
* @tc.desc Function test
*/
it('Telephony_NetworkSearch_turnOnRadio_Promise_0200', 0, async function (done) {
try {
await radio.turnOnRadio();
console.log('Telephony_NetworkSearch_recoverRadioState success');
} catch (err) {
console.log(`Telephony_NetworkSearch_recoverRadioState fail ${err}`);
expect().assertFail();
done();
return;
}
try {
await radio.turnOnRadio();
console.log('Telephony_NetworkSearch_turnOnRadio_Promise_0200 turnOn finish');
......@@ -422,6 +504,15 @@ describe('NetworkSearchTest', function () {
* @tc.desc Function test
*/
it('Telephony_NetworkSearch_turnOffRadio_Promise_0100', 0, async function (done) {
try {
await radio.turnOnRadio();
console.log('Telephony_NetworkSearch_recoverRadioState success');
} catch (err) {
console.log(`Telephony_NetworkSearch_recoverRadioState fail ${err}`);
expect().assertFail();
done();
return;
}
try {
await radio.turnOffRadio();
console.log('Telephony_NetworkSearch_turnOffRadio_Promise_0100 turnOff finish');
......@@ -450,6 +541,15 @@ describe('NetworkSearchTest', function () {
* @tc.desc Function test
*/
it('Telephony_NetworkSearch_turnOffRadio_Promise_0200', 0, async function (done) {
try {
await radio.turnOnRadio();
console.log('Telephony_NetworkSearch_recoverRadioState success');
} catch (err) {
console.log(`Telephony_NetworkSearch_recoverRadioState fail ${err}`);
expect().assertFail();
done();
return;
}
try {
await radio.turnOffRadio();
console.log('Telephony_NetworkSearch_turnOffRadio_Promise_0200 turnOff1 finish');
......@@ -491,6 +591,15 @@ describe('NetworkSearchTest', function () {
* @tc.desc Function test
*/
it('Telephony_NetworkSearch_turnOffRadio_Promise_0500', 0, async function (done) {
try {
await radio.turnOnRadio();
console.log('Telephony_NetworkSearch_recoverRadioState success');
} catch (err) {
console.log(`Telephony_NetworkSearch_recoverRadioState fail ${err}`);
expect().assertFail();
done();
return;
}
try {
await radio.turnOffRadio();
console.log('Telephony_NetworkSearch_turnOffRadio_Promise_0500 turnOff finish');
......@@ -532,6 +641,15 @@ describe('NetworkSearchTest', function () {
* @tc.desc Function test
*/
it('Telephony_NetworkSearch_turnOffRadio_Promise_0600', 0, async function (done) {
try {
await radio.turnOnRadio();
console.log('Telephony_NetworkSearch_recoverRadioState success');
} catch (err) {
console.log(`Telephony_NetworkSearch_recoverRadioState fail ${err}`);
expect().assertFail();
done();
return;
}
try {
await radio.turnOffRadio();
console.log('Telephony_NetworkSearch_turnOffRadio_Promise_0600 turnOff finish');
......@@ -562,6 +680,15 @@ describe('NetworkSearchTest', function () {
* @tc.desc Function test
*/
it('Telephony_NetworkSearch_turnOffRadio_Promise_0700', 0, async function (done) {
try {
await radio.turnOnRadio();
console.log('Telephony_NetworkSearch_recoverRadioState success');
} catch (err) {
console.log(`Telephony_NetworkSearch_recoverRadioState fail ${err}`);
expect().assertFail();
done();
return;
}
try {
await radio.turnOffRadio();
console.log('Telephony_NetworkSearch_turnOffRadio_Promise_0700 turnOff finish');
......@@ -592,6 +719,15 @@ describe('NetworkSearchTest', function () {
* @tc.desc Function test
*/
it('Telephony_NetworkSearch_isRadioOn_Promise_0100', 0, async function (done) {
try {
await radio.turnOnRadio();
console.log('Telephony_NetworkSearch_recoverRadioState success');
} catch (err) {
console.log(`Telephony_NetworkSearch_recoverRadioState fail ${err}`);
expect().assertFail();
done();
return;
}
try {
await radio.turnOffRadio();
console.log('Telephony_NetworkSearch_isRadioOn_Promise_0100 turnOff finish');
......@@ -620,6 +756,15 @@ describe('NetworkSearchTest', function () {
* @tc.desc Function test
*/
it('Telephony_NetworkSearch_isRadioOn_Promise_0200', 0, async function (done) {
try {
await radio.turnOnRadio();
console.log('Telephony_NetworkSearch_recoverRadioState success');
} catch (err) {
console.log(`Telephony_NetworkSearch_recoverRadioState fail ${err}`);
expect().assertFail();
done();
return;
}
try {
let data = await radio.isRadioOn();
expect(data).assertTrue();
......@@ -639,6 +784,15 @@ describe('NetworkSearchTest', function () {
* @tc.desc Function test
*/
it('Telephony_NetworkSearch_getISOCountryCodeForNetwork_Async_0500', 0, async function (done) {
try {
await radio.turnOnRadio();
console.log('Telephony_NetworkSearch_recoverRadioState success');
} catch (err) {
console.log(`Telephony_NetworkSearch_recoverRadioState fail ${err}`);
expect().assertFail();
done();
return;
}
radio.turnOffRadio((err) => {
if (err) {
console.log(`Telephony_NetworkSearch_getISOCountryCodeForNetwork_Async_0500 turnOff fail: ${err}`);
......@@ -668,6 +822,15 @@ describe('NetworkSearchTest', function () {
* @tc.desc Function test
*/
it('Telephony_NetworkSearch_getISOCountryCodeForNetwork_Promise_0500', 0, async function (done) {
try {
await radio.turnOnRadio();
console.log('Telephony_NetworkSearch_recoverRadioState success');
} catch (err) {
console.log(`Telephony_NetworkSearch_recoverRadioState fail ${err}`);
expect().assertFail();
done();
return;
}
try {
await radio.turnOffRadio();
console.log('Telephony_NetworkSearch_getISOCountryCodeForNetwork_Promise_0500 turnOff finish');
......@@ -687,6 +850,15 @@ describe('NetworkSearchTest', function () {
done();
return;
}
try {
await radio.turnOnRadio();
console.log('Telephony_NetworkSearch_getISOCountryCodeForNetwork_Promise_0500 turnOn success');
} catch (err) {
console.log(`Telephony_NetworkSearch_getISOCountryCodeForNetwork_Promise_0500 turnOff fail ${err}`);
expect().assertFail();
done();
return;
}
done();
});
});
# 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.
import("//test/xts/tools/build/suite.gni")
ohos_js_hap_suite("NetworkSearchReliability") {
hap_profile = "./entry/src/main/config.json"
deps = [
":hjs_demo_js_assets",
":hjs_demo_resources",
]
certificate_profile = "./signature/openharmony_sx.p7b"
hap_name = "NetworkSearchReliability"
}
ohos_js_assets("hjs_demo_js_assets") {
source_dir = "./entry/src/main/js/default"
}
ohos_resources("hjs_demo_resources") {
sources = [ "./entry/src/main/js/resources" ]
hap_profile = "./entry/src/main/config.json"
}
{
"description": "Configuration for NetworkSearch Tests",
"driver": {
"type": "JSUnitTest",
"test-timeout": "1800",
"package": "com.ohos.networksearch",
"shell-timeout": "1800",
"native-test-timeout":"1800"
},
"kits": [
{
"test-file-name": [
"$module.hap"
],
"type": "AppInstallKit",
"cleanup-apps": true
}
]
}
{
"app": {
"bundleName": "com.ohos.networksearch",
"vendor": "ohos",
"version": {
"code": 1000000,
"name": "1.0.0"
},
"apiVersion": {
"compatible": 4,
"target": 5,
"releaseType": "Release"
}
},
"deviceConfig": {},
"module": {
"package": "com.ohos.networksearch",
"name": ".MyApplication",
"deviceType": [
"phone"
],
"distro": {
"deliveryWithInstall": true,
"moduleName": "entry",
"moduleType": "entry"
},
"abilities": [
{
"visible": true,
"skills": [
{
"entities": [
"entity.system.home"
],
"actions": [
"action.system.home"
]
}
],
"name": "com.ohos.networksearch.MainAbility",
"icon": "$media:icon",
"description": "$string:mainability_description",
"label": "$string:app_name",
"type": "page",
"launchType": "standard"
}
],
"js": [
{
"pages": [
"pages/index/index"
],
"name": "default",
"window": {
"designWidth": 720,
"autoDesignWidth": false
}
}
]
}
}
\ No newline at end of file
/*
* 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 {
onCreate() {
console.info('AceApplication onCreate');
},
onDestroy() {
console.info('AceApplication onDestroy');
}
};
{
"strings": {
"hello": "您好",
"world": "世界"
}
}
\ No newline at end of file
.container {
flex-direction: column;
justify-content: center;
align-items: center;
}
.title {
font-size: 100px;
}
<div class="container">
<text class="title">
{{ $t('strings.hello') }} {{ title }}
</text>
</div>
/*
* 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.
*/
import file from '@system.file'
import app from '@system.app'
import device from '@system.device'
import router from '@system.router'
import {Core, ExpectExtend} from 'deccjsunit/index'
const injectRef = Object.getPrototypeOf(global) || global
injectRef.regeneratorRuntime = require('@babel/runtime/regenerator')
export default {
data: {
title: ""
},
onInit() {
this.title = this.$t('strings.world');
},
onShow() {
console.info('onShow finish!')
const core = Core.getInstance()
const expectExtend = new ExpectExtend({
'id': 'extend'
})
core.addService('expect', expectExtend)
core.init()
const configService = core.getDefaultService('config')
configService.setConfig(this)
require('../../../test/List.test')
core.execute()
},
onReady() {
},
}
\ No newline at end of file
{
"string": [
{
"name": "app_name",
"value": "MyApplication"
},
{
"name": "mainability_description",
"value": "JS_Phone_Empty Feature Ability"
}
]
}
\ No newline at end of file
/*
* 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.
*/
require('./NetworkSearchReliability.test.js');
{
"string": [
{
"name": "app_name",
"value": "NetworkSearchTest"
},
{
"name": "mainability_description",
"value": "JS_Phone_Empty Feature Ability"
}
]
}
\ No newline at end of file
......@@ -37,6 +37,7 @@ export default {
core.init()
const configService = core.getDefaultService('config')
configService.timeout = 8000
configService.setConfig(this)
require('../../../test/List.test')
......
......@@ -39,6 +39,7 @@ export default {
core.init();
const configService = core.getDefaultService('config');
configService.timeout = 8000
configService.setConfig(this);
require('../../../test/List.test');
......
......@@ -13,7 +13,7 @@
* limitations under the License.
*/
import sim from '@ohos.telephony_sim';
import sim from '@ohos.telephony.sim';
import {simSlotId, OPERATOR_NUM_LENGTH, operatorCode, ICC_LENGTH, IMSI_LENGTH} from '../default/utils/Constant.test.js';
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index';
......
......@@ -39,6 +39,7 @@ export default {
core.init();
const configService = core.getDefaultService('config');
configService.timeout = 8000
configService.setConfig(this);
require('../../../test/List.test');
......
{
"description": "Configuration for sim no sim function Tests",
"driver": {
"type": "JSUnitTest",
"test-timeout": "240000",
"package": "com.ohos.simnosimfunction",
"shell-timeout": "240000",
"native-test-timeout":"240000"
},
"kits": [
{
"test-file-name": [
"$module.hap"
],
"type": "AppInstallKit",
"cleanup-apps": true
}
]
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册