未验证 提交 06e43988 编写于 作者: O openharmony_ci 提交者: Gitee

!5407 XTS元能力失败用例适配

Merge pull request !5407 from chengxingzhen/master
{
"app": {
"bundleName": "com.example.aacommandprintonetest",
"vendor": "huawei",
"versionCode": 1000000,
"versionName": "1.0.0",
"debug": false,
"icon" : "$media:icon",
"label" : "$string:app_name",
"description" : "$string:description_application",
"distributedNotificationEnabled": true,
"keepAlive" : true,
"singleUser": true,
"minAPIVersion": 9,
"targetAPIVersion": 9,
"car": {
"apiCompatibleVersion": 9,
"singleUser": false
}
}
}
{
"string": [
{
"name": "app_name",
"value": "AACommandPrintSyncTest"
}
]
}
# 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("//test/xts/tools/build/suite.gni")
ohos_js_hap_suite("ActsAACommandPrintOneTest") {
hap_profile = "entry/src/main/module.json"
js_build_mode = "debug"
deps = [
":aacommandprintonetest_js_assets",
":aacommandprintonetest_resources",
]
ets2abc = true
certificate_profile = "signature/openharmony_sx.p7b"
hap_name = "ActsAACommandPrintOneTest"
subsystem_name = "ability"
part_name = "ability_runtime"
}
ohos_app_scope("aacommandprintonetest_app_profile") {
app_profile = "AppScope/app.json"
sources = [ "AppScope/resources" ]
}
ohos_js_assets("aacommandprintonetest_js_assets") {
source_dir = "entry/src/main/ets"
}
ohos_resources("aacommandprintonetest_resources") {
sources = [ "entry/src/main/resources" ]
deps = [ ":aacommandprintonetest_app_profile" ]
hap_profile = "entry/src/main/module.json"
}
{
"description": "Configuration for aceceshi Tests",
"driver": {
"type": "OHJSUnitTest",
"test-timeout": "600000",
"bundle-name": "com.example.aacommandprintonetest",
"module-name": "entry_test",
"shell-timeout": "600000"
},
"kits": [
{
"type": "ShellKit",
"run-command": [
" hilog -Q pidoff",
"hilog -Q domainoff",
"hilog -b D"
]
},
{
"test-file-name": [
"ActsAACommandPrintOneTest.hap",
"AACommandRelyHap.hap"
],
"type": "AppInstallKit",
"cleanup-apps": true
}
]
}
/*
* 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 AbilityStage from "@ohos.application.AbilityStage"
export default class MyAbilityStage extends AbilityStage {
onCreate() {
console.log("[Demo] MyAbilityStage onCreate")
}
}
\ No newline at end of file
/*
* 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 Ability from '@ohos.application.Ability'
import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'
import { Hypium } from '@ohos/hypium'
import testsuite from '../test/List.test'
export default class MainAbility extends Ability {
async onCreate(want, launchParam) {
globalThis.abilityContext = this.context;
console.log('MainAbility onCreate')
let cmd: any
let abilityDelegatorArguments: any
let abilityDelegator: any
function sleep(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
}
abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator()
abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments()
cmd = 'aa test -b com.example.aacommandrelyhap -m entry_test -s class ACTS_AACommand_01_3#ACTS_AACo' +
'mmand_print_01_0100 -s unittest OpenHarmonyTestRunner'
abilityDelegator.executeShellCommand(cmd, (err, data) => {
console.log('ACTS_AACommand_print_01_0100 - executeShellCommand: start ')
console.log('ACTS_AACommand_print_01_0100 start err: ' + JSON.stringify(err))
console.log('ACTS_AACommand_print_01_0100 stdResult = ' + data.stdResult)
globalThis.stdResult3 = data.stdResult;
console.log('ACTS_AACommand_print_01_0100 - executeShellCommand: end')
})
await sleep(4000)
cmd = 'aa test -m entry_test -b com.example.aacommandrelyhap -s class ACTS_AACommand_01_3#ACTS_AAComm' +
'and_print_01_0200 -s unittest OpenHarmonyTestRunner'
abilityDelegator.executeShellCommand(cmd, (err, data) => {
console.log('ACTS_AACommand_print_01_0200 - executeShellCommand: start ')
console.log('ACTS_AACommand_print_01_0200 start err: ' + JSON.stringify(err))
console.log('ACTS_AACommand_print_01_0200 stdResult = ' + data.stdResult)
globalThis.stdResult4 = data.stdResult;
console.log('ACTS_AACommand_print_01_0200 - executeShellCommand: end')
})
await sleep(4000)
cmd = 'aa test -m entry_test -b com.example.aacommandrelyhap -s class ACTS_AACommand_01_3#ACTS_' +
'AACommand_print_01_0300 -s unittest OpenHarmonyTestRunner'
abilityDelegator.executeShellCommand(cmd, (err, data) => {
console.log('ACTS_AACommand_print_01_0300 - executeShellCommand: start ')
console.log('ACTS_AACommand_print_01_0300 start err: ' + JSON.stringify(err))
console.log('ACTS_AACommand_print_01_0300 stdResult = ' + data.stdResult)
globalThis.stdResult5 = data.stdResult;
console.log('ACTS_AACommand_print_01_0300 - executeShellCommand: end')
})
await sleep(4000)
cmd = 'aa test -m entry_test -b com.example.aacommandrelyhap -s class ACTS_AACommand_01_3#ACTS_AAComma' +
'nd_print_01_0400 -s unittest OpenHarmonyTestRunner'
abilityDelegator.executeShellCommand(cmd, (err, data) => {
console.log('ACTS_AACommand_print_01_0400 - executeShellCommand: start ')
console.log('ACTS_AACommand_print_01_0400 start err: ' + JSON.stringify(err))
console.log('ACTS_AACommand_print_01_0400 stdResult = ' + data.stdResult)
globalThis.stdResult6 = data.stdResult;
console.log('ACTS_AACommand_print_01_0400 - executeShellCommand: end')
})
await sleep(4000)
cmd = 'aa test -m entry_test -b com.example.aacommandrelyhap -s class ACTS_AACommand_01_3#ACTS_AAComm' +
'and_print_01_0500 -s unittest OpenHarmonyTestRunner'
abilityDelegator.executeShellCommand(cmd, (err, data) => {
console.log('ACTS_AACommand_print_01_0500 - executeShellCommand: start ')
console.log('ACTS_AACommand_print_01_0500 start err: ' + JSON.stringify(err))
console.log('ACTS_AACommand_print_01_0500 stdResult = ' + data.stdResult)
globalThis.stdResult7 = data.stdResult;
console.log('ACTS_AACommand_print_01_0500 - executeShellCommand: end')
})
await sleep(4000)
cmd = 'aa test -m entry_test -b com.example.aacommandrelyhap -s class ACTS_AACommand_01_3#ACTS_AA' +
'Command_print_01_0600 -s unittest OpenHarmonyTestRunner'
abilityDelegator.executeShellCommand(cmd, (err, data) => {
console.log('ACTS_AACommand_print_01_0600 - executeShellCommand: start ')
console.log('ACTS_AACommand_print_01_0600 start err: ' + JSON.stringify(err))
console.log('ACTS_AACommand_print_01_0600 stdResult = ' + data.stdResult)
globalThis.stdResult8 = data.stdResult;
console.log('ACTS_AACommand_print_01_0600 - executeShellCommand: end')
})
await sleep(4000)
cmd = 'aa test -m entry_test -b com.example.aacommandrelyhap -s class ' +
'ACTS_AACommand_01_3#ACTS_AACommand_print_01_0700 -s unittest OpenHarmonyTestRunner'
abilityDelegator.executeShellCommand(cmd, (err, data) => {
console.log('ACTS_AACommand_print_01_0700 - executeShellCommand: start ')
console.log('ACTS_AACommand_print_01_0700 start err: ' + JSON.stringify(err))
console.log('ACTS_AACommand_print_01_0700 stdResult = ' + data.stdResult)
globalThis.stdResult9 = data.stdResult;
console.log('ACTS_AACommand_print_01_0700 - executeShellCommand: end')
})
await sleep(4000)
cmd = 'aa test -m entry_test -b com.example.aacommandrelyhap -s ' +
'class ACTS_AACommand_01_3#ACTS_AACommand_print_01_0800 -s unittest OpenHarmonyTestRunner'
abilityDelegator.executeShellCommand(cmd, (err, data) => {
console.log('ACTS_AACommand_print_01_0800 - executeShellCommand: start ')
console.log('ACTS_AACommand_print_01_0800 start err: ' + JSON.stringify(err))
console.log('ACTS_AACommand_print_01_0800 stdResult = ' + data.stdResult)
globalThis.stdResult10 = data.stdResult;
console.log('ACTS_AACommand_print_01_0800 - executeShellCommand: end')
})
setTimeout(() => {
Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite)
}, 5000)
}
onDestroy() {
console.log('MainAbility onDestroy')
}
onWindowStageCreate(windowStage) {
console.log('MainAbility onWindowStageCreate')
windowStage.setUIContent(this.context, 'pages/index', null)
}
onWindowStageDestroy() {
console.log('MainAbility onWindowStageDestroy')
}
onForeground() {
console.log('MainAbility onForeground')
}
onBackground() {
console.log('MainAbility onBackground')
}
};
\ No newline at end of file
/*
* 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 TestRunner from '@ohos.application.testRunner'
import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'
var abilityDelegator = undefined
var abilityDelegatorArguments = undefined
function translateParamsToString(parameters) {
const keySet = new Set([
'-s class', '-s notClass', '-s suite', '-s it',
'-s level', '-s testType', '-s size', '-s timeout',
'-s dryRun'
])
let targetParams = '';
for (const key in parameters) {
if (keySet.has(key)) {
targetParams = `${targetParams} ${key} ${parameters[key]}`
}
}
return targetParams.trim()
}
async function onAbilityCreateCallback() {
console.log("onAbilityCreateCallback");
}
async function addAbilityMonitorCallback(err: any) {
console.info("addAbilityMonitorCallback : " + JSON.stringify(err))
}
export default class OpenHarmonyTestRunner implements TestRunner {
constructor() {
}
onPrepare() {
console.info("OpenHarmonyTestRunner OnPrepare ")
}
async onRun() {
console.log('OpenHarmonyTestRunner onRun run')
abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments()
abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator()
globalThis.abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator()
var MainAbilityName = abilityDelegatorArguments.bundleName + '.MainAbility'
let lMonitor = {
abilityName: MainAbilityName,
onAbilityCreate: onAbilityCreateCallback,
};
abilityDelegator.addAbilityMonitor(lMonitor, addAbilityMonitorCallback)
var cmd = 'aa start -d 0 -a MainAbility' + ' -b ' + abilityDelegatorArguments.bundleName
cmd += ' '+translateParamsToString(abilityDelegatorArguments.parameters)
console.info('cmd : '+cmd)
abilityDelegator.executeShellCommand(cmd,
(err: any, d: any) => {
console.info('executeShellCommand : err : ' + JSON.stringify(err));
console.info('executeShellCommand : data : ' + d.stdResult);
console.info('executeShellCommand : data : ' + d.exitCode);
})
console.info('OpenHarmonyTestRunner onRun end')
}
};
\ No newline at end of file
/*
* 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.
*/
@Entry
@Component
struct Index {
@State message: string = 'Hello World'
build() {
Row() {
Column() {
Text(this.message)
.fontSize(50)
.fontWeight(FontWeight.Bold)
Button() {
Text('next page')
.fontSize(20)
.fontWeight(FontWeight.Bold)
}.type(ButtonType.Capsule)
.margin({
top: 20
})
.backgroundColor('#0D9FFB')
.width('35%')
.height('5%')
.onClick(() => {
})
}
.width('100%')
}
.height('100%')
}
}
\ No newline at end of file
/*
* 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'
let msg: any
let msgcopy: any
export default function abilityTest() {
describe('ActsAACommandPrinOneTest', function () {
/**
* @tc.number: ACTS_AACommand_print_0100
* @tc.name: The -b, -p, -s, -w and other parameters of the test command are valid, and the print interface is
* called in AsyncCallback mode. The print information includes Chinese, special characters, etc.
* @tc.desc: Verify that the test framework can be started normally and the logs can be output normally through
* the test command.
*/
it('ACTS_AACommand_print_0100', 0, async function (done) {
console.log("ACTS_AACommand_print_0100 --- start")
msg = '测试日志!@#$%^&*()_+QWE{}|?><Fafq3146'
expect(globalThis.stdResult3).assertContain(msg);
done()
})
/**
* @tc.number: ACTS_AACommand_print_0200
* @tc.name: The -b, -p, -s, -w and other parameters of the test command are valid, and the print interface is
* called in AsyncCallback mode. The length of the print message is 1000 characters.
* @tc.desc: Verify that the test framework can be started normally and the logs can be output normally through
* the test command.
*/
it('ACTS_AACommand_print_0200', 0, async function (done) {
console.log("ACTS_AACommand_print_0200 --- start")
msg = '0callbackaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'aaaaaaaaa' +
'1aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'2aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'3aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'4aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'5aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'6aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'7aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'8aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'9aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaae'
expect(globalThis.stdResult4).assertContain(msg);
done()
})
/**
* @tc.number: ACTS_AACommand_print_0300
* @tc.name: The -b, -p, -s, -w and other parameters of the test command are valid, and the print interface is
* called in AsyncCallback mode. The length of the print message is greater than 1000 characters.
* @tc.desc: Verify that the test framework can be started normally and the logs can be output normally through
* the test command.
*/
it('ACTS_AACommand_print_0300', 0, async function (done) {
console.log("ACTS_AACommand_print_0300 --- start")
msg = '0callbackaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'aaaaaaaaaa' +
'1aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'2aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'3aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'4aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'5aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'6aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'7aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'8aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'9aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaae'
let msgcopy = 'fffffffffff'
expect(globalThis.stdResult5).assertContain(msg);
expect(globalThis.stdResult5.indexOf(msgcopy) == -1).assertEqual(true);
done()
})
/**
* @tc.number: ACTS_AACommand_print_0400
* @tc.name: The -b, -p, -s, -w and other parameters of the test command are valid, and the print interface is
* called in AsyncCallback mode. print information is null.
* @tc.desc: Verify that the test framework can be started normally and the logs can be output normally through
* the test command.
*/
it('ACTS_AACommand_print_0400', 0, async function (done) {
console.log("ACTS_AACommand_print_0400 --- start")
msg = 'start ability successfully'
expect(globalThis.stdResult6).assertContain(msg);
done()
})
/**
* @tc.number: ACTS_AACommand_print_0500
* @tc.name: The -b, -p, -s, -w and other parameters of the test command are valid, and the print interface is
* called in Promise mode. The print information includes Chinese, special characters, etc.
* @tc.desc: Verify that the test framework can be started normally and the logs can be output normally through
* the test command.
*/
it('ACTS_AACommand_print_0500', 0, async function (done) {
console.log("ACTS_AACommand_print_0500 --- start")
msg = '测试日志!@#$%^&*()_+QWE{}|?><Fafq3146'
expect(globalThis.stdResult7).assertContain(msg);
done()
})
/**
* @tc.number: ACTS_AACommand_print_0600
* @tc.name: The -b, -p, -s, -w and other parameters of the test command are valid, and the print interface is
* called in Promise mode. The length of the print message is 1000 characters.
* @tc.desc: Verify that the test framework can be started normally and the logs can be output normally
* through the test command.
*/
it('ACTS_AACommand_print_0600', 0, async function (done) {
console.log("ACTS_AACommand_print_0600 --- start")
msg = '0callbackaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'aaaaaaaaaa' +
'1aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'2aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'3aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'4aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'5aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'6aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'7aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'8aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'9aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaae'
expect(globalThis.stdResult8).assertContain(msg);
done()
})
/**
* @tc.number: ACTS_AACommand_print_0700
* @tc.name: The -b, -p, -s, -w and other parameters of the test command are valid, and the print interface is
* called in Promise mode. The length of the print message is greater than 1000 characters.
* @tc.desc: Verify that the test framework can be started normally and the logs can be output normally through
* the test command.
*/
it('ACTS_AACommand_print_0700', 0, async function (done) {
console.log("ACTS_AACommand_print_0700 --- start")
msg = '0callbackaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'aaaaaaaaaa' +
'1aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'2aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'3aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'4aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'5aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'6aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'7aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'8aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'9aaaaaaaaa'
msgcopy = 'fffffffffff'
expect(globalThis.stdResult9).assertContain(msg);
expect(globalThis.stdResult9.indexOf(msgcopy) == -1).assertEqual(true);
done()
})
/**
* @tc.number: ACTS_AACommand_print_0800
* @tc.name: The -b, -p, -s, -w and other parameters of the test command are valid, and the print interface is
* called in Promise mode. print information is null.
* @tc.desc: Verify that the test framework can be started normally and the logs can be output normally
* through the test command.
*/
it('ACTS_AACommand_print_0800', 0, async function (done) {
console.log("ACTS_AACommand_print_0800 --- start")
msg = 'start ability successfully'
expect(globalThis.stdResult10).assertContain(msg);
done()
})
})
}
\ No newline at end of file
/*
* 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 abilityTest from './Ability.test'
export default function testsuite() {
abilityTest()
}
\ No newline at end of file
{
"module": {
"name": "entry_test",
"type": "entry",
"srcEntrance": "./ets/Application/AbilityStage.ts",
"description": "$string:entry_test_desc",
"mainElement": "MainAbility",
"deviceTypes": [
"phone",
"tablet"
],
"deliveryWithInstall": true,
"installationFree": false,
"pages": "$profile:main_pages",
"uiSyntax": "ets",
"abilities": [
{
"name": "MainAbility",
"srcEntrance": "./ets/MainAbility/MainAbility.ts",
"description": "$string:MainAbility_desc",
"icon": "$media:icon",
"label": "$string:MainAbility_label",
"visible": true,
"skills": [
{
"entities": [
"entity.system.home"
],
"actions": [
"action.system.home"
]
}
]
}
]
}
}
\ No newline at end of file
{
"string": [
{
"name": "entry_test_desc",
"value": "description"
},
{
"name": "MainAbility_desc",
"value": "description"
},
{
"name": "MainAbility_label",
"value": "label"
},
{
"name": "app_name",
"value": "AACommandPrintSyncTest"
},
{
"name": "description_application",
"value": "demo for test"
}
]
}
\ No newline at end of file
......@@ -15,6 +15,9 @@
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'
function sleep(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
}
export default function abilityTest() {
describe('ACTS_AACommand_01_3', function () {
/**
......@@ -29,6 +32,7 @@ export default function abilityTest() {
var msg = '测试日志!@#$%^&*()_+QWE{}|?><Fafq3146'
globalThis.abilityDelegator.printSync(msg);
console.log("ACTS_AACommand_printSync_01_0100 printSync end ====> " )
await sleep(1000)
var finishmsg = 'ACTS_AACommand_printSync_01_0100 end'
globalThis.abilityDelegator.finishTest(finishmsg, 1).then((data)=>{
console.log("ACTS_AACommand_printSync_01_0100 finishTest test end ========> callback " )
......@@ -59,6 +63,7 @@ export default function abilityTest() {
'9aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaae'
globalThis.abilityDelegator.printSync(msg);
console.log("ACTS_AACommand_printSync_01_0200 printSync end ====> " )
await sleep(1000)
var finishmsg = 'ACTS_AACommand_printSync_01_0200 end'
globalThis.abilityDelegator.finishTest(finishmsg, 1).then(()=>{
console.log("ACTS_AACommand_printSync_01_0200 print test end ========> callback " )
......@@ -88,6 +93,7 @@ export default function abilityTest() {
'fffffffffff'
globalThis.abilityDelegator.printSync(msg);
console.log("ACTS_AACommand_printSync_01_0300 printSync end ====> " )
await sleep(1000)
var finishmsg = 'ACTS_AACommand_printSync_01_0300 end'
globalThis.abilityDelegator.finishTest(finishmsg, 1).then(()=>{
console.log("ACTS_AACommand_printSync_01_0300 print test end ========> callback " )
......@@ -105,6 +111,7 @@ export default function abilityTest() {
it('ACTS_AACommand_printSync_01_0400', 0, async function (done) {
globalThis.abilityDelegator.printSync(null);
console.log("ACTS_AACommand_printSync_01_0300 printSync end ====> " )
await sleep(1000)
var finishmsg = 'ACTS_AACommand_printSync_01_0400 end'
globalThis.abilityDelegator.finishTest(finishmsg, 1).then(()=>{
console.log("ACTS_AACommand_printSync_01_0400 print test end ========> callback " )
......
......@@ -15,6 +15,10 @@
*/
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'
function sleep(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
}
export default function abilityTest() {
describe('ACTS_AACommand_01_3', function () {
/**
......@@ -32,6 +36,7 @@ export default function abilityTest() {
console.log("ACTS_AACommand_print_01_0100 print test end ========> callback err: "+JSON.stringify(err) )
console.log("ACTS_AACommand_print_01_0100 print test end ========> callback data: "+JSON.stringify(data))
})
await sleep(1000);
var finishmsg = 'ACTS_AACommand_print_01_0100 end'
globalThis.abilityDelegator.finishTest(finishmsg, 1).then((data)=>{
console.log("ACTS_AACommand_print_01_0100 finishTest test end ========> callback " )
......@@ -62,6 +67,7 @@ export default function abilityTest() {
globalThis.abilityDelegator.print(msg,()=>{
console.log("print test end ========> callback " )
})
await sleep(1000);
var finishmsg = 'ACTS_AACommand_print_01_0200 end'
globalThis.abilityDelegator.finishTest(finishmsg, 1).then(()=>{
console.log("ACTS_AACommand_print_01_0200 print test end ========> callback " )
......@@ -91,6 +97,7 @@ export default function abilityTest() {
globalThis.abilityDelegator.print(msg,()=>{
console.log("print test end ========> callback " )
})
await sleep(1000);
var finishmsg = 'ACTS_AACommand_print_01_0300 end'
globalThis.abilityDelegator.finishTest(finishmsg, 1).then(()=>{
console.log("ACTS_AACommand_print_01_0300 print test end ========> callback " )
......@@ -109,6 +116,7 @@ export default function abilityTest() {
globalThis.abilityDelegator.print(null,()=>{
console.log("print test end ========> callback " )
})
await sleep(1000);
var finishmsg = 'ACTS_AACommand_print_01_0400 end'
globalThis.abilityDelegator.finishTest(finishmsg, 1).then(()=>{
console.log("ACTS_AACommand_print_01_0400 print test end ========> callback " )
......@@ -128,6 +136,7 @@ export default function abilityTest() {
globalThis.abilityDelegator.print(msg).then(()=>{
console.log("ACTS_AACommand_print_01_0500 print test end ========> callback " )
})
await sleep(1000);
var finishmsg = 'ACTS_AACommand_print_01_0500 end'
globalThis.abilityDelegator.finishTest(finishmsg, 1).then(()=>{
console.log("ACTS_AACommand_print_01_0500 print test end ========> callback " )
......@@ -156,6 +165,7 @@ export default function abilityTest() {
globalThis.abilityDelegator.print(msg).then(()=>{
console.log("ACTS_AACommand_print_01_0600 print test end ========> callback " )
})
await sleep(1000);
var finishmsg = 'ACTS_AACommand_print_01_0600 end'
globalThis.abilityDelegator.finishTest(finishmsg, 1).then(()=>{
console.log("ACTS_AACommand_print_01_0600 2 print test end ========> callback " )
......@@ -185,6 +195,7 @@ export default function abilityTest() {
globalThis.abilityDelegator.print(msg).then(()=>{
console.log("ACTS_AACommand_print_01_0700 print test end ========> callback " )
})
await sleep(1000);
var finishmsg = 'ACTS_AACommand_print_01_0700 end'
globalThis.abilityDelegator.finishTest(finishmsg, 1).then(()=>{
console.log("ACTS_AACommand_print_01_0700 2 print test end ========> callback " )
......@@ -220,6 +231,7 @@ export default function abilityTest() {
*/
it('ACTS_AACommand_finish_01_0100', 0, async function (done) {
var msg = '测试日志!@#$%^&*()_+QWE{}|?><Fafq3146ACTS_AACommand_finish_01_0100'
await sleep(1000);
globalThis.abilityDelegator.finishTest(msg, 1,()=>{
console.log("ACTS_AACommand_finish_01_0100 finishTest test end ========> callback " )
done()
......@@ -275,6 +287,7 @@ export default function abilityTest() {
*/
it('ACTS_AACommand_finish_01_0400', 0, async function (done) {
var msg = '测试日志!@#$%^&*()_+QWE{}|?><Fafq3146'
await sleep(1000);
globalThis.abilityDelegator.finishTest(msg, Number.MAX_VALUE,()=>{
console.log("ACTS_AACommand_finish_01_0400 finishTest test end ========> callback " )
done()
......@@ -290,6 +303,7 @@ export default function abilityTest() {
*/
it('ACTS_AACommand_finish_01_0500', 0, async function (done) {
var msg = '测试日志!@#$%^&*()_+QWE{}|?><Fafq3146'
await sleep(1000);
globalThis.abilityDelegator.finishTest(msg, Number.MIN_VALUE,()=>{
console.log("ACTS_AACommand_finish_01_0500 finishTest test end ========> callback " )
done()
......@@ -306,6 +320,7 @@ export default function abilityTest() {
it('ACTS_AACommand_finish_01_0600', 0, async function (done) {
var msg = '测试日志!@#$%^&*()_+QWE{}|?><Fafq3146'
await sleep(1000);
globalThis.abilityDelegator.finishTest(msg, (Number.MIN_VALUE+1),()=>{
console.log("ACTS_AACommand_finish_01_0600 finishTest test end ========> callback " )
done()
......@@ -321,6 +336,7 @@ export default function abilityTest() {
*/
it('ACTS_AACommand_finish_01_0700', 0, async function (done) {
var msg = '测试日志!@#$%^&*()_+QWE{}|?><Fafq3146'
await sleep(1000);
globalThis.abilityDelegator.finishTest(msg, (Number.MIN_VALUE-1),()=>{
console.log("ACTS_AACommand_finish_01_0700 finishTest test end ========> callback " )
done()
......@@ -358,6 +374,7 @@ export default function abilityTest() {
*/
it('ACTS_AACommand_finish_01_0900', 0, async function (done) {
var msg = '测试日志!@#$%^&*()_+QWE{}|?><Fafq3146'
await sleep(1000);
globalThis.abilityDelegator.finishTest(msg, 1).then(() => {
console.log("ACTS_AACommand_finish_01_0900 finishTest test end ========> callback " )
done()
......@@ -409,6 +426,7 @@ export default function abilityTest() {
*/
it('ACTS_AACommand_finish_01_1200', 0, async function (done) {
var msg = '测试日志!@#$%^&*()_+QWE{}|?><Fafq3146'
await sleep(1000);
globalThis.abilityDelegator.finishTest(msg, Number.MAX_VALUE).then(()=>{
console.log("ACTS_AACommand_finish_01_1200 finishTest test end ========> callback " )
done()
......@@ -424,6 +442,7 @@ export default function abilityTest() {
*/
it('ACTS_AACommand_finish_01_1300', 0, async function (done) {
var msg = '测试日志!@#$%^&*()_+QWE{}|?><Fafq3146'
await sleep(1000);
globalThis.abilityDelegator.finishTest(msg, Number.MIN_VALUE).then(()=>{
console.log("ACTS_AACommand_finish_01_1300 finishTest test end ========> callback " )
done()
......@@ -439,6 +458,7 @@ export default function abilityTest() {
*/
it('ACTS_AACommand_finish_01_1400', 0, async function (done) {
var msg = '测试日志!@#$%^&*()_+QWE{}|?><Fafq3146'
await sleep(1000);
globalThis.abilityDelegator.finishTest(msg, Number.MIN_VALUE+1).then(()=>{
console.log("ACTS_AACommand_finish_01_1400 finishTest test end ========> callback " )
done()
......@@ -454,6 +474,7 @@ export default function abilityTest() {
*/
it('ACTS_AACommand_finish_01_1500', 0, async function (done) {
var msg = '测试日志!@#$%^&*()_+QWE{}|?><Fafq3146'
await sleep(1000);
globalThis.abilityDelegator.finishTest(msg, Number.MIN_VALUE-1).then(()=>{
console.log("ACTS_AACommand_finish_01_1500 finishTest test end ========> callback " )
done()
......
......@@ -32,8 +32,6 @@ export default class MainAbility extends Ability {
abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator()
abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments()
await sleep(500)
cmd = 'aa test -m entry_test -b com.example.aacommandrelyhap -s ' +
'class ACTS_AACommand_01_3#ACTS_AACommand_finish_01_0700 -s unittest OpenHarmonyTestRunner'
abilityDelegator.executeShellCommand(cmd, (err, data) => {
......@@ -43,7 +41,7 @@ export default class MainAbility extends Ability {
console.log('ACTS_AACommand_finish_01_0700 - executeShellCommand: end ')
})
await sleep(3000)
await sleep(4000)
cmd = 'aa dump -a'
abilityDelegator.executeShellCommand(cmd, (err, data) => {
......@@ -55,102 +53,6 @@ export default class MainAbility extends Ability {
await sleep(2000)
cmd = 'aa test -b com.example.aacommandrelyhap -m entry_test -s class ACTS_AACommand_01_3#ACTS_AACo' +
'mmand_print_01_0100 -s unittest OpenHarmonyTestRunner'
abilityDelegator.executeShellCommand(cmd, (err, data) => {
console.log('ACTS_AACommand_print_01_0100 - executeShellCommand: start ')
console.log('ACTS_AACommand_print_01_0100 start err: ' + JSON.stringify(err))
console.log('ACTS_AACommand_print_01_0100 stdResult = ' + data.stdResult)
globalThis.stdResult3 = data.stdResult;
console.log('ACTS_AACommand_print_01_0100 - executeShellCommand: end')
})
await sleep(3000)
cmd = 'aa test -m entry_test -b com.example.aacommandrelyhap -s class ACTS_AACommand_01_3#ACTS_AAComm' +
'and_print_01_0200 -s unittest OpenHarmonyTestRunner'
abilityDelegator.executeShellCommand(cmd, (err, data) => {
console.log('ACTS_AACommand_print_01_0200 - executeShellCommand: start ')
console.log('ACTS_AACommand_print_01_0200 start err: ' + JSON.stringify(err))
console.log('ACTS_AACommand_print_01_0200 stdResult = ' + data.stdResult)
globalThis.stdResult4 = data.stdResult;
console.log('ACTS_AACommand_print_01_0200 - executeShellCommand: end')
})
await sleep(3000)
cmd = 'aa test -m entry_test -b com.example.aacommandrelyhap -s class ACTS_AACommand_01_3#ACTS_' +
'AACommand_print_01_0300 -s unittest OpenHarmonyTestRunner'
abilityDelegator.executeShellCommand(cmd, (err, data) => {
console.log('ACTS_AACommand_print_01_0300 - executeShellCommand: start ')
console.log('ACTS_AACommand_print_01_0300 start err: ' + JSON.stringify(err))
console.log('ACTS_AACommand_print_01_0300 stdResult = ' + data.stdResult)
globalThis.stdResult5 = data.stdResult;
console.log('ACTS_AACommand_print_01_0300 - executeShellCommand: end')
})
await sleep(3000)
cmd = 'aa test -m entry_test -b com.example.aacommandrelyhap -s class ACTS_AACommand_01_3#ACTS_AAComma' +
'nd_print_01_0400 -s unittest OpenHarmonyTestRunner'
abilityDelegator.executeShellCommand(cmd, (err, data) => {
console.log('ACTS_AACommand_print_01_0400 - executeShellCommand: start ')
console.log('ACTS_AACommand_print_01_0400 start err: ' + JSON.stringify(err))
console.log('ACTS_AACommand_print_01_0400 stdResult = ' + data.stdResult)
globalThis.stdResult6 = data.stdResult;
console.log('ACTS_AACommand_print_01_0400 - executeShellCommand: end')
})
await sleep(3000)
cmd = 'aa test -m entry_test -b com.example.aacommandrelyhap -s class ACTS_AACommand_01_3#ACTS_AAComm' +
'and_print_01_0500 -s unittest OpenHarmonyTestRunner'
abilityDelegator.executeShellCommand(cmd, (err, data) => {
console.log('ACTS_AACommand_print_01_0500 - executeShellCommand: start ')
console.log('ACTS_AACommand_print_01_0500 start err: ' + JSON.stringify(err))
console.log('ACTS_AACommand_print_01_0500 stdResult = ' + data.stdResult)
globalThis.stdResult7 = data.stdResult;
console.log('ACTS_AACommand_print_01_0500 - executeShellCommand: end')
})
await sleep(3000)
cmd = 'aa test -m entry_test -b com.example.aacommandrelyhap -s class ACTS_AACommand_01_3#ACTS_AA' +
'Command_print_01_0600 -s unittest OpenHarmonyTestRunner'
abilityDelegator.executeShellCommand(cmd, (err, data) => {
console.log('ACTS_AACommand_print_01_0600 - executeShellCommand: start ')
console.log('ACTS_AACommand_print_01_0600 start err: ' + JSON.stringify(err))
console.log('ACTS_AACommand_print_01_0600 stdResult = ' + data.stdResult)
globalThis.stdResult8 = data.stdResult;
console.log('ACTS_AACommand_print_01_0600 - executeShellCommand: end')
})
await sleep(3000)
cmd = 'aa test -m entry_test -b com.example.aacommandrelyhap -s class ' +
'ACTS_AACommand_01_3#ACTS_AACommand_print_01_0700 -s unittest OpenHarmonyTestRunner'
abilityDelegator.executeShellCommand(cmd, (err, data) => {
console.log('ACTS_AACommand_print_01_0700 - executeShellCommand: start ')
console.log('ACTS_AACommand_print_01_0700 start err: ' + JSON.stringify(err))
console.log('ACTS_AACommand_print_01_0700 stdResult = ' + data.stdResult)
globalThis.stdResult9 = data.stdResult;
console.log('ACTS_AACommand_print_01_0700 - executeShellCommand: end')
})
await sleep(3000)
cmd = 'aa test -m entry_test -b com.example.aacommandrelyhap -s ' +
'class ACTS_AACommand_01_3#ACTS_AACommand_print_01_0800 -s unittest OpenHarmonyTestRunner'
abilityDelegator.executeShellCommand(cmd, (err, data) => {
console.log('ACTS_AACommand_print_01_0800 - executeShellCommand: start ')
console.log('ACTS_AACommand_print_01_0800 start err: ' + JSON.stringify(err))
console.log('ACTS_AACommand_print_01_0800 stdResult = ' + data.stdResult)
globalThis.stdResult10 = data.stdResult;
console.log('ACTS_AACommand_print_01_0800 - executeShellCommand: end')
})
await sleep(3000)
cmd = 'aa test -m entry_test -b com.example.aacommandrelyhap -s class ' +
'ACTS_AACommand_01_3#ACTS_AACommand_finish_01_0400 -s unittest OpenHarmonyTestRunner'
abilityDelegator.executeShellCommand(cmd, (err, data) => {
......@@ -161,7 +63,7 @@ export default class MainAbility extends Ability {
console.log('ACTS_AACommand_finish_01_0400 - executeShellCommand: end')
})
await sleep(3000)
await sleep(4000)
cmd = 'aa dump -a'
abilityDelegator.executeShellCommand(cmd, (err, data) => {
......@@ -183,7 +85,7 @@ export default class MainAbility extends Ability {
console.log('ACTS_AACommand_finish_01_0100 - executeShellCommand: end')
})
await sleep(3000)
await sleep(4000)
cmd = 'aa dump -a'
abilityDelegator.executeShellCommand(cmd, (err, data) => {
......@@ -205,7 +107,7 @@ export default class MainAbility extends Ability {
console.log('ACTS_AACommand_finish_01_0500 - executeShellCommand: end')
})
await sleep(3000)
await sleep(4000)
cmd = 'aa dump -a'
abilityDelegator.executeShellCommand(cmd, (err, data) => {
......@@ -227,7 +129,7 @@ export default class MainAbility extends Ability {
console.log('ACTS_AACommand_finish_01_0600 - executeShellCommand: end')
})
await sleep(3000)
await sleep(4000)
cmd = 'aa dump -a'
abilityDelegator.executeShellCommand(cmd, (err, data) => {
......@@ -249,7 +151,7 @@ export default class MainAbility extends Ability {
console.log('ACTS_AACommand_finish_01_0900 - executeShellCommand: end')
})
await sleep(3000)
await sleep(4000)
cmd = 'aa dump -a'
abilityDelegator.executeShellCommand(cmd, (err, data) => {
......@@ -271,7 +173,7 @@ export default class MainAbility extends Ability {
console.log('ACTS_AACommand_finish_01_1200 - executeShellCommand: end')
})
await sleep(3000)
await sleep(4000)
cmd = 'aa dump -a'
abilityDelegator.executeShellCommand(cmd, (err, data) => {
......@@ -293,7 +195,7 @@ export default class MainAbility extends Ability {
console.log('ACTS_AACommand_finish_01_1300 - executeShellCommand: end')
})
await sleep(3000)
await sleep(4000)
cmd = 'aa dump -a'
abilityDelegator.executeShellCommand(cmd, (err, data) => {
......@@ -315,7 +217,7 @@ export default class MainAbility extends Ability {
console.log('ACTS_AACommand_finish_01_1400 - executeShellCommand: end')
})
await sleep(3000)
await sleep(4000)
cmd = 'aa dump -a'
abilityDelegator.executeShellCommand(cmd, (err, data) => {
......@@ -337,7 +239,7 @@ export default class MainAbility extends Ability {
console.log('ACTS_AACommand_finish_01_1500 - executeShellCommand: end')
})
await sleep(3000)
await sleep(4000)
cmd = 'aa dump -a'
abilityDelegator.executeShellCommand(cmd, (err, data) => {
......@@ -358,7 +260,7 @@ export default class MainAbility extends Ability {
console.log('ACTS_AACommand_finish_01_0200 - executeShellCommand: end')
})
await sleep(3000)
await sleep(4000)
cmd = 'aa dump -a'
abilityDelegator.executeShellCommand(cmd, (err, data) => {
......
......@@ -202,165 +202,6 @@ export default function abilityTest() {
})
})
/**
* @tc.number: ACTS_AACommand_print_0100
* @tc.name: The -b, -p, -s, -w and other parameters of the test command are valid, and the print interface is
* called in AsyncCallback mode. The print information includes Chinese, special characters, etc.
* @tc.desc: Verify that the test framework can be started normally and the logs can be output normally through
* the test command.
*/
it('ACTS_AACommand_print_0100', 0, async function (done) {
console.log("ACTS_AACommand_print_0100 --- start")
msg = '测试日志!@#$%^&*()_+QWE{}|?><Fafq3146'
expect(globalThis.stdResult3).assertContain(msg);
done()
})
/**
* @tc.number: ACTS_AACommand_print_0200
* @tc.name: The -b, -p, -s, -w and other parameters of the test command are valid, and the print interface is
* called in AsyncCallback mode. The length of the print message is 1000 characters.
* @tc.desc: Verify that the test framework can be started normally and the logs can be output normally through
* the test command.
*/
it('ACTS_AACommand_print_0200', 0, async function (done) {
console.log("ACTS_AACommand_print_0200 --- start")
msg = '0callbackaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'aaaaaaaaa' +
'1aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'2aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'3aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'4aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'5aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'6aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'7aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'8aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'9aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaae'
expect(globalThis.stdResult4).assertContain(msg);
done()
})
/**
* @tc.number: ACTS_AACommand_print_0300
* @tc.name: The -b, -p, -s, -w and other parameters of the test command are valid, and the print interface is
* called in AsyncCallback mode. The length of the print message is greater than 1000 characters.
* @tc.desc: Verify that the test framework can be started normally and the logs can be output normally through
* the test command.
*/
it('ACTS_AACommand_print_0300', 0, async function (done) {
console.log("ACTS_AACommand_print_0300 --- start")
msg = '0callbackaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'aaaaaaaaaa' +
'1aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'2aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'3aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'4aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'5aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'6aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'7aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'8aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'9aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaae'
let msgcopy = 'fffffffffff'
expect(globalThis.stdResult5).assertContain(msg);
expect(globalThis.stdResult5.indexOf(msgcopy) == -1).assertEqual(true);
done()
})
/**
* @tc.number: ACTS_AACommand_print_0400
* @tc.name: The -b, -p, -s, -w and other parameters of the test command are valid, and the print interface is
* called in AsyncCallback mode. print information is null.
* @tc.desc: Verify that the test framework can be started normally and the logs can be output normally through
* the test command.
*/
it('ACTS_AACommand_print_0400', 0, async function (done) {
console.log("ACTS_AACommand_print_0400 --- start")
msg = 'start ability successfully'
expect(globalThis.stdResult6).assertContain(msg);
done()
})
/**
* @tc.number: ACTS_AACommand_print_0500
* @tc.name: The -b, -p, -s, -w and other parameters of the test command are valid, and the print interface is
* called in Promise mode. The print information includes Chinese, special characters, etc.
* @tc.desc: Verify that the test framework can be started normally and the logs can be output normally through
* the test command.
*/
it('ACTS_AACommand_print_0500', 0, async function (done) {
console.log("ACTS_AACommand_print_0500 --- start")
msg = '测试日志!@#$%^&*()_+QWE{}|?><Fafq3146'
expect(globalThis.stdResult7).assertContain(msg);
done()
})
/**
* @tc.number: ACTS_AACommand_print_0600
* @tc.name: The -b, -p, -s, -w and other parameters of the test command are valid, and the print interface is
* called in Promise mode. The length of the print message is 1000 characters.
* @tc.desc: Verify that the test framework can be started normally and the logs can be output normally
* through the test command.
*/
it('ACTS_AACommand_print_0600', 0, async function (done) {
console.log("ACTS_AACommand_print_0600 --- start")
msg = '0callbackaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'aaaaaaaaaa' +
'1aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'2aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'3aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'4aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'5aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'6aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'7aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'8aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'9aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaae'
expect(globalThis.stdResult8).assertContain(msg);
done()
})
/**
* @tc.number: ACTS_AACommand_print_0700
* @tc.name: The -b, -p, -s, -w and other parameters of the test command are valid, and the print interface is
* called in Promise mode. The length of the print message is greater than 1000 characters.
* @tc.desc: Verify that the test framework can be started normally and the logs can be output normally through
* the test command.
*/
it('ACTS_AACommand_print_0700', 0, async function (done) {
console.log("ACTS_AACommand_print_0700 --- start")
msg = '0callbackaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'aaaaaaaaaa' +
'1aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'2aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'3aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'4aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'5aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'6aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'7aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'8aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'9aaaaaaaaa'
msgcopy = 'fffffffffff'
expect(globalThis.stdResult9).assertContain(msg);
expect(globalThis.stdResult9.indexOf(msgcopy) == -1).assertEqual(true);
done()
})
/**
* @tc.number: ACTS_AACommand_print_0800
* @tc.name: The -b, -p, -s, -w and other parameters of the test command are valid, and the print interface is
* called in Promise mode. print information is null.
* @tc.desc: Verify that the test framework can be started normally and the logs can be output normally
* through the test command.
*/
it('ACTS_AACommand_print_0800', 0, async function (done) {
console.log("ACTS_AACommand_print_0800 --- start")
msg = 'start ability successfully'
expect(globalThis.stdResult10).assertContain(msg);
done()
})
/**
* @tc.number: ACTS_AACommand_finishTest_0400
* @tc.name: The parameters of the test command are valid, and the finishTest interface is called in
......@@ -379,7 +220,6 @@ export default function abilityTest() {
})
/**
* @tc.number: ACTS_AACommand_finishTest_0100
* @tc.name: Each parameter of the test command is valid, and the finishTest interface is called
......@@ -398,7 +238,6 @@ export default function abilityTest() {
done()
})
/**
* @tc.number: ACTS_AACommand_finishTest_0500
* @tc.name: The parameters of the test command are valid, and the finishTest
......@@ -437,8 +276,6 @@ export default function abilityTest() {
done()
})
/**
* @tc.number: ACTS_AACommand_finishTest_0900
* @tc.name: The parameters of the test command are valid, and the finishTest interface is called in Promise
......@@ -456,7 +293,6 @@ export default function abilityTest() {
done()
})
/**
* @tc.number: ACTS_AACommand_finishTest_1200
* @tc.name: The parameters of the test command are valid, and the finishTest interface is called in Promise
......
......@@ -19,6 +19,7 @@ group("aacommand") {
deps = [
"AACommand07:AACommand07",
"AACommand08:AACommand08",
"AACommandPrintOneTest:ActsAACommandPrintOneTest",
"AACommandPrintSync:AACommandPrintSync",
"AACommandPrintSyncTest:ActsAACommandPrintSyncTest",
"AACommandRelyHap:AACommandRelyHap",
......
......@@ -93,6 +93,9 @@ describe('ActsStServiceAbilityTest', function () {
+ " ,err=" + err + " ,data=" + data);
});
}
function sleep(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
}
let gSetTimeout = 1000
beforeAll(async (done) => {
console.debug('= ACTS_beforeAll ====<begin');
......@@ -126,12 +129,12 @@ describe('ActsStServiceAbilityTest', function () {
it('ACTS_JsServiceAbility_0100', 0, async function (done) {
console.debug('ACTS_JsServiceAbility_0100====<begin');
try {
commonEvent.createSubscriber(CommonEventSubscribeInfo0100).then(async (data) => {
await commonEvent.createSubscriber(CommonEventSubscribeInfo0100).then(async (data) => {
console.debug("=ACTS_JsServiceAbility_0100 createSubscriber .then(data)=======>"
+ ("json data【") + JSON.stringify(data) + ("")
+ " ,data=" + data);
subscriber0100 = data;
await commonEvent.subscribe(subscriber0100, async (err, data) => {
commonEvent.subscribe(subscriber0100, async (err, data) => {
console.debug("=ACTS_JsServiceAbility_0100 subscribe (err,data)=======>"
+ ("json err【") + JSON.stringify(err) + ("")
+ ("json data【") + JSON.stringify(data) + ("")
......@@ -176,12 +179,12 @@ describe('ActsStServiceAbilityTest', function () {
it('ACTS_JsServiceAbility_0200', 0, async function (done) {
console.debug('ACTS_JsServiceAbility_0200====<begin');
try {
commonEvent.createSubscriber(CommonEventSubscribeInfo0200).then(async (data) => {
await commonEvent.createSubscriber(CommonEventSubscribeInfo0200).then(async (data) => {
console.debug("=ACTS_JsServiceAbility_0200 createSubscriber .then(data)=======>"
+ ("json data【") + JSON.stringify(data) + ("")
+ " ,data=" + data);
subscriber0200 = data;
await commonEvent.subscribe(subscriber0200, async (err, data) => {
commonEvent.subscribe(subscriber0200, async (err, data) => {
console.debug("=ACTS_JsServiceAbility_0200 subscribe (err,data)=======>"
+ ("json err【") + JSON.stringify(err) + ("")
+ ("json data【") + JSON.stringify(data) + ("")
......@@ -193,7 +196,7 @@ describe('ActsStServiceAbilityTest', function () {
done()
});
})
await featureAbility.startAbility(
featureAbility.startAbility(
{
want:
{
......@@ -223,12 +226,12 @@ describe('ActsStServiceAbilityTest', function () {
it('ACTS_JsServiceAbility_0300', 0, async function (done) {
console.debug('ACTS_JsServiceAbility_0300====<begin');
try {
commonEvent.createSubscriber(CommonEventSubscribeInfo0300).then(async (data) => {
await commonEvent.createSubscriber(CommonEventSubscribeInfo0300).then(async (data) => {
console.debug("=ACTS_JsServiceAbility_0300 createSubscriber .then(data)=======>"
+ ("json data【") + JSON.stringify(data) + ("")
+ " ,data=" + data);
subscriber0300 = data;
await commonEvent.subscribe(subscriber0300, async (err, data) => {
commonEvent.subscribe(subscriber0300, async (err, data) => {
console.debug("=ACTS_JsServiceAbility_0300 subscribe (err,data)=======>"
+ ("json err【") + JSON.stringify(err) + ("")
+ ("json data【") + JSON.stringify(data) + ("")
......@@ -296,12 +299,12 @@ describe('ActsStServiceAbilityTest', function () {
it('ACTS_JsServiceAbility_0400', 0, async function (done) {
console.debug('ACTS_JsServiceAbility_0400====<begin');
try {
commonEvent.createSubscriber(CommonEventSubscribeInfo0400).then(async (data) => {
await commonEvent.createSubscriber(CommonEventSubscribeInfo0400).then(async (data) => {
console.debug("=ACTS_JsServiceAbility_0400 createSubscriber .then(data)=======>"
+ ("json data【") + JSON.stringify(data) + ("")
+ " ,data=" + data);
subscriber0400 = data;
await commonEvent.subscribe(subscriber0400, async (err, data) => {
commonEvent.subscribe(subscriber0400, async (err, data) => {
console.debug("=ACTS_JsServiceAbility_0400 subscribe (err,data)=======>"
+ ("json err【") + JSON.stringify(err) + ("")
+ ("json data【") + JSON.stringify(data) + ("")
......@@ -364,12 +367,12 @@ describe('ActsStServiceAbilityTest', function () {
console.log('ACTS_JsServiceAbility_0500====<begin');
try {
var mConnIdJsPromise;
commonEvent.createSubscriber(CommonEventSubscribeInfo0500).then(async (data) => {
await commonEvent.createSubscriber(CommonEventSubscribeInfo0500).then(async (data) => {
console.debug("=ACTS_JsServiceAbility_0500 createSubscriber .then(data)=======>"
+ ("json data【") + JSON.stringify(data) + ("")
+ " ,data=" + data);
subscriber0500 = data;
await commonEvent.subscribe(subscriber0500, async (err, data) => {
commonEvent.subscribe(subscriber0500, async (err, data) => {
console.debug("=ACTS_JsServiceAbility_0500 subscribe (err,data)=======>"
+ ("json err【") + JSON.stringify(err) + ("")
+ ("json data【") + JSON.stringify(data) + ("")
......@@ -441,12 +444,12 @@ describe('ActsStServiceAbilityTest', function () {
try {
var currentAlertTimeout;
var mConnIdJsAsyncCallback;
commonEvent.createSubscriber(CommonEventSubscribeInfo0600).then(async (data) => {
await commonEvent.createSubscriber(CommonEventSubscribeInfo0600).then(async (data) => {
console.debug("=ACTS_JsServiceAbility_0600 createSubscriber .then(data)=======>"
+ ("json data【") + JSON.stringify(data) + ("")
+ " ,data=" + data);
subscriber0600 = data;
await commonEvent.subscribe(subscriber0600, async (err, data) => {
commonEvent.subscribe(subscriber0600, async (err, data) => {
console.debug("=ACTS_JsServiceAbility_0600 subscribe (err,data)=======>"
+ ("json err【") + JSON.stringify(err) + ("")
+ ("json data【") + JSON.stringify(data) + ("")
......@@ -526,23 +529,25 @@ describe('ActsStServiceAbilityTest', function () {
it('ACTS_JsServiceAbility_0900', 0, async function (done) {
console.debug('ACTS_JsServiceAbility_0900====<begin');
try {
commonEvent.createSubscriber(CommonEventSubscribeInfo0900).then(async (data) => {
await commonEvent.createSubscriber(CommonEventSubscribeInfo0900).then(async (data) => {
console.debug("=ACTS_JsServiceAbility_0900 createSubscriber .then(data)=======>"
+ ("json data【") + JSON.stringify(data) + ("")
+ " ,data=" + data);
subscriber0900 = data;
await commonEvent.subscribe(subscriber0900, async (err, data) => {
commonEvent.subscribe(subscriber0900, async (err, data) => {
console.debug("=ACTS_JsServiceAbility_0900 subscribe (err,data)=======>"
+ ("json err【") + JSON.stringify(err) + ("")
+ ("json data【") + JSON.stringify(data) + ("")
+ " ,err=" + err + " ,data=" + data);
expect("ACTS_SerivceAbilityServerSecond_onCommand_ServiceStartService_0900").assertEqual(
data.event);
await sleep(1000)
unsubscribe("ACTS_JsServiceAbility_0900_unsubscribe", subscriber0900);
console.debug('ACTS_JsServiceAbility_0900====<end');
done();
});
})
await sleep(500)
featureAbility.startAbility(
{
want:
......@@ -576,24 +581,26 @@ describe('ActsStServiceAbilityTest', function () {
it('ACTS_JsServiceAbility_1000', 0, async function (done) {
console.debug('ACTS_JsServiceAbility_1000====<begin');
try {
commonEvent.createSubscriber(CommonEventSubscribeInfo1000).then(async (data) => {
await commonEvent.createSubscriber(CommonEventSubscribeInfo1000).then(async (data) => {
console.debug("=ACTS_JsServiceAbility_1000 createSubscriber .then(data)=======>"
+ ("json data【") + JSON.stringify(data) + ("")
+ " ,data=" + data);
subscriber1000 = data;
await commonEvent.subscribe(subscriber1000, async (err, data) => {
commonEvent.subscribe(subscriber1000, async (err, data) => {
console.debug("=ACTS_JsServiceAbility_1000 subscribe (err,data)=======>"
+ ("json err【") + JSON.stringify(err) + ("")
+ ("json data【") + JSON.stringify(data) + ("")
+ " ,err=" + err + " ,data=" + data);
expect("ACTS_SerivceAbilityServerSecond_onCommand_ServiceStartService_1000").assertEqual(
data.event);
await sleep(1000)
unsubscribe("ACTS_JsServiceAbility_1000_unsubscribe", subscriber1000);
console.debug('ACTS_JsServiceAbility_1000====<end');
done()
});
})
await featureAbility.startAbility(
await sleep(500)
featureAbility.startAbility(
{
want:
{
......@@ -624,12 +631,12 @@ describe('ActsStServiceAbilityTest', function () {
console.log('ACTS_JsServiceAbility_1300====<begin');
try {
var mConnIdJsPromise;
commonEvent.createSubscriber(CommonEventSubscribeInfo1300).then(async (data) => {
await commonEvent.createSubscriber(CommonEventSubscribeInfo1300).then(async (data) => {
console.debug("=ACTS_JsServiceAbility_1300 createSubscriber .then(data)=======>"
+ ("json data【") + JSON.stringify(data) + ("")
+ " ,data=" + data);
subscriber1300 = data;
await commonEvent.subscribe(subscriber1300, async (err, data) => {
commonEvent.subscribe(subscriber1300, async (err, data) => {
console.debug("=ACTS_JsServiceAbility_1300 subscribe (err,data)=======>"
+ ("json err【") + JSON.stringify(err) + ("")
+ ("json data【") + JSON.stringify(data) + ("")
......@@ -703,12 +710,12 @@ describe('ActsStServiceAbilityTest', function () {
try {
var currentAlertTimeout;
var mConnIdJsAsyncCallback;
commonEvent.createSubscriber(CommonEventSubscribeInfo1400).then(async (data) => {
await commonEvent.createSubscriber(CommonEventSubscribeInfo1400).then(async (data) => {
console.debug("=ACTS_JsServiceAbility_1400 createSubscriber .then(data)=======>"
+ ("json data【") + JSON.stringify(data) + ("")
+ " ,data=" + data);
subscriber1400 = data;
await commonEvent.subscribe(subscriber1400, async (err, data) => {
commonEvent.subscribe(subscriber1400, async (err, data) => {
console.debug("=ACTS_JsServiceAbility_1400 subscribe (err,data)=======>"
+ ("json err【") + JSON.stringify(err) + ("")
+ ("json data【") + JSON.stringify(data) + ("")
......@@ -784,12 +791,12 @@ describe('ActsStServiceAbilityTest', function () {
console.log('ACTS_JsServiceAbility_1500====<begin');
try {
var mConnIdJsPromise;
commonEvent.createSubscriber(CommonEventSubscribeInfo1500).then(async (data) => {
await commonEvent.createSubscriber(CommonEventSubscribeInfo1500).then(async (data) => {
console.debug("=ACTS_JsServiceAbility_1500 createSubscriber .then(data)=======>"
+ ("json data【") + JSON.stringify(data) + ("")
+ " ,data=" + data);
subscriber1500 = data;
await commonEvent.subscribe(subscriber1500, async (err, data) => {
commonEvent.subscribe(subscriber1500, async (err, data) => {
console.debug("=ACTS_JsServiceAbility_1500 subscribe (err,data)=======>"
+ ("json err【") + JSON.stringify(err) + ("")
+ ("json data【") + JSON.stringify(data) + ("")
......
......@@ -32,7 +32,7 @@ export default function ConnectAbilityTest1() {
return new Promise((resolve) => setTimeout(resolve, time))
}
describe('FreeInstall_FA_ConnectAbility', function () {
describe('FreeInstall_FA_ConnectAbilityOne', function () {
beforeAll(async function (done) {
console.info("FreeInstall_FA_ConnectAbility before all called");
abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator()
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册