提交 e969a100 编写于 作者: O openharmony_ci 提交者: Gitee

!461 修改测试用例

Merge pull request !461 from chensi10/master
...@@ -10,13 +10,14 @@ ...@@ -10,13 +10,14 @@
# 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("//build/ohos_var.gni") import("//build/ohos_var.gni")
group("appexecfwk") { group("bundle_standard") {
testonly = true testonly = true
if (is_standard_system) { if (is_standard_system) {
} else {
deps = [ deps = [
"bundlemanager:ActsBundleManagerTest",
] ]
} }
} }
# 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("//build/config/ohos/rules.gni")
import("//test/xts/tools/build/suite.gni")
ohos_js_hap_suite("hjs_demo_test1") {
test_hap_name = "bmsJstest1.hap"
hap_source_path = "hap/bmsJstest1.hap"
}
{
"description": "Configuration for hjunit demo Tests",
"driver": {
"type": "JSUnitTest",
"test-timeout": "21600000",
"package": "ohos.acts.aafwk.ability",
"shell-timeout": "21600000"
},
"kits": [
{
"test-file-name": [
"AbilityDemo.hap",
"$module.hap"
],
"type": "AppInstallKit",
"cleanup-apps": true
}
]
}
# 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("//build/config/ohos/rules.gni")
import("//test/xts/tools/build/suite.gni")
ohos_js_hap_suite("hjs_demo_test2") {
test_hap_name = "bmsJstest2.hap"
hap_source_path = "hap/bmsJstest2.hap"
}
{
"description": "Configuration for hjunit demo Tests",
"driver": {
"type": "JSUnitTest",
"test-timeout": "21600000",
"package": "ohos.acts.aafwk.ability",
"shell-timeout": "21600000"
},
"kits": [
{
"test-file-name": [
"AbilityDemo.hap",
"$module.hap"
],
"type": "AppInstallKit",
"cleanup-apps": true
}
]
}
# 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("//build/config/ohos/rules.gni")
import("//test/xts/tools/build/suite.gni")
ohos_js_hap_suite("hjs_demo_test3") {
test_hap_name = "bmsJstest3.hap"
hap_source_path = "hap/bmsJstest3.hap"
}
{
"description": "Configuration for hjunit demo Tests",
"driver": {
"type": "JSUnitTest",
"test-timeout": "21600000",
"package": "ohos.acts.aafwk.ability",
"shell-timeout": "21600000"
},
"kits": [
{
"test-file-name": [
"AbilityDemo.hap",
"$module.hap"
],
"type": "AppInstallKit",
"cleanup-apps": true
}
]
}
export default {
onCreate() {
console.info('AceApplication onCreate');
},
onDestroy() {
console.info('AceApplication onDestroy');
}
};
import file from '@system.file'
import app from '@system.app'
import device from '@system.device'
import router from '@system.router'
import {Core, ExpectExtend, ReportExtend} from 'deccjsunit/index'
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'
})
const reportExtend = new ReportExtend(file)
// const instrumentLog = new InstrumentLog({
// 'id': 'report'
// })
core.addService('expect', expectExtend)
core.addService('report', reportExtend)
// core.addService('report', instrumentLog)
core.init()
// core.subscribeEvent('spec', instrumentLog)
// core.subscribeEvent('suite', instrumentLog)
// core.subscribeEvent('task', instrumentLog)
const configService = core.getDefaultService('config')
configService.setConfig(this)
require('../../../test/List.test')
core.execute()
},
onReady() {
},
}
\ No newline at end of file
require('./ExampleJsunit.test.js')
\ 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.
import("//build/config/ohos/rules.gni")
import("//test/xts/tools/build/suite.gni")
ohos_js_hap_suite("hjs_demo_test5") {
test_hap_name = "bmsJstest5.hap"
hap_source_path = "hap/bmsJstest5.hap"
}
{
"description": "Configuration for hjunit demo Tests",
"driver": {
"type": "JSUnitTest",
"test-timeout": "21600000",
"package": "ohos.acts.aafwk.ability",
"shell-timeout": "21600000"
},
"kits": [
{
"test-file-name": [
"AbilityDemo.hap",
"$module.hap"
],
"type": "AppInstallKit",
"cleanup-apps": true
}
]
}
{
"app": {
"bundleName": "com.example.napi_test_suite",
"vendor": "example",
"version": {
"code": 1,
"name": "1.0"
},
"apiVersion": {
"compatible": 5,
"target": 5,
"releaseType": "Beta1"
}
},
"deviceConfig": {},
"module": {
"package": "com.example.napi_test_suite",
"name": ".MyApplication2",
"deviceType": [
"phone"
],
"distro": {
"deliveryWithInstall": true,
"moduleName": "entry",
"moduleType": "entry"
},
"abilities": [
{
"skills": [
{
"entities": [
"entity.system.home"
],
"actions": [
"action.system.home"
]
}
],
"name": "com.example.napi_test_suite.MainAbility",
"icon": "$media:icon",
"description": "$string:mainability_description",
"label": "$string:app_name",
"type": "page",
"launchType": "standard"
}
],
"defPermissions": [
{
"name": "com.permission.CAMERA",
"grantMode": "system_grant",
"availableScope": ["signature"],
"label": "CAMERA permission",
"description": "CAMERA permission in detail"
},
{
"name": "com.permission.music",
"grantMode": "system_grant",
"availableScope": ["signature"],
"label": "music permission",
"description": "music permission in detail"
},
{
"name": "com.permission.WeChat",
"grantMode": "system_grant",
"availableScope": ["signature"],
"label": "WeChat permission",
"description": "WeChat permission in detail"
}
],
"js": [
{
"pages": [
"pages/index/index"
],
"name": "default",
"window": {
"designWidth": 720,
"autoDesignWidth": false
}
}
]
}
}
\ No newline at end of file
export default {
onCreate() {
console.info('AceApplication onCreate');
},
onDestroy() {
console.info('AceApplication onDestroy');
}
};
.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>
import file from '@system.file'
import app from '@system.app'
import device from '@system.device'
import router from '@system.router'
import {Core, ExpectExtend, ReportExtend} from 'deccjsunit/index'
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'
})
const reportExtend = new ReportExtend(file)
// const instrumentLog = new InstrumentLog({
// 'id': 'report'
// })
core.addService('expect', expectExtend)
core.addService('report', reportExtend)
// core.addService('report', instrumentLog)
core.init()
// core.subscribeEvent('spec', instrumentLog)
// core.subscribeEvent('suite', instrumentLog)
// core.subscribeEvent('task', instrumentLog)
const configService = core.getDefaultService('config')
configService.setConfig(this)
require('../../../test/List.test')
core.execute()
},
onReady() {
},
}
\ No newline at end of file
require('./ExampleJsunit.test.js')
\ 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.
import("//build/config/ohos/rules.gni")
import("//test/xts/tools/build/suite.gni")
ohos_js_hap_suite("hjs_demo_test6") {
test_hap_name = "bmsJstest6.hap"
hap_source_path = "hap/bmsJstest6.hap"
}
{
"description": "Configuration for hjunit demo Tests",
"driver": {
"type": "JSUnitTest",
"test-timeout": "21600000",
"package": "ohos.acts.aafwk.ability",
"shell-timeout": "21600000"
},
"kits": [
{
"test-file-name": [
"AbilityDemo.hap",
"$module.hap"
],
"type": "AppInstallKit",
"cleanup-apps": true
}
]
}
export default {
onCreate() {
console.info('AceApplication onCreate');
},
onDestroy() {
console.info('AceApplication onDestroy');
}
};
.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>
import file from '@system.file'
import app from '@system.app'
import device from '@system.device'
import router from '@system.router'
import {Core, ExpectExtend, ReportExtend} from 'deccjsunit/index'
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'
})
const reportExtend = new ReportExtend(file)
// const instrumentLog = new InstrumentLog({
// 'id': 'report'
// })
core.addService('expect', expectExtend)
core.addService('report', reportExtend)
// core.addService('report', instrumentLog)
core.init()
// core.subscribeEvent('spec', instrumentLog)
// core.subscribeEvent('suite', instrumentLog)
// core.subscribeEvent('task', instrumentLog)
const configService = core.getDefaultService('config')
configService.setConfig(this)
require('../../../test/List.test')
core.execute()
},
onReady() {
},
}
\ No newline at end of file
require('./ExampleJsunit.test.js')
\ No newline at end of file
...@@ -13,7 +13,10 @@ ...@@ -13,7 +13,10 @@
import("//build/config/ohos/rules.gni") import("//build/config/ohos/rules.gni")
import("//test/xts/tools/build/suite.gni") import("//test/xts/tools/build/suite.gni")
ohos_js_hap_suite("hjs_demo_test4") { ohos_js_hap_suite("ActsBundleManagerTest") {
test_hap_name = "bmsJstest4.hap" test_hap_name = "ActsBundleManagerTest"
hap_source_path = "hap/bmsJstest4.hap" hap_source_path = "hap/napi_test_suite_scene1.hap"
} hap_source_path = "hap/napi_test_suite_scene2.hap"
hap_source_path = "hap/napi_test_suite_scene3.hap"
hap_source_path = "hap/napi_test_suite_scene4.hap"
}
\ No newline at end of file
...@@ -3,13 +3,13 @@ ...@@ -3,13 +3,13 @@
"driver": { "driver": {
"type": "JSUnitTest", "type": "JSUnitTest",
"test-timeout": "21600000", "test-timeout": "21600000",
"package": "ohos.acts.aafwk.ability", "package": "ohos.acts.appexecfwk.bundlemanager",
"shell-timeout": "21600000" "shell-timeout": "21600000"
}, },
"kits": [ "kits": [
{ {
"test-file-name": [ "test-file-name": [
"AbilityDemo.hap", "BundleManagerDemo.hap",
"$module.hap" "$module.hap"
], ],
"type": "AppInstallKit", "type": "AppInstallKit",
......
...@@ -18,17 +18,9 @@ export default { ...@@ -18,17 +18,9 @@ export default {
'id': 'extend' 'id': 'extend'
}) })
const reportExtend = new ReportExtend(file) const reportExtend = new ReportExtend(file)
// const instrumentLog = new InstrumentLog({
// 'id': 'report'
// })
core.addService('expect', expectExtend) core.addService('expect', expectExtend)
core.addService('report', reportExtend) core.addService('report', reportExtend)
// core.addService('report', instrumentLog)
core.init() core.init()
// core.subscribeEvent('spec', instrumentLog)
// core.subscribeEvent('suite', instrumentLog)
// core.subscribeEvent('task', instrumentLog)
const configService = core.getDefaultService('config') const configService = core.getDefaultService('config')
configService.setConfig(this) configService.setConfig(this)
......
import app from '@system.app'
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index'
import demo from '@ohos.bundle'
describe('appInfoTest', function () {
it('getApplicationInfos_0100', 0, async function (done) {
var datainfo = await demo.getApplicationInfos(8, 0)
checkgetApplicationInfos(datainfo)
done()
})
function checkgetApplicationInfos(datainfo) {
expect(typeof datainfo).assertEqual("object")
expect(datainfo.length).assertLarger(0)
for (var i = 0; i < datainfo.length; i++) {
expect(datainfo[i].name.length).assertLarger(0)
expect(datainfo[i].description.length).assertLarger(0)
expect(datainfo[i].icon.length).assertLarger(0)
expect(datainfo[i].label.length).assertLarger(0)
expect(datainfo[i].entryDir.length).assertLarger(0)
expect(datainfo[i].moduleSourceDirs.length).assertLarger(0)
expect(datainfo[i].moduleInfos.length).assertLarger(0)
}
}
it('getApplicationInfos_0600', 0, async function (done) {
await demo.getApplicationInfos(8, 0, (error, datainfo) => {
expect(typeof datainfo).assertEqual("object")
expect(datainfo.length).assertLarger(0)
for (var i = 0; i < datainfo.length; i++) {
expect(datainfo[i].name.length).assertLarger(0)
expect(datainfo[i].description.length).assertLarger(0)
expect(datainfo[i].icon.length).assertLarger(0)
expect(datainfo[i].label.length).assertLarger(0)
expect(datainfo[i].entryDir.length).assertLarger(0)
expect(datainfo[i].moduleSourceDirs.length).assertLarger(0)
expect(datainfo[i].moduleInfos.length).assertLarger(0)
}
});
done()
})
it('getApplicationInfo_0100', 0, async function (done) {
var datainfo = await demo.getApplicationInfo('com.example.myapplication1', 8, 1)
expect(typeof datainfo).assertEqual("object")
expect(datainfo.name.length).assertLarger(0)
expect(datainfo.description.length).assertLarger(0)
expect(datainfo.icon.length).assertLarger(0)
expect(datainfo.label.length).assertLarger(0)
expect(datainfo.entryDir.length).assertLarger(0)
expect(datainfo.moduleSourceDirs.length).assertLarger(0)
expect(datainfo.moduleInfos.length).assertLarger(0)
done()
})
it('getApplicationInfo_0600', 0, async function (done) {
await demo.getApplicationInfo('com.example.myapplication1', 8, 1, (error, datainfo) => {
expect(typeof datainfo).assertEqual("object")
expect(datainfo.name.length).assertLarger(0)
expect(datainfo.description.length).assertLarger(0)
expect(datainfo.icon.length).assertLarger(0)
expect(datainfo.label.length).assertLarger(0)
expect(datainfo.entryDir.length).assertLarger(0)
expect(datainfo.moduleSourceDirs.length).assertLarger(0)
expect(datainfo.moduleInfos.length).assertLarger(0)
})
done()
})
it('getBundleInfos_0100', 0, async function () {
var data = await demo.getBundleInfos(8)
expect(typeof data).assertEqual("object")
expect(data.length).assertLarger(0)
for (var i = 0; i < data.length; i++) {
expect(data[i].name.length).assertLarger(0)
expect(data[i].entryModuleName.length).assertLarger(0)
expect(typeof data[i].appInfo).assertEqual("object")
expect(data[i].abilityInfos.length).assertLarger(0)
}
})
it('getBundleInfos_0600', 0, async function () {
await demo.getBundleInfos(8, (error, datainfo) => {
expect(typeof datainfo).assertEqual("object")
expect(datainfo.length).assertLarger(0)
for (var i = 0; i < datainfo.length; i++) {
expect(datainfo[i].name.length).assertLarger(0)
expect(datainfo[i].entryModuleName.length).assertLarger(0)
expect(typeof datainfo[i].appInfo).assertEqual("object")
expect(datainfo[i].abilityInfos.length).assertLarger(0)
}
})
})
it('getApplicationInfo_0400', 0, async function (done) {
var datainfo = await demo.getApplicationInfo('com.example.napi_test_suitee', 8, 1)
checkgetApplicationInfoe(datainfo)
done()
})
function checkgetApplicationInfoe(datainfo) {
expect(datainfo.name.length).assertEqual(0)
}
it('getApplicationInfo_0500', 0, async function (done) {
await demo.getApplicationInfo('', 8, 1, (error, datainfo) => {
expect(datainfo.name.length).assertEqual(0)
})
done()
})
it('getApplicationInfo_0900', 0, async function (done) {
await demo.getApplicationInfo('com.example.napi_test_suitee', 8, 1, (error, datainfo) => {
expect(datainfo.name.length).assertEqual(0)
})
done()
})
it('getApplicationInfo_1000', 0, async function (done) {
await demo.getApplicationInfo('', 8, 1, (error, datainfo) => {
expect(datainfo.name.length).assertEqual(0)
})
done()
})
})
\ No newline at end of file
...@@ -18,17 +18,9 @@ export default { ...@@ -18,17 +18,9 @@ export default {
'id': 'extend' 'id': 'extend'
}) })
const reportExtend = new ReportExtend(file) const reportExtend = new ReportExtend(file)
// const instrumentLog = new InstrumentLog({
// 'id': 'report'
// })
core.addService('expect', expectExtend) core.addService('expect', expectExtend)
core.addService('report', reportExtend) core.addService('report', reportExtend)
// core.addService('report', instrumentLog)
core.init() core.init()
// core.subscribeEvent('spec', instrumentLog)
// core.subscribeEvent('suite', instrumentLog)
// core.subscribeEvent('task', instrumentLog)
const configService = core.getDefaultService('config') const configService = core.getDefaultService('config')
configService.setConfig(this) configService.setConfig(this)
......
import app from '@system.app'
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index'
import demo from '@ohos.bundle'
describe('appInfoTest', function () {
it('getApplicationInfos_0200', 0, async function (done) {
var datainfo = await demo.getApplicationInfos(8, 0)
checkgetApplicationInfos(datainfo)
done()
})
function checkgetApplicationInfos(datainfo) {
expect(typeof datainfo).assertEqual("object")
expect(datainfo.length).assertLarger(0)
for (var i = 0; i < datainfo.length; i++) {
expect(datainfo[i].name.length).assertLarger(0)
expect(datainfo[i].description.length).assertLarger(0)
expect(datainfo[i].icon.length).assertLarger(0)
expect(datainfo[i].label.length).assertLarger(0)
expect(datainfo[i].entryDir.length).assertLarger(0)
expect(datainfo[i].moduleSourceDirs.length).assertLarger(0)
expect(datainfo[i].moduleInfos.length).assertLarger(0)
}
}
it('getApplicationInfos_0400', 0, async function (done) {
var datainfo = await demo.getApplicationInfos(8, 0)
checkgetApplicationInfos(datainfo)
done()
})
function checkgetApplicationInfos(datainfo) {
expect(typeof datainfo).assertEqual("object")
expect(datainfo.length).assertLarger(0)
for (var i = 0; i < datainfo.length; i++) {
expect(datainfo[i].name.length).assertLarger(0)
expect(datainfo[i].description.length).assertLarger(0)
expect(datainfo[i].icon.length).assertLarger(0)
expect(datainfo[i].label.length).assertLarger(0)
expect(datainfo[i].entryDir.length).assertLarger(0)
expect(datainfo[i].moduleSourceDirs.length).assertLarger(0)
expect(datainfo[i].moduleInfos.length).assertLarger(0)
}
}
it('getApplicationInfos_0700', 0, async function (done) {
await demo.getApplicationInfos(8, 0, (error, datainfo) => {
expect(typeof datainfo).assertEqual("object")
expect(datainfo.length).assertLarger(0)
for (var i = 0; i < datainfo.length; i++) {
expect(datainfo[i].name.length).assertLarger(0)
expect(datainfo[i].description.length).assertLarger(0)
expect(datainfo[i].icon.length).assertLarger(0)
expect(datainfo[i].label.length).assertLarger(0)
expect(datainfo[i].entryDir.length).assertLarger(0)
expect(datainfo[i].moduleSourceDirs.length).assertLarger(0)
expect(datainfo[i].moduleInfos.length).assertLarger(0)
}
});
done()
})
it('getApplicationInfos_0900', 0, async function (done) {
await demo.getApplicationInfos(8, 0, (error, datainfo) => {
expect(typeof datainfo).assertEqual("object")
expect(datainfo.length).assertLarger(0)
for (var i = 0; i < datainfo.length; i++) {
expect(datainfo[i].name.length).assertLarger(0)
expect(datainfo[i].description.length).assertLarger(0)
expect(datainfo[i].icon.length).assertLarger(0)
expect(datainfo[i].label.length).assertLarger(0)
expect(datainfo[i].entryDir.length).assertLarger(0)
expect(datainfo[i].moduleSourceDirs.length).assertLarger(0)
expect(datainfo[i].moduleInfos.length).assertLarger(0)
}
});
done()
})
it('getBundleInfos_0200', 0, async function () {
var data = await demo.getBundleInfos(8)
expect(typeof data).assertEqual("object")
expect(data.length).assertLarger(0)
for (var i = 0; i < data.length; i++) {
expect(data[i].name.length).assertLarger(0)
expect(data[i].entryModuleName.length).assertLarger(0)
expect(typeof data[i].appInfo).assertEqual("object")
expect(data[i].abilityInfos.length).assertLarger(0)
}
})
it('getBundleInfos_0400', 0, async function () {
var data = await demo.getBundleInfos(8)
expect(typeof data).assertEqual("object")
expect(data.length).assertLarger(0)
for (var i = 0; i < data.length; i++) {
expect(data[i].name.length).assertLarger(0)
expect(data[i].entryModuleName.length).assertLarger(0)
expect(typeof data[i].appInfo).assertEqual("object")
expect(data[i].abilityInfos.length).assertLarger(0)
}
})
it('getBundleInfos_0700', 0, async function () {
await demo.getBundleInfos(8, (error, datainfo) => {
expect(typeof datainfo).assertEqual("object")
expect(datainfo.length).assertLarger(0)
for (var i = 0; i < datainfo.length; i++) {
expect(datainfo[i].name.length).assertLarger(0)
expect(datainfo[i].entryModuleName.length).assertLarger(0)
expect(typeof datainfo[i].appInfo).assertEqual("object")
expect(datainfo[i].abilityInfos.length).assertLarger(0)
}
})
})
it('getBundleInfos_0900', 0, async function () {
await demo.getBundleInfos(8, (error, datainfo) => {
expect(typeof datainfo).assertEqual("object")
expect(datainfo.length).assertLarger(0)
for (var i = 0; i < datainfo.length; i++) {
expect(datainfo[i].name.length).assertLarger(0)
expect(datainfo[i].entryModuleName.length).assertLarger(0)
expect(typeof datainfo[i].appInfo).assertEqual("object")
expect(datainfo[i].abilityInfos.length).assertLarger(0)
}
})
})
it('getApplicationInfo_0200', 0, async function (done) {
var datainfo = await demo.getApplicationInfo('com.example.myapplication1', 8, 1)
expect(typeof datainfo).assertEqual("object")
expect(datainfo.name.length).assertLarger(0)
expect(datainfo.description.length).assertLarger(0)
expect(datainfo.icon.length).assertLarger(0)
expect(datainfo.label.length).assertLarger(0)
expect(datainfo.entryDir.length).assertLarger(0)
expect(datainfo.moduleSourceDirs.length).assertLarger(0)
expect(datainfo.moduleInfos.length).assertLarger(0)
done()
})
it('getApplicationInfo_0700', 0, async function (done) {
await demo.getApplicationInfo('com.example.myapplication1', 8, 1, (error, datainfo) => {
expect(typeof datainfo).assertEqual("object")
expect(datainfo.name.length).assertLarger(0)
expect(datainfo.description.length).assertLarger(0)
expect(datainfo.icon.length).assertLarger(0)
expect(datainfo.label.length).assertLarger(0)
expect(datainfo.entryDir.length).assertLarger(0)
expect(datainfo.moduleSourceDirs.length).assertLarger(0)
expect(datainfo.moduleInfos.length).assertLarger(0)
})
done()
})
})
\ No newline at end of file
...@@ -18,17 +18,9 @@ export default { ...@@ -18,17 +18,9 @@ export default {
'id': 'extend' 'id': 'extend'
}) })
const reportExtend = new ReportExtend(file) const reportExtend = new ReportExtend(file)
// const instrumentLog = new InstrumentLog({
// 'id': 'report'
// })
core.addService('expect', expectExtend) core.addService('expect', expectExtend)
core.addService('report', reportExtend) core.addService('report', reportExtend)
// core.addService('report', instrumentLog)
core.init() core.init()
// core.subscribeEvent('spec', instrumentLog)
// core.subscribeEvent('suite', instrumentLog)
// core.subscribeEvent('task', instrumentLog)
const configService = core.getDefaultService('config') const configService = core.getDefaultService('config')
configService.setConfig(this) configService.setConfig(this)
......
import app from '@system.app'
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index'
import demo from '@ohos.bundle'
describe('appInfoTest', function () {
it('getApplicationInfos_0300', 0, async function (done) {
var datainfo = await demo.getApplicationInfos(8, 0)
checkgetApplicationInfos(datainfo)
done()
})
function checkgetApplicationInfos(datainfo) {
expect(typeof datainfo).assertEqual("object")
expect(datainfo.length).assertLarger(0)
for (var i = 0; i < datainfo.length; i++) {
expect(datainfo[i].name.length).assertLarger(0)
expect(datainfo[i].description.length).assertLarger(0)
expect(datainfo[i].icon.length).assertLarger(0)
expect(datainfo[i].label.length).assertLarger(0)
expect(datainfo[i].entryDir.length).assertLarger(0)
expect(datainfo[i].moduleSourceDirs.length).assertLarger(0)
expect(datainfo[i].moduleInfos.length).assertLarger(0)
}
}
it('getApplicationInfos_0500', 0, async function (done) {
var datainfo = await demo.getApplicationInfos(8, 0)
checkgetApplicationInfos(datainfo)
done()
})
function checkgetApplicationInfos(datainfo) {
expect(typeof datainfo).assertEqual("object")
expect(datainfo.length).assertLarger(0)
for (var i = 0; i < datainfo.length; i++) {
expect(datainfo[i].name.length).assertLarger(0)
expect(datainfo[i].description.length).assertLarger(0)
expect(datainfo[i].icon.length).assertLarger(0)
expect(datainfo[i].label.length).assertLarger(0)
expect(datainfo[i].entryDir.length).assertLarger(0)
expect(datainfo[i].moduleSourceDirs.length).assertLarger(0)
expect(datainfo[i].moduleInfos.length).assertLarger(0)
}
}
it('getApplicationInfos_0800', 0, async function (done) {
await demo.getApplicationInfos(8, 0, (error, datainfo) => {
expect(typeof datainfo).assertEqual("object")
expect(datainfo.length).assertLarger(0)
for (var i = 0; i < datainfo.length; i++) {
expect(datainfo[i].name.length).assertLarger(0)
expect(datainfo[i].description.length).assertLarger(0)
expect(datainfo[i].icon.length).assertLarger(0)
expect(datainfo[i].label.length).assertLarger(0)
expect(datainfo[i].entryDir.length).assertLarger(0)
expect(datainfo[i].moduleSourceDirs.length).assertLarger(0)
expect(datainfo[i].moduleInfos.length).assertLarger(0)
}
});
done()
})
it('getApplicationInfos_1000', 0, async function (done) {
await demo.getApplicationInfos(8, 0, (error, datainfo) => {
expect(typeof datainfo).assertEqual("object")
expect(datainfo.length).assertLarger(0)
for (var i = 0; i < datainfo.length; i++) {
expect(datainfo[i].name.length).assertLarger(0)
expect(datainfo[i].description.length).assertLarger(0)
expect(datainfo[i].icon.length).assertLarger(0)
expect(datainfo[i].label.length).assertLarger(0)
expect(datainfo[i].entryDir.length).assertLarger(0)
expect(datainfo[i].moduleSourceDirs.length).assertLarger(0)
expect(datainfo[i].moduleInfos.length).assertLarger(0)
}
});
done()
})
it('getBundleInfos_0300', 0, async function () {
var data = await demo.getBundleInfos(8)
expect(typeof data).assertEqual("object")
expect(data.length).assertLarger(0)
for (var i = 0; i < data.length; i++) {
expect(data[i].name.length).assertLarger(0)
expect(data[i].entryModuleName.length).assertLarger(0)
expect(typeof data[i].appInfo).assertEqual("object")
expect(data[i].abilityInfos.length).assertLarger(0)
}
})
it('getBundleInfos_0500', 0, async function () {
var data = await demo.getBundleInfos(8)
expect(typeof data).assertEqual("object")
expect(data.length).assertLarger(0)
for (var i = 0; i < data.length; i++) {
expect(data[i].name.length).assertLarger(0)
expect(data[i].entryModuleName.length).assertLarger(0)
expect(typeof data[i].appInfo).assertEqual("object")
expect(data[i].abilityInfos.length).assertLarger(0)
}
})
it('getBundleInfos_0800', 0, async function () {
await demo.getBundleInfos(8, (error, datainfo) => {
expect(typeof datainfo).assertEqual("object")
expect(datainfo.length).assertLarger(0)
for (var i = 0; i < datainfo.length; i++) {
expect(datainfo[i].name.length).assertLarger(0)
expect(datainfo[i].entryModuleName.length).assertLarger(0)
expect(typeof datainfo[i].appInfo).assertEqual("object")
expect(datainfo[i].abilityInfos.length).assertLarger(0)
}
})
})
it('getBundleInfos_1000', 0, async function () {
await demo.getBundleInfos(8, (error, datainfo) => {
expect(typeof datainfo).assertEqual("object")
expect(datainfo.length).assertLarger(0)
for (var i = 0; i < datainfo.length; i++) {
expect(datainfo[i].name.length).assertLarger(0)
expect(datainfo[i].entryModuleName.length).assertLarger(0)
expect(typeof datainfo[i].appInfo).assertEqual("object")
expect(datainfo[i].abilityInfos.length).assertLarger(0)
}
})
})
it('getApplicationInfo_0300', 0, async function (done) {
var datainfo = await demo.getApplicationInfo('com.example.myapplication1', 8, 1)
expect(typeof datainfo).assertEqual("object")
expect(datainfo.name.length).assertLarger(0)
expect(datainfo.description.length).assertLarger(0)
expect(datainfo.icon.length).assertLarger(0)
expect(datainfo.label.length).assertLarger(0)
expect(datainfo.entryDir.length).assertLarger(0)
expect(datainfo.moduleSourceDirs.length).assertLarger(0)
expect(datainfo.moduleInfos.length).assertLarger(0)
done()
})
it('getApplicationInfo_0800', 0, async function (done) {
await demo.getApplicationInfo('com.example.myapplication1', 8, 1, (error, datainfo) => {
expect(typeof datainfo).assertEqual("object")
expect(datainfo.name.length).assertLarger(0)
expect(datainfo.description.length).assertLarger(0)
expect(datainfo.icon.length).assertLarger(0)
expect(datainfo.label.length).assertLarger(0)
expect(datainfo.entryDir.length).assertLarger(0)
expect(datainfo.moduleSourceDirs.length).assertLarger(0)
expect(datainfo.moduleInfos.length).assertLarger(0)
})
done()
})
})
\ No newline at end of file
export default {
onCreate() {
console.info('AceApplication onCreate start');
//console.info('AceApplication onCreate add ' + demo.add(123,456));
//console.info('AceApplication onCreate getApplicationInfos ' + demo.getApplicationInfos(0,0));
//demo.getApplicationInfosPromise().then(function (data) {console.info('AceApplication onCreate GetApplicationInfosPromise');});
},
onDestroy() {
console.info('AceApplication onDestroy');
}
};
.container { .container {
flex-direction: column;
justify-content: center;
align-items: center;
} }
.title { .title {
font-size: 100px; font-size: 100px;
transform: translate(-10px,-10px);
} }
<div class="container"> <div class="container">
<text class="title"> <text class="title" style="transform : translate({{x}}px,{{y}}px);">
{{ $t('strings.hello') }} {{ title }} {{title}}
</text> </text>
</div> </div>
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册