提交 ca5deaf3 编写于 作者: S shuxiong

telephony testcase update

Signed-off-by: Nshuxiong <shuxiong@huawei.com>
上级 e3240098
# Copyright (C) 2021 Huawei Device Co., Ltd. # Copyright (C) 2021 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
# #
# http://www.apache.org/licenses/LICENSE-2.0 # http://www.apache.org/licenses/LICENSE-2.0
# #
# Unless required by applicable law or agreed to in writing, software # Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, # distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# 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.
group("telephony") { group("telephony") {
testonly = true testonly = true
deps = [ deps = [ "telephonyjstest:telephonyjstest" ]
#"telephonycpptest:telephonycpptest", }
#"telephonyothertest:telephonyothertest",
"telephonyjstest:telephonyjstest",
]
}
...@@ -16,9 +16,9 @@ import("//build/ohos_var.gni") ...@@ -16,9 +16,9 @@ import("//build/ohos_var.gni")
group("telephonyjstest") { group("telephonyjstest") {
testonly = true testonly = true
deps = [ deps = [
#"network_search:network_search", "call_manager:call_manager",
#"sms_mms:sms_mms", "network_search:network_search",
#"call_manager:call_manager",
"sim:sim", "sim:sim",
"sms_mms:sms_mms",
] ]
} }
...@@ -2,10 +2,10 @@ ...@@ -2,10 +2,10 @@
"description": "Configuration for callmanager Tests", "description": "Configuration for callmanager Tests",
"driver": { "driver": {
"type": "JSUnitTest", "type": "JSUnitTest",
"test-timeout": "120000", "test-timeout": "1200000",
"package": "com.ohos.callmanager", "package": "com.ohos.callmanager",
"shell-timeout": "21600000", "shell-timeout": "1200000",
"native-test-timeout":"21600000" "native-test-timeout":"1200000"
}, },
"kits": [ "kits": [
{ {
......
...@@ -30,17 +30,16 @@ export default { ...@@ -30,17 +30,16 @@ export default {
this.title = this.$t('strings.world'); this.title = this.$t('strings.world');
}, },
onShow() { onShow() {
console.info('onShow finish!') console.info('onShow finish')
const core = Core.getInstance() const core = Core.getInstance()
const expectExtend = new ExpectExtend({ const expectExtend = new ExpectExtend({
'id': 'extend' 'id': 'extend'
}) })
core.addService('expect', expectExtend) core.addService('expect', expectExtend)
core.init() core.init()
const configService = core.getDefaultService('config') const configService = core.getDefaultService('config')
configService.timeout = 8000;
configService.setConfig(this) configService.setConfig(this)
require('../../../test/List.test') require('../../../test/List.test')
core.execute() core.execute()
}, },
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
* limitations under the License. * 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'; import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index';
describe('CallManagerMMI', function () { describe('CallManagerMMI', function () {
......
...@@ -2,10 +2,10 @@ ...@@ -2,10 +2,10 @@
"description": "Configuration for callmanager Tests", "description": "Configuration for callmanager Tests",
"driver": { "driver": {
"type": "JSUnitTest", "type": "JSUnitTest",
"test-timeout": "360000", "test-timeout": "3000000",
"package": "com.ohos.callmanager", "package": "com.ohos.callmanager",
"shell-timeout": "21600000", "shell-timeout": "3000000",
"native-test-timeout":"21600000" "native-test-timeout":"3000000"
}, },
"kits": [ "kits": [
{ {
......
...@@ -30,17 +30,16 @@ export default { ...@@ -30,17 +30,16 @@ export default {
this.title = this.$t('strings.world'); this.title = this.$t('strings.world');
}, },
onShow() { onShow() {
console.info('onShow finish!') console.info('onShow finish')
const core = Core.getInstance() const core = Core.getInstance()
const expectExtend = new ExpectExtend({ const expectExtend = new ExpectExtend({
'id': 'extend' 'id': 'extend'
}) })
core.addService('expect', expectExtend) core.addService('expect', expectExtend)
core.init() core.init()
const configService = core.getDefaultService('config') const configService = core.getDefaultService('config')
configService.timeout = 30000;
configService.setConfig(this) configService.setConfig(this)
require('../../../test/List.test') require('../../../test/List.test')
core.execute() core.execute()
}, },
......
...@@ -2,10 +2,10 @@ ...@@ -2,10 +2,10 @@
"description": "Configuration for callmanager Tests", "description": "Configuration for callmanager Tests",
"driver": { "driver": {
"type": "JSUnitTest", "type": "JSUnitTest",
"test-timeout": "240000", "test-timeout": "4800000",
"package": "com.ohos.callmanager", "package": "com.ohos.callmanager",
"shell-timeout": "21600000", "shell-timeout": "4800000",
"native-test-timeout":"21600000" "native-test-timeout":"4800000"
}, },
"kits": [ "kits": [
{ {
......
...@@ -30,17 +30,16 @@ export default { ...@@ -30,17 +30,16 @@ export default {
this.title = this.$t('strings.world'); this.title = this.$t('strings.world');
}, },
onShow() { onShow() {
console.info('onShow finish!') console.info('onShow finish')
const core = Core.getInstance() const core = Core.getInstance()
const expectExtend = new ExpectExtend({ const expectExtend = new ExpectExtend({
'id': 'extend' 'id': 'extend'
}) })
core.addService('expect', expectExtend) core.addService('expect', expectExtend)
core.init() core.init()
const configService = core.getDefaultService('config') const configService = core.getDefaultService('config')
configService.timeout = 15000;
configService.setConfig(this) configService.setConfig(this)
require('../../../test/List.test') require('../../../test/List.test')
core.execute() core.execute()
}, },
......
#!/bin/bash
# Copyright (C) 2021 Huawei Device Co., Ltd. # Copyright (C) 2021 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.
...@@ -11,21 +13,30 @@ ...@@ -11,21 +13,30 @@
# 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("//test/xts/tools/build/suite.gni")
ohos_js_hap_suite("SmsMmsPerformance") { # 配置发送短信的电话号码
hap_profile = "./entry/src/main/config.json" config_const_var[0]="const SMS_SEND_DST_NUMBER = '138xxxxxxxx';"
deps = [
":hjs_demo_js_assets",
":hjs_demo_resources", for((i = 0; i < ${#config_const_var}; i++))
] do
certificate_profile = "./signature/openharmony_sx.p7b" if [ "${config_const_var[i]}" == "" ]; then
hap_name = "SmsMmsPerformance" continue
} fi
ohos_js_assets("hjs_demo_js_assets") { grep_result=``
source_dir = "./entry/src/main/js/default" key=`echo ${config_const_var[i]}| awk -F= '{print $1}'`
} for line in `grep -nr "${key}"| sed 's/ //g'|grep -v "config.sh"`
ohos_resources("hjs_demo_resources") { do
sources = [ "./entry/src/main/js/resources" ]
hap_profile = "./entry/src/main/config.json" 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 { ...@@ -37,8 +37,8 @@ export default {
core.init() core.init()
const configService = core.getDefaultService('config') const configService = core.getDefaultService('config')
configService.timeout = 8000
configService.setConfig(this) configService.setConfig(this)
require('../../../test/List.test') require('../../../test/List.test')
core.execute() core.execute()
}, },
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
* limitations under the License. * 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'; import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit/index';
describe('NetworkSearchTest', function () { describe('NetworkSearchTest', function () {
...@@ -65,9 +65,6 @@ describe('NetworkSearchTest', function () { ...@@ -65,9 +65,6 @@ describe('NetworkSearchTest', function () {
const ISO_COUNTRY_CODE = 'cn'; const ISO_COUNTRY_CODE = 'cn';
const PLMN_SIZE = 5; const PLMN_SIZE = 5;
afterAll(async function () {
console.log('Telephony_NetworkSearch_InformationTest End!!!');
});
/** /**
* @tc.number Telephony_NetworkSearch_getNetworkState_Async_0100 * @tc.number Telephony_NetworkSearch_getNetworkState_Async_0100
...@@ -100,7 +97,7 @@ describe('NetworkSearchTest', function () { ...@@ -100,7 +97,7 @@ describe('NetworkSearchTest', function () {
data.plmnNumeric != null data.plmnNumeric != null
).assertTrue(); ).assertTrue();
expect(data.plmnNumeric.length == 5 && data.plmnNumeric.substr(0, 3) === '460').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.nsaState === 1).assertTrue();
expect(data.isRoaming === false).assertTrue(); expect(data.isRoaming === false).assertTrue();
expect(data.isCaActive === false).assertTrue(); expect(data.isCaActive === false).assertTrue();
...@@ -132,7 +129,7 @@ describe('NetworkSearchTest', function () { ...@@ -132,7 +129,7 @@ describe('NetworkSearchTest', function () {
data.shortOperatorName != undefined && data.shortOperatorName != '' && data.shortOperatorName != null data.shortOperatorName != undefined && data.shortOperatorName != '' && data.shortOperatorName != null
).assertTrue(); ).assertTrue();
expect(data.plmnNumeric.length === PLMN_SIZE && data.plmnNumeric.substr(0, 3) === '460').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.nsaState === 1).assertTrue();
expect(data.isRoaming === false).assertTrue(); expect(data.isRoaming === false).assertTrue();
expect(data.isCaActive === false).assertTrue(); expect(data.isCaActive === false).assertTrue();
...@@ -274,7 +271,7 @@ describe('NetworkSearchTest', function () { ...@@ -274,7 +271,7 @@ describe('NetworkSearchTest', function () {
data.shortOperatorName != undefined && data.shortOperatorName != '' && data.shortOperatorName != null data.shortOperatorName != undefined && data.shortOperatorName != '' && data.shortOperatorName != null
).assertTrue(); ).assertTrue();
expect(data.plmnNumeric.length === PLMN_SIZE && data.plmnNumeric.substr(0, 3) === '460').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.nsaState === 1).assertTrue();
expect(data.isRoaming === false).assertTrue(); expect(data.isRoaming === false).assertTrue();
expect(data.isCaActive === false).assertTrue(); expect(data.isCaActive === false).assertTrue();
...@@ -307,7 +304,7 @@ describe('NetworkSearchTest', function () { ...@@ -307,7 +304,7 @@ describe('NetworkSearchTest', function () {
data.shortOperatorName != undefined && data.shortOperatorName != '' && data.shortOperatorName != null data.shortOperatorName != undefined && data.shortOperatorName != '' && data.shortOperatorName != null
).assertTrue(); ).assertTrue();
expect(data.plmnNumeric.length === PLMN_SIZE && data.plmnNumeric.substr(0, 3) === '460').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.nsaState === 1).assertTrue();
expect(data.isRoaming === false).assertTrue(); expect(data.isRoaming === false).assertTrue();
expect(data.isCaActive === false).assertTrue(); expect(data.isCaActive === false).assertTrue();
...@@ -445,9 +442,9 @@ describe('NetworkSearchTest', function () { ...@@ -445,9 +442,9 @@ describe('NetworkSearchTest', function () {
done(); done();
return; return;
} }
expect(data === ISO_COUNTRY_CODE).assertTrue();
console.log( console.log(
`Telephony_NetworkSearch_getISOCountryCodeForNetwork_Async_0100 finish data: ${JSON.stringify(data)}`); `Telephony_NetworkSearch_getISOCountryCodeForNetwork_Async_0100 finish data: ${JSON.stringify(data)}`);
expect(data === ISO_COUNTRY_CODE).assertTrue();
done(); 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');
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册