提交 995477dc 编写于 作者: N nan-xianse

【startup_standard】【master】fix case

Signed-off-by: Nnan-xianse <nanjinbin@huawei.com>
Change-Id: I0fa4caa400eb1bd25650b09f0866d6299482514a
上级 473a9f99
# 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
...@@ -16,6 +16,6 @@ import("//build/ohos_var.gni") ...@@ -16,6 +16,6 @@ import("//build/ohos_var.gni")
group("startup") { group("startup") {
testonly = true testonly = true
if (is_standard_system) { if (is_standard_system) {
deps = [ "startup_standard:startup_js_test" ] deps = [ "startup_standard:startup_standard" ]
} }
} }
...@@ -11,21 +11,14 @@ ...@@ -11,21 +11,14 @@
# 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") import("//build/ohos_var.gni")
ohos_js_hap_suite("startup_js_test") { group("startup_standard") {
hap_profile = "./src/main/config.json" testonly = true
if (is_standard_system) {
deps = [ deps = [
":startup_js_assets", "deviceinfo:startup_deviceinfo_js_test",
":startup_js_resources", "systemparamter:startup_sysparam_js_test",
] ]
certificate_profile = "./signature/openharmony_sx.p7b" }
hap_name = "ActsStartupJSApiTest"
}
ohos_js_assets("startup_js_assets") {
source_dir = "./src/main/js/default"
}
ohos_resources("startup_js_resources") {
sources = [ "./src/main/resources" ]
hap_profile = "./src/main/config.json"
} }
# 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("startup_deviceinfo_js_test") {
hap_profile = "./src/main/config.json"
deps = [
":startup_js_assets",
":startup_js_resources",
]
certificate_profile = "./signature/openharmony_sx.p7b"
hap_name = "StartupDeviceInfoApiTest"
}
ohos_js_assets("startup_js_assets") {
source_dir = "./src/main/js/default"
}
ohos_resources("startup_js_resources") {
sources = [ "./src/main/resources" ]
hap_profile = "./src/main/config.json"
}
{ {
"strings": { "strings": {
"hello": "Hello", "hello": "Hello",
"world": "World" "world": "OpenHarmony"
} }
} }
\ No newline at end of file
{ {
"strings": { "strings": {
"hello": "您好", "hello": "您好",
"world": "世界" "world": "鸿蒙OS"
} }
} }
\ No newline at end of file
...@@ -42,6 +42,7 @@ describe('DeviceInfoTest', function () { ...@@ -42,6 +42,7 @@ describe('DeviceInfoTest', function () {
}) })
console.info('start################################start'); console.info('start################################start');
/** /**
* @tc.number SUB_STARTUP_JS_DEVCEINFO_0100 * @tc.number SUB_STARTUP_JS_DEVCEINFO_0100
* @tc.name testGetDeviceType01 * @tc.name testGetDeviceType01
...@@ -90,6 +91,7 @@ describe('DeviceInfoTest', function () { ...@@ -90,6 +91,7 @@ describe('DeviceInfoTest', function () {
expect(manufactureInfo).assertEqual(bufferstr); expect(manufactureInfo).assertEqual(bufferstr);
console.info('device_info_test_002 :end'); console.info('device_info_test_002 :end');
}) })
/** /**
* @tc.number SUB_STARTUP_JS_DEVCEINFO_0300 * @tc.number SUB_STARTUP_JS_DEVCEINFO_0300
* @tc.name testGetBrand01 * @tc.name testGetBrand01
...@@ -118,7 +120,6 @@ describe('DeviceInfoTest', function () { ...@@ -118,7 +120,6 @@ describe('DeviceInfoTest', function () {
console.info('testGetDeviceBrand01 :end'); console.info('testGetDeviceBrand01 :end');
}) })
/** /**
* @tc.number SUB_STARTUP_JS_DEVCEINFO_0400 * @tc.number SUB_STARTUP_JS_DEVCEINFO_0400
* @tc.name testGetMarketName01 * @tc.name testGetMarketName01
...@@ -332,7 +333,6 @@ describe('DeviceInfoTest', function () { ...@@ -332,7 +333,6 @@ describe('DeviceInfoTest', function () {
console.info('testGetBootLoaderVersion01 :end') console.info('testGetBootLoaderVersion01 :end')
}) })
/** /**
* @tc.number SUB_STARTUP_JS_DEVCEINFO_0130 * @tc.number SUB_STARTUP_JS_DEVCEINFO_0130
* @tc.name testGetabiList01 * @tc.name testGetabiList01
...@@ -361,7 +361,6 @@ describe('DeviceInfoTest', function () { ...@@ -361,7 +361,6 @@ describe('DeviceInfoTest', function () {
console.info('testGetabiList01 :end'); console.info('testGetabiList01 :end');
}) })
/** /**
* @tc.number SUB_STARTUP_JS_DEVCEINFO_0140 * @tc.number SUB_STARTUP_JS_DEVCEINFO_0140
* @tc.name testGetSecurityPatchTag01 * @tc.name testGetSecurityPatchTag01
...@@ -411,6 +410,7 @@ describe('DeviceInfoTest', function () { ...@@ -411,6 +410,7 @@ describe('DeviceInfoTest', function () {
expect(ret).assertTrue(); expect(ret).assertTrue();
console.info('testGetDisplayVersion01 :end'); console.info('testGetDisplayVersion01 :end');
}) })
/** /**
* @tc.number SUB_STARTUP_JS_DEVCEINFO_0160 * @tc.number SUB_STARTUP_JS_DEVCEINFO_0160
* @tc.name testGetIncrementalVersion01 * @tc.name testGetIncrementalVersion01
...@@ -519,7 +519,7 @@ describe('DeviceInfoTest', function () { ...@@ -519,7 +519,7 @@ describe('DeviceInfoTest', function () {
let str = /[\w-\.\(\)]/g; let str = /[\w-\.\(\)]/g;
let arr = majorVersionInfo.toString().match(str); let arr = majorVersionInfo.toString().match(str);
let substr = arr.join(''); let substr = arr.join('');
let numstr =parseInt(substr); let numstr = parseInt(substr);
console.info('the value of the bufferstr is :' + numstr); console.info('the value of the bufferstr is :' + numstr);
expect(majorVersionInfo).assertEqual(numstr); expect(majorVersionInfo).assertEqual(numstr);
console.info('testGetMajorVersion01 :end'); console.info('testGetMajorVersion01 :end');
...@@ -548,7 +548,7 @@ describe('DeviceInfoTest', function () { ...@@ -548,7 +548,7 @@ describe('DeviceInfoTest', function () {
let str = /[\w-\.\(\)]/g; let str = /[\w-\.\(\)]/g;
let arr = seniorVersionInfo.toString().match(str); let arr = seniorVersionInfo.toString().match(str);
let substr = arr.join(''); let substr = arr.join('');
let numstr =parseInt(substr); let numstr = parseInt(substr);
console.info('the value of the bufferstr is :' + numstr); console.info('the value of the bufferstr is :' + numstr);
expect(seniorVersionInfo).assertEqual(numstr); expect(seniorVersionInfo).assertEqual(numstr);
console.info('testGetSeniorVersion01 :end'); console.info('testGetSeniorVersion01 :end');
...@@ -569,7 +569,7 @@ describe('DeviceInfoTest', function () { ...@@ -569,7 +569,7 @@ describe('DeviceInfoTest', function () {
console.info('the value of the deviceinfo featureVersion is :' + featureVersionInfo); console.info('the value of the deviceinfo featureVersion is :' + featureVersionInfo);
expect(featureVersionInfo).assertInstanceOf('Number'); expect(featureVersionInfo).assertInstanceOf('Number');
if ((featureVersionInfo >= 1 && featureVersionInfo <= 99) || featureVersionInfo == 0 ) { if ((featureVersionInfo >= 1 && featureVersionInfo <= 99) || featureVersionInfo == 0) {
ret = true; ret = true;
} }
expect(ret).assertTrue(); expect(ret).assertTrue();
...@@ -577,7 +577,7 @@ describe('DeviceInfoTest', function () { ...@@ -577,7 +577,7 @@ describe('DeviceInfoTest', function () {
let str = /[\w-\.\(\)]/g; let str = /[\w-\.\(\)]/g;
let arr = featureVersionInfo.toString().match(str); let arr = featureVersionInfo.toString().match(str);
let substr = arr.join(''); let substr = arr.join('');
let numstr =parseInt(substr); let numstr = parseInt(substr);
console.info('the value of the bufferstr is :' + numstr); console.info('the value of the bufferstr is :' + numstr);
expect(featureVersionInfo).assertEqual(numstr); expect(featureVersionInfo).assertEqual(numstr);
console.info('testGetFeatureVersion01 :end'); console.info('testGetFeatureVersion01 :end');
...@@ -606,7 +606,7 @@ describe('DeviceInfoTest', function () { ...@@ -606,7 +606,7 @@ describe('DeviceInfoTest', function () {
let str = /[\w-\.\(\)]/g; let str = /[\w-\.\(\)]/g;
let arr = buildVersionInfo.toString().match(str); let arr = buildVersionInfo.toString().match(str);
let substr = arr.join(''); let substr = arr.join('');
let numstr =parseInt(substr); let numstr = parseInt(substr);
console.info('the value of the bufferstr is :' + numstr); console.info('the value of the bufferstr is :' + numstr);
expect(buildVersionInfo).assertEqual(numstr); expect(buildVersionInfo).assertEqual(numstr);
...@@ -636,7 +636,7 @@ describe('DeviceInfoTest', function () { ...@@ -636,7 +636,7 @@ describe('DeviceInfoTest', function () {
let str = /[\w-\.\(\)]/g; let str = /[\w-\.\(\)]/g;
let arr = sdkApiVersionInfo.toString().match(str); let arr = sdkApiVersionInfo.toString().match(str);
let substr = arr.join(''); let substr = arr.join('');
let numstr =parseInt(substr); let numstr = parseInt(substr);
console.info('the value of the bufferstr is :' + numstr); console.info('the value of the bufferstr is :' + numstr);
expect(sdkApiVersionInfo).assertEqual(numstr); expect(sdkApiVersionInfo).assertEqual(numstr);
...@@ -666,7 +666,7 @@ describe('DeviceInfoTest', function () { ...@@ -666,7 +666,7 @@ describe('DeviceInfoTest', function () {
let str = /[\w-\.\(\)]/g; let str = /[\w-\.\(\)]/g;
let arr = firstApiVersionInfo.toString().match(str); let arr = firstApiVersionInfo.toString().match(str);
let substr = arr.join(''); let substr = arr.join('');
let numstr =parseInt(substr); let numstr = parseInt(substr);
console.info('the value of the bufferstr is :' + numstr); console.info('the value of the bufferstr is :' + numstr);
expect(firstApiVersionInfo).assertEqual(numstr); expect(firstApiVersionInfo).assertEqual(numstr);
...@@ -744,6 +744,7 @@ describe('DeviceInfoTest', function () { ...@@ -744,6 +744,7 @@ describe('DeviceInfoTest', function () {
expect(ret).assertTrue(); expect(ret).assertTrue();
console.info('testGetBuildUser01 :end'); console.info('testGetBuildUser01 :end');
}) })
/** /**
* @tc.number SUB_STARTUP_JS_DEVCEINFO_0290 * @tc.number SUB_STARTUP_JS_DEVCEINFO_0290
* @tc.name testGetBuildHost01 * @tc.name testGetBuildHost01
...@@ -1075,6 +1076,7 @@ describe('DeviceInfoTest', function () { ...@@ -1075,6 +1076,7 @@ describe('DeviceInfoTest', function () {
expect(len).assertLess(MAX_CHARACTERS_NUM_TWO); expect(len).assertLess(MAX_CHARACTERS_NUM_TWO);
console.info('device_info_test_040 :end'); console.info('device_info_test_040 :end');
}) })
/** /**
* @tc.number SUB_STARTUP_JS_DEVCEINFO_0450 * @tc.number SUB_STARTUP_JS_DEVCEINFO_0450
* @tc.name testGetOsFullName02 * @tc.name testGetOsFullName02
...@@ -1100,6 +1102,7 @@ describe('DeviceInfoTest', function () { ...@@ -1100,6 +1102,7 @@ describe('DeviceInfoTest', function () {
console.info('device_info_test_041 :end'); console.info('device_info_test_041 :end');
}) })
/** /**
* @tc.number SUB_STARTUP_JS_DEVCEINFO_0460 * @tc.number SUB_STARTUP_JS_DEVCEINFO_0460
* @tc.name testGetVersionId02 * @tc.name testGetVersionId02
...@@ -1143,6 +1146,7 @@ describe('DeviceInfoTest', function () { ...@@ -1143,6 +1146,7 @@ describe('DeviceInfoTest', function () {
console.info('device_info_test_043 :end') console.info('device_info_test_043 :end')
}) })
/** /**
* @tc.number SUB_STARTUP_JS_DEVCEINFO_0480 * @tc.number SUB_STARTUP_JS_DEVCEINFO_0480
* @tc.name testGetBuildHost02 * @tc.name testGetBuildHost02
...@@ -1213,6 +1217,7 @@ describe('DeviceInfoTest', function () { ...@@ -1213,6 +1217,7 @@ describe('DeviceInfoTest', function () {
console.info('device_info_test_046 :end') console.info('device_info_test_046 :end')
}) })
/** /**
* @tc.number SUB_STARTUP_JS_DEVCEINFO_0520 * @tc.number SUB_STARTUP_JS_DEVCEINFO_0520
* @tc.name testGetProductBrand03 * @tc.name testGetProductBrand03
...@@ -1238,6 +1243,7 @@ describe('DeviceInfoTest', function () { ...@@ -1238,6 +1243,7 @@ describe('DeviceInfoTest', function () {
console.info('device_info_test_047 :end'); console.info('device_info_test_047 :end');
}) })
/** /**
* @tc.number SUB_STARTUP_JS_DEVCEINFO_0530 * @tc.number SUB_STARTUP_JS_DEVCEINFO_0530
* @tc.name testGetMarketName03 * @tc.name testGetMarketName03
...@@ -1328,6 +1334,7 @@ describe('DeviceInfoTest', function () { ...@@ -1328,6 +1334,7 @@ describe('DeviceInfoTest', function () {
console.info('device_info_test_036 :end') console.info('device_info_test_036 :end')
}) })
/** /**
* @tc.number SUB_STARTUP_JS_DEVCEINFO_0570 * @tc.number SUB_STARTUP_JS_DEVCEINFO_0570
* @tc.name testGetHardwareModel03 * @tc.name testGetHardwareModel03
...@@ -1405,6 +1412,7 @@ describe('DeviceInfoTest', function () { ...@@ -1405,6 +1412,7 @@ describe('DeviceInfoTest', function () {
console.info('device_info_test_054 :end'); console.info('device_info_test_054 :end');
}) })
/** /**
* @tc.number SUB_STARTUP_JS_DEVCEINFO_0610 * @tc.number SUB_STARTUP_JS_DEVCEINFO_0610
* @tc.name testGetDisplayVersion03 * @tc.name testGetDisplayVersion03
...@@ -1424,6 +1432,7 @@ describe('DeviceInfoTest', function () { ...@@ -1424,6 +1432,7 @@ describe('DeviceInfoTest', function () {
console.info('device_info_test_055 :end'); console.info('device_info_test_055 :end');
}) })
/** /**
* @tc.number SUB_STARTUP_JS_DEVCEINFO_0620 * @tc.number SUB_STARTUP_JS_DEVCEINFO_0620
* @tc.name testGetIncrementalVersionInfo02 * @tc.name testGetIncrementalVersionInfo02
...@@ -1475,6 +1484,7 @@ describe('DeviceInfoTest', function () { ...@@ -1475,6 +1484,7 @@ describe('DeviceInfoTest', function () {
console.info('device_info_test_057 :end') console.info('device_info_test_057 :end')
}) })
/** /**
* @tc.number SUB_STARTUP_JS_DEVCEINFO_0640 * @tc.number SUB_STARTUP_JS_DEVCEINFO_0640
* @tc.name testGetVersionId03 * @tc.name testGetVersionId03
...@@ -1531,6 +1541,7 @@ describe('DeviceInfoTest', function () { ...@@ -1531,6 +1541,7 @@ describe('DeviceInfoTest', function () {
expect(len).assertLarger(MAX_CHARACTERS_NUM); expect(len).assertLarger(MAX_CHARACTERS_NUM);
console.info('device_info_test_060 :end'); console.info('device_info_test_060 :end');
}) })
/** /**
* @tc.number SUB_STARTUP_JS_DEVCEINFO_0670 * @tc.number SUB_STARTUP_JS_DEVCEINFO_0670
* @tc.name testGetSecurityPatchTag02 * @tc.name testGetSecurityPatchTag02
...@@ -1548,10 +1559,10 @@ describe('DeviceInfoTest', function () { ...@@ -1548,10 +1559,10 @@ describe('DeviceInfoTest', function () {
let reFormat = /^(\d{4})-(\d{2})-(\d{2})$/; let reFormat = /^(\d{4})-(\d{2})-(\d{2})$/;
let re = securityPatchTagInfo.match(reFormat); let re = securityPatchTagInfo.match(reFormat);
if (re != null){ if (re != null) {
ret = true; ret = true;
expect(ret).assertTrue(); expect(ret).assertTrue();
}else{ } else {
console.info('the return formate is not yy--mm--dd'); console.info('the return formate is not yy--mm--dd');
} }
......
...@@ -14,7 +14,4 @@ ...@@ -14,7 +14,4 @@
*/ */
require('./DeviceInfoJsUnit.test.js') require('./DeviceInfoJsUnit.test.js')
//require('./ParametersJsUnit.test.js') require('./ParametersJsUnit.test.js')
# 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("startup_sysparam_js_test") {
hap_profile = "./src/main/config.json"
deps = [
":startup_js_assets",
":startup_js_resources",
]
certificate_profile = "./signature/openharmony_sx.p7b"
hap_name = "StartupSysParamApiTest"
}
ohos_js_assets("startup_js_assets") {
source_dir = "./src/main/js/default"
}
ohos_resources("startup_js_resources") {
sources = [ "./src/main/resources" ]
hap_profile = "./src/main/config.json"
}
{
"description": "Configuration for startup sysparam js api Tests",
"driver": {
"type": "JSUnitTest",
"test-timeout": "300000",
"package": "ohos.acts.startup.sysparam.function",
"shell-timeout": "60000"
},
"kits": [
{
"test-file-name": [
"StartupSysParamApiTest.hap"
],
"type": "AppInstallKit",
"cleanup-apps": true
}
]
}
{
"app": {
"bundleName": "ohos.acts.startup.sysparam.function",
"vendor": "example",
"version": {
"code": 1,
"name": "1.0"
},
"apiVersion": {
"compatible": 4,
"target": 5
}
},
"deviceConfig": {},
"module": {
"package": "ohos.acts.startup.sysparam.function",
"name": ".MyApplication",
"deviceType": [
"phone"
],
"distro": {
"deliveryWithInstall": true,
"moduleName": "entry",
"moduleType": "entry"
},
"abilities": [
{
"visible": true,
"skills": [
{
"entities": [
"entity.system.home"
],
"actions": [
"action.system.home"
]
}
],
"name": "ohos.acts.startup.sysparam.function.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
}
}
]
}
}
/*
* 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": "Hello",
"world": "OpenHarmony"
}
}
\ No newline at end of file
{
"strings": {
"hello": "您好",
"world": "鸿蒙OS"
}
}
\ 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 {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() {
},
}
/*
* 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('./SysParametersJs.test.js')
{
"string": [
{
"name": "app_name",
"value": "StartupJSApiTest"
},
{
"name": "mainability_description",
"value": "JS_Phone_Empty Feature Ability"
}
]
}
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册