未验证 提交 54eef481 编写于 作者: O openharmony_ci 提交者: Gitee

!4357 modified fa-js PART10

Merge pull request !4357 from jiyong/local-20220716-0008
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
# 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.
import("//test/xts/tools/build/suite.gni") import("//test/xts/tools/build/suite.gni")
...@@ -23,7 +23,9 @@ ohos_js_hap_suite("startup_deviceinfo_js_test") { ...@@ -23,7 +23,9 @@ ohos_js_hap_suite("startup_deviceinfo_js_test") {
hap_name = "ActsStartupSysDeviceInfoTest" hap_name = "ActsStartupSysDeviceInfoTest"
} }
ohos_js_assets("startup_js_assets") { ohos_js_assets("startup_js_assets") {
source_dir = "./src/main/js/default" js2abc = true
hap_profile = "./src/main/config.json"
source_dir = "./src/main/js"
} }
ohos_resources("startup_js_resources") { ohos_resources("startup_js_resources") {
sources = [ "./src/main/resources" ] sources = [ "./src/main/resources" ]
......
{ {
"description": "Configuration for startup js api Tests", "description": "Configuration for startup js api Tests",
"driver": { "driver": {
"type": "JSUnitTest", "type": "OHJSUnitTest",
"test-timeout": "300000", "test-timeout": "300000",
"package": "ohos.acts.startup.js.function", "shell-timeout": "300000",
"shell-timeout": "60000" "bundle-name": "ohos.acts.startup.js.function",
}, "package-name": "ohos.acts.startup.js.function"
"kits": [ },
{ "kits": [
"test-file-name": [ {
"ActsStartupSysDeviceInfoTest.hap" "test-file-name": [
], "ActsStartupSysDeviceInfoTest.hap"
"type": "AppInstallKit", ],
"cleanup-apps": true "type": "AppInstallKit",
} "cleanup-apps": true
] }
} ]
}
\ No newline at end of file
{ {
"app": { "app": {
"bundleName": "ohos.acts.startup.js.function", "bundleName": "ohos.acts.startup.js.function",
"vendor": "example", "vendor": "example",
"version": { "version": {
"code": 1, "code": 1,
"name": "1.0" "name": "1.0"
}, },
"apiVersion": { "apiVersion": {
"compatible": 4, "compatible": 4,
"target": 5 "target": 5
} }
}, },
"deviceConfig": {}, "deviceConfig": {},
"module": { "module": {
"package": "ohos.acts.startup.js.function", "package": "ohos.acts.startup.js.function",
"name": ".MyApplication", "name": ".entry",
"deviceType": [ "deviceType": [
"phone" "phone"
], ],
"distro": { "distro": {
"deliveryWithInstall": true, "deliveryWithInstall": true,
"moduleName": "entry", "moduleName": "entry",
"moduleType": "entry" "moduleType": "entry"
}, },
"abilities": [ "abilities": [
{ {
"visible": true, "skills": [
"skills": [ {
{ "entities": [
"entities": [ "entity.system.home"
"entity.system.home" ],
], "actions": [
"actions": [ "action.system.home"
"action.system.home" ]
] }
} ],
], "orientation": "unspecified",
"name": "ohos.acts.startup.js.function.MainAbility", "formsEnabled": false,
"icon": "$media:icon", "name": ".MainAbility",
"description": "$string:mainability_description", "srcLanguage": "js",
"label": "$string:app_name", "srcPath": "MainAbility",
"type": "page", "icon": "$media:icon",
"launchType": "standard" "description": "$string:MainAbility_desc",
} "label": "$string:MainAbility_label",
], "type": "page",
"reqPermissions": [ "visible": true,
{ "launchType": "standard"
"name":"ohos.permission.sec.ACCESS_UDID", },
"reason":"need use ohos.permission.sec.ACCESS_UDID", {
"usedScene": { "orientation": "unspecified",
"ability": [ "formsEnabled": false,
"FormAbility" "name": ".TestAbility",
], "srcLanguage": "js",
"when": "inuse" "srcPath": "TestAbility",
} "icon": "$media:icon",
}], "description": "$string:TestAbility_desc",
"js": [ "label": "$string:TestAbility_label",
{ "type": "page",
"pages": [ "visible": true,
"pages/index/index" "launchType": "standard"
], }
"name": "default", ],
"window": { "reqPermissions": [
"designWidth": 720, {
"autoDesignWidth": false "name": "ohos.permission.sec.ACCESS_UDID",
} "reason": "need use ohos.permission.sec.ACCESS_UDID",
} "usedScene": {
] "ability": [
} "FormAbility"
} ],
"when": "inuse"
}
}
],
"js": [
{
"pages": [
"pages/index/index"
],
"name": "default",
"window": {
"designWidth": 720,
"autoDesignWidth": false
}
},
{
"pages": [
"pages/index/index"
],
"name": ".TestAbility",
"window": {
"designWidth": 720,
"autoDesignWidth": false
}
}
],
"testRunner": {
"name": "OpenHarmonyTestRunner",
"srcPath": "TestRunner"
},
"mainAbility": ".MainAbility",
"srcPath": ""
}
}
\ No newline at end of file
/* /*
* 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.
*/ */
import {Core, ExpectExtend} from 'deccjsunit/index'
const injectRef = Object.getPrototypeOf(global) || global
const injectRef = Object.getPrototypeOf(global) || global injectRef.regeneratorRuntime = require('@babel/runtime/regenerator')
injectRef.regeneratorRuntime = require('@babel/runtime/regenerator')
export default {
export default { data: {
data: { title: ""
title: "" },
}, onInit() {
onInit() { 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() onReady() {
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) 2022 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 AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'
import { Hypium } from '@ohos/hypium'
import testsuite from '../test/List.test'
export default {
onCreate() {
console.info('TestApplication onCreate')
var abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator()
var abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments()
console.info('start run testcase!!!')
Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite)
},
onDestroy() {
console.info("TestApplication onDestroy");
}
};
{
"strings": {
"hello": "Hello",
"world": "World"
},
"Files": {
}
}
\ No newline at end of file
{
"strings": {
"hello": "您好",
"world": "世界"
},
"Files": {
}
}
\ No newline at end of file
.container {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
left: 0px;
top: 0px;
width: 100%;
height: 100%;
}
.title {
font-size: 60px;
text-align: center;
width: 100%;
height: 40%;
margin: 10px;
}
@media screen and (device-type: phone) and (orientation: landscape) {
.title {
font-size: 60px;
}
}
@media screen and (device-type: tablet) and (orientation: landscape) {
.title {
font-size: 100px;
}
}
\ No newline at end of file
<div class="container">
<text class="title">
{{ $t('strings.hello') }} {{ title }}
</text>
</div>
/*
* Copyright (c) 2022 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 {
data: {
title: ""
},
onInit() {
this.title = this.$t('strings.world');
}
}
/*
* Copyright (c) 2022 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 AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'
function translateParamsToString(parameters) {
const keySet = new Set([
'-s class', '-s notClass', '-s suite', '-s itName',
'-s level', '-s testType', '-s size', '-s timeout',
'-s package', '-s dryRun'
])
let targetParams = '';
for (const key in parameters) {
if (keySet.has(key)) {
targetParams += ' ' + key + ' ' + parameters[key]
}
}
return targetParams.trim()
}
export default {
onPrepare() {
console.info('OpenHarmonyTestRunner OnPrepare')
},
onRun() {
console.log('OpenHarmonyTestRunner onRun run')
var abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments()
var abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator()
var testAbilityName = abilityDelegatorArguments.parameters['-p'] + '.TestAbility'
var cmd = 'aa start -d 0 -a ' + testAbilityName + ' -b ' + abilityDelegatorArguments.bundleName
cmd += ' ' + translateParamsToString(abilityDelegatorArguments.parameters)
var debug = abilityDelegatorArguments.parameters["-D"]
console.info('debug value : '+debug)
if (debug == 'true')
{
cmd += ' -D'
}
console.info('cmd : '+cmd)
abilityDelegator.executeShellCommand(cmd, (err, data) => {
console.info('executeShellCommand : err : ' + JSON.stringify(err));
console.info('executeShellCommand : data : ' + data.stdResult);
console.info('executeShellCommand : data : ' + data.exitCode);
})
}
};
/* /*
* 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.
*/ */
import DeviceInfoTest from './DeviceInfoJsUnit.test.js'
require('./DeviceInfoJsUnit.test.js') import SystemParameterTest from './ParametersJsUnit.test.js'
require('./ParametersJsUnit.test.js') import SystemDeviceTest from './SystemDeviceApi.test.js'
require('./SystemDeviceApi.test.js')
export default function testsuite() {
DeviceInfoTest()
SystemParameterTest()
SystemDeviceTest()
}
{ {
"string": [ "string": [
{ {
"name": "app_name", "name": "app_name",
"value": "StartupJSApiTest" "value": "StartupJSApiTest"
}, },
{ {
"name": "mainability_description", "name": "mainability_description",
"value": "JS_Phone_Empty Feature Ability" "value": "JS_Phone_Empty Feature Ability"
} },
] {
"name": "MainAbility_desc",
"value": "description"
},
{
"name": "MainAbility_label",
"value": "label"
},
{
"name": "TestAbility_desc",
"value": "description"
},
{
"name": "TestAbility_label",
"value": "label"
}
]
} }
\ No newline at end of file
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
# 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.
import("//test/xts/tools/build/suite.gni") import("//test/xts/tools/build/suite.gni")
...@@ -23,7 +23,9 @@ ohos_js_hap_suite("startup_syscapability_js_test") { ...@@ -23,7 +23,9 @@ ohos_js_hap_suite("startup_syscapability_js_test") {
hap_name = "ActsStartupSysCapabilityTest" hap_name = "ActsStartupSysCapabilityTest"
} }
ohos_js_assets("startup_js_assets") { ohos_js_assets("startup_js_assets") {
source_dir = "./src/main/js/default" js2abc = true
hap_profile = "./src/main/config.json"
source_dir = "./src/main/js"
} }
ohos_resources("startup_js_resources") { ohos_resources("startup_js_resources") {
sources = [ "./src/main/resources" ] sources = [ "./src/main/resources" ]
......
{ {
"description": "Configuration for startup syscap js api Tests", "description": "Configuration for startup syscap js api Tests",
"driver": { "driver": {
"type": "JSUnitTest", "type": "OHJSUnitTest",
"test-timeout": "300000", "test-timeout": "300000",
"package": "ohos.acts.startup.syscap.function", "shell-timeout": "300000",
"shell-timeout": "60000" "bundle-name": "ohos.acts.startup.syscap.function",
}, "package-name": "ohos.acts.startup.syscap.function"
"kits": [ },
{ "kits": [
"test-file-name": [ {
"ActsStartupSysCapabilityTest.hap" "test-file-name": [
], "ActsStartupSysCapabilityTest.hap"
"type": "AppInstallKit", ],
"cleanup-apps": true "type": "AppInstallKit",
} "cleanup-apps": true
] }
]
} }
\ No newline at end of file
{ {
"app": { "app": {
"bundleName": "ohos.acts.startup.syscap.function", "bundleName": "ohos.acts.startup.syscap.function",
"vendor": "example", "vendor": "example",
"version": { "version": {
"code": 1, "code": 1,
"name": "1.0" "name": "1.0"
}, },
"apiVersion": { "apiVersion": {
"compatible": 4, "compatible": 4,
"target": 5 "target": 5
} }
}, },
"deviceConfig": {}, "deviceConfig": {},
"module": { "module": {
"package": "ohos.acts.startup.syscap.function", "package": "ohos.acts.startup.syscap.function",
"name": ".MyApplication", "name": ".entry",
"deviceType": [ "deviceType": [
"phone" "phone"
], ],
"distro": { "distro": {
"deliveryWithInstall": true, "deliveryWithInstall": true,
"moduleName": "entry", "moduleName": "entry",
"moduleType": "entry" "moduleType": "entry"
}, },
"abilities": [ "abilities": [
{ {
"visible": true, "skills": [
"skills": [ {
{ "entities": [
"entities": [ "entity.system.home"
"entity.system.home" ],
], "actions": [
"actions": [ "action.system.home"
"action.system.home" ]
] }
} ],
], "orientation": "unspecified",
"name": "ohos.acts.startup.syscap.function.MainAbility", "formsEnabled": false,
"icon": "$media:icon", "name": ".MainAbility",
"description": "$string:mainability_description", "srcLanguage": "js",
"label": "$string:app_name", "srcPath": "MainAbility",
"type": "page", "icon": "$media:icon",
"launchType": "standard" "description": "$string:MainAbility_desc",
} "label": "$string:MainAbility_label",
], "type": "page",
"js": [ "visible": true,
{ "launchType": "standard"
"pages": [ },
"pages/index/index" {
], "orientation": "unspecified",
"name": "default", "formsEnabled": false,
"window": { "name": ".TestAbility",
"designWidth": 720, "srcLanguage": "js",
"autoDesignWidth": false "srcPath": "TestAbility",
} "icon": "$media:icon",
} "description": "$string:TestAbility_desc",
] "label": "$string:TestAbility_label",
} "type": "page",
"visible": true,
"launchType": "standard"
}
],
"js": [
{
"pages": [
"pages/index/index"
],
"name": "default",
"window": {
"designWidth": 720,
"autoDesignWidth": false
}
},
{
"pages": [
"pages/index/index"
],
"name": ".TestAbility",
"window": {
"designWidth": 720,
"autoDesignWidth": false
}
}
],
"testRunner": {
"name": "OpenHarmonyTestRunner",
"srcPath": "TestRunner"
},
"mainAbility": ".MainAbility",
"srcPath": ""
}
} }
\ No newline at end of file
/* /*
* 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.
*/ */
import {Core, ExpectExtend} from 'deccjsunit/index'
const injectRef = Object.getPrototypeOf(global) || global
const injectRef = Object.getPrototypeOf(global) || global injectRef.regeneratorRuntime = require('@babel/runtime/regenerator')
injectRef.regeneratorRuntime = require('@babel/runtime/regenerator')
export default {
export default { data: {
data: { title: ""
title: "" },
}, onInit() {
onInit() { 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() onReady() {
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) 2022 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 AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'
import { Hypium } from '@ohos/hypium'
import testsuite from '../test/List.test'
export default {
onCreate() {
console.info('TestApplication onCreate')
var abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator()
var abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments()
console.info('start run testcase!!!')
Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite)
},
onDestroy() {
console.info("TestApplication onDestroy");
}
};
{
"strings": {
"hello": "Hello",
"world": "World"
},
"Files": {
}
}
\ No newline at end of file
{
"strings": {
"hello": "您好",
"world": "世界"
},
"Files": {
}
}
\ No newline at end of file
.container {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
left: 0px;
top: 0px;
width: 100%;
height: 100%;
}
.title {
font-size: 60px;
text-align: center;
width: 100%;
height: 40%;
margin: 10px;
}
@media screen and (device-type: phone) and (orientation: landscape) {
.title {
font-size: 60px;
}
}
@media screen and (device-type: tablet) and (orientation: landscape) {
.title {
font-size: 100px;
}
}
\ No newline at end of file
<div class="container">
<text class="title">
{{ $t('strings.hello') }} {{ title }}
</text>
</div>
/*
* Copyright (c) 2022 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 {
data: {
title: ""
},
onInit() {
this.title = this.$t('strings.world');
}
}
/*
* Copyright (c) 2022 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 AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'
function translateParamsToString(parameters) {
const keySet = new Set([
'-s class', '-s notClass', '-s suite', '-s itName',
'-s level', '-s testType', '-s size', '-s timeout',
'-s package', '-s dryRun'
])
let targetParams = '';
for (const key in parameters) {
if (keySet.has(key)) {
targetParams += ' ' + key + ' ' + parameters[key]
}
}
return targetParams.trim()
}
export default {
onPrepare() {
console.info('OpenHarmonyTestRunner OnPrepare')
},
onRun() {
console.log('OpenHarmonyTestRunner onRun run')
var abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments()
var abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator()
var testAbilityName = abilityDelegatorArguments.parameters['-p'] + '.TestAbility'
var cmd = 'aa start -d 0 -a ' + testAbilityName + ' -b ' + abilityDelegatorArguments.bundleName
cmd += ' ' + translateParamsToString(abilityDelegatorArguments.parameters)
var debug = abilityDelegatorArguments.parameters["-D"]
console.info('debug value : '+debug)
if (debug == 'true')
{
cmd += ' -D'
}
console.info('cmd : '+cmd)
abilityDelegator.executeShellCommand(cmd, (err, data) => {
console.info('executeShellCommand : err : ' + JSON.stringify(err));
console.info('executeShellCommand : data : ' + data.stdResult);
console.info('executeShellCommand : data : ' + data.exitCode);
})
}
};
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
# 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.
import("//test/xts/tools/build/suite.gni") import("//test/xts/tools/build/suite.gni")
...@@ -23,7 +23,9 @@ ohos_js_hap_suite("startup_sysparam_js_test") { ...@@ -23,7 +23,9 @@ ohos_js_hap_suite("startup_sysparam_js_test") {
hap_name = "ActsStartupSysParamTest" hap_name = "ActsStartupSysParamTest"
} }
ohos_js_assets("startup_js_assets") { ohos_js_assets("startup_js_assets") {
source_dir = "./src/main/js/default" js2abc = true
hap_profile = "./src/main/config.json"
source_dir = "./src/main/js"
} }
ohos_resources("startup_js_resources") { ohos_resources("startup_js_resources") {
sources = [ "./src/main/resources" ] sources = [ "./src/main/resources" ]
......
{
"strings": {
"hello": "Hello",
"world": "World"
},
"Files": {
}
}
\ No newline at end of file
<div class="container">
<text class="title">
{{ $t('strings.hello') }} {{ title }}
</text>
</div>
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册