未验证 提交 057a9fdb 编写于 作者: O openharmony_ci 提交者: Gitee

!1498 【startup_standard】【master】fix cases

Merge pull request !1498 from 南先森/standard0105
# Copyright (C) 2021 Huawei Device Co., Ltd.
# 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
......@@ -16,6 +16,6 @@ import("//build/ohos_var.gni")
group("startup") {
testonly = true
if (is_standard_system) {
deps = [ "startup_standard:startup_js_test" ]
deps = [ "startup_standard:startup_standard" ]
}
}
......@@ -11,21 +11,14 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import("//test/xts/tools/build/suite.gni")
import("//build/ohos_var.gni")
ohos_js_hap_suite("startup_js_test") {
hap_profile = "./src/main/config.json"
deps = [
":startup_js_assets",
":startup_js_resources",
]
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"
group("startup_standard") {
testonly = true
if (is_standard_system) {
deps = [
"deviceinfo:startup_deviceinfo_js_test",
"systemparamter:startup_sysparam_js_test",
]
}
}
# 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"
}
......@@ -42,6 +42,7 @@ describe('DeviceInfoTest', function () {
})
console.info('start################################start');
/**
* @tc.number SUB_STARTUP_JS_DEVCEINFO_0100
* @tc.name testGetDeviceType01
......@@ -90,6 +91,7 @@ describe('DeviceInfoTest', function () {
expect(manufactureInfo).assertEqual(bufferstr);
console.info('device_info_test_002 :end');
})
/**
* @tc.number SUB_STARTUP_JS_DEVCEINFO_0300
* @tc.name testGetBrand01
......@@ -118,7 +120,6 @@ describe('DeviceInfoTest', function () {
console.info('testGetDeviceBrand01 :end');
})
/**
* @tc.number SUB_STARTUP_JS_DEVCEINFO_0400
* @tc.name testGetMarketName01
......@@ -332,7 +333,6 @@ describe('DeviceInfoTest', function () {
console.info('testGetBootLoaderVersion01 :end')
})
/**
* @tc.number SUB_STARTUP_JS_DEVCEINFO_0130
* @tc.name testGetabiList01
......@@ -361,7 +361,6 @@ describe('DeviceInfoTest', function () {
console.info('testGetabiList01 :end');
})
/**
* @tc.number SUB_STARTUP_JS_DEVCEINFO_0140
* @tc.name testGetSecurityPatchTag01
......@@ -411,6 +410,7 @@ describe('DeviceInfoTest', function () {
expect(ret).assertTrue();
console.info('testGetDisplayVersion01 :end');
})
/**
* @tc.number SUB_STARTUP_JS_DEVCEINFO_0160
* @tc.name testGetIncrementalVersion01
......@@ -492,7 +492,7 @@ describe('DeviceInfoTest', function () {
let bufferstr = arr.join('');
console.info('the value of the bufferstr is :' + bufferstr);
expect(osFullNameInfo).assertEqual(bufferstr);
console.info('testGetOSFullName01 :end');
})
......@@ -515,11 +515,11 @@ describe('DeviceInfoTest', function () {
ret = true;
}
expect(ret).assertTrue();
let str = /[\w-\.\(\)]/g;
let arr = majorVersionInfo.toString().match(str);
let substr = arr.join('');
let numstr =parseInt(substr);
let substr = arr.join('');
let numstr = parseInt(substr);
console.info('the value of the bufferstr is :' + numstr);
expect(majorVersionInfo).assertEqual(numstr);
console.info('testGetMajorVersion01 :end');
......@@ -547,8 +547,8 @@ describe('DeviceInfoTest', function () {
let str = /[\w-\.\(\)]/g;
let arr = seniorVersionInfo.toString().match(str);
let substr = arr.join('');
let numstr =parseInt(substr);
let substr = arr.join('');
let numstr = parseInt(substr);
console.info('the value of the bufferstr is :' + numstr);
expect(seniorVersionInfo).assertEqual(numstr);
console.info('testGetSeniorVersion01 :end');
......@@ -569,15 +569,15 @@ describe('DeviceInfoTest', function () {
console.info('the value of the deviceinfo featureVersion is :' + featureVersionInfo);
expect(featureVersionInfo).assertInstanceOf('Number');
if ((featureVersionInfo >= 1 && featureVersionInfo <= 99) || featureVersionInfo == 0 ) {
if ((featureVersionInfo >= 1 && featureVersionInfo <= 99) || featureVersionInfo == 0) {
ret = true;
}
expect(ret).assertTrue();
let str = /[\w-\.\(\)]/g;
let arr = featureVersionInfo.toString().match(str);
let substr = arr.join('');
let numstr =parseInt(substr);
let substr = arr.join('');
let numstr = parseInt(substr);
console.info('the value of the bufferstr is :' + numstr);
expect(featureVersionInfo).assertEqual(numstr);
console.info('testGetFeatureVersion01 :end');
......@@ -605,8 +605,8 @@ describe('DeviceInfoTest', function () {
let str = /[\w-\.\(\)]/g;
let arr = buildVersionInfo.toString().match(str);
let substr = arr.join('');
let numstr =parseInt(substr);
let substr = arr.join('');
let numstr = parseInt(substr);
console.info('the value of the bufferstr is :' + numstr);
expect(buildVersionInfo).assertEqual(numstr);
......@@ -635,8 +635,8 @@ describe('DeviceInfoTest', function () {
let str = /[\w-\.\(\)]/g;
let arr = sdkApiVersionInfo.toString().match(str);
let substr = arr.join('');
let numstr =parseInt(substr);
let substr = arr.join('');
let numstr = parseInt(substr);
console.info('the value of the bufferstr is :' + numstr);
expect(sdkApiVersionInfo).assertEqual(numstr);
......@@ -662,11 +662,11 @@ describe('DeviceInfoTest', function () {
ret = true;
}
expect(ret).assertTrue();
let str = /[\w-\.\(\)]/g;
let arr = firstApiVersionInfo.toString().match(str);
let substr = arr.join('');
let numstr =parseInt(substr);
let substr = arr.join('');
let numstr = parseInt(substr);
console.info('the value of the bufferstr is :' + numstr);
expect(firstApiVersionInfo).assertEqual(numstr);
......@@ -744,6 +744,7 @@ describe('DeviceInfoTest', function () {
expect(ret).assertTrue();
console.info('testGetBuildUser01 :end');
})
/**
* @tc.number SUB_STARTUP_JS_DEVCEINFO_0290
* @tc.name testGetBuildHost01
......@@ -1053,7 +1054,7 @@ describe('DeviceInfoTest', function () {
let bufferstr = arr.join('');
console.info('the value of the bufferstr is :' + bufferstr);
expect(serialInfo).assertEqual(bufferstr);
console.info('device_info_test_039 :end');
})
......@@ -1075,6 +1076,7 @@ describe('DeviceInfoTest', function () {
expect(len).assertLess(MAX_CHARACTERS_NUM_TWO);
console.info('device_info_test_040 :end');
})
/**
* @tc.number SUB_STARTUP_JS_DEVCEINFO_0450
* @tc.name testGetOsFullName02
......@@ -1100,6 +1102,7 @@ describe('DeviceInfoTest', function () {
console.info('device_info_test_041 :end');
})
/**
* @tc.number SUB_STARTUP_JS_DEVCEINFO_0460
* @tc.name testGetVersionId02
......@@ -1143,6 +1146,7 @@ describe('DeviceInfoTest', function () {
console.info('device_info_test_043 :end')
})
/**
* @tc.number SUB_STARTUP_JS_DEVCEINFO_0480
* @tc.name testGetBuildHost02
......@@ -1204,7 +1208,7 @@ describe('DeviceInfoTest', function () {
let len = manufactureInfo.length
console.info('the value of the manufacture characters is :' + len)
expect(len).assertLarger(MAX_CHARACTERS_NUM);
let str = /[\w-\.\(\)]/g;
let arr = manufactureInfo.match(str);
let bufferstr = arr.join('');
......@@ -1213,6 +1217,7 @@ describe('DeviceInfoTest', function () {
console.info('device_info_test_046 :end')
})
/**
* @tc.number SUB_STARTUP_JS_DEVCEINFO_0520
* @tc.name testGetProductBrand03
......@@ -1238,6 +1243,7 @@ describe('DeviceInfoTest', function () {
console.info('device_info_test_047 :end');
})
/**
* @tc.number SUB_STARTUP_JS_DEVCEINFO_0530
* @tc.name testGetMarketName03
......@@ -1328,6 +1334,7 @@ describe('DeviceInfoTest', function () {
console.info('device_info_test_036 :end')
})
/**
* @tc.number SUB_STARTUP_JS_DEVCEINFO_0570
* @tc.name testGetHardwareModel03
......@@ -1402,9 +1409,10 @@ describe('DeviceInfoTest', function () {
let bufferstr = arr.join('');
console.info('the value of the bufferstr is :' + bufferstr);
expect(serialInfo).assertEqual(bufferstr);
console.info('device_info_test_054 :end');
})
/**
* @tc.number SUB_STARTUP_JS_DEVCEINFO_0610
* @tc.name testGetDisplayVersion03
......@@ -1424,6 +1432,7 @@ describe('DeviceInfoTest', function () {
console.info('device_info_test_055 :end');
})
/**
* @tc.number SUB_STARTUP_JS_DEVCEINFO_0620
* @tc.name testGetIncrementalVersionInfo02
......@@ -1475,6 +1484,7 @@ describe('DeviceInfoTest', function () {
console.info('device_info_test_057 :end')
})
/**
* @tc.number SUB_STARTUP_JS_DEVCEINFO_0640
* @tc.name testGetVersionId03
......@@ -1531,6 +1541,7 @@ describe('DeviceInfoTest', function () {
expect(len).assertLarger(MAX_CHARACTERS_NUM);
console.info('device_info_test_060 :end');
})
/**
* @tc.number SUB_STARTUP_JS_DEVCEINFO_0670
* @tc.name testGetSecurityPatchTag02
......@@ -1548,10 +1559,10 @@ describe('DeviceInfoTest', function () {
let reFormat = /^(\d{4})-(\d{2})-(\d{2})$/;
let re = securityPatchTagInfo.match(reFormat);
if (re != null){
if (re != null) {
ret = true;
expect(ret).assertTrue();
}else{
} else {
console.info('the return formate is not yy--mm--dd');
}
......
......@@ -14,7 +14,4 @@
*/
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.
先完成此消息的编辑!
想要评论请 注册