Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
71affb88
X
Xts Acts
项目概览
OpenHarmony
/
Xts Acts
大约 1 年 前同步成功
通知
9
Star
22
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
X
Xts Acts
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
71affb88
编写于
8月 22, 2022
作者:
C
chengxingzhen
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
XTS
Signed-off-by:
N
chengxingzhen
<
chengxingzhen@huawei.com
>
上级
a387f71f
变更
16
展开全部
隐藏空白更改
内联
并排
Showing
16 changed file
with
901 addition
and
1013 deletion
+901
-1013
ability/ability_runtime/aacommand/AACommand07/entry/src/main/ets/test/Ability.test.ets
...mand/AACommand07/entry/src/main/ets/test/Ability.test.ets
+1
-1
ability/ability_runtime/aacommand/AACommand08/entry/src/main/ets/test/Ability.test.ets
...mand/AACommand08/entry/src/main/ets/test/Ability.test.ets
+1
-1
ability/ability_runtime/aacommand/AACommandPrintSync/entry/src/main/ets/MainAbility/MainAbility.ts
...ndPrintSync/entry/src/main/ets/MainAbility/MainAbility.ts
+1
-1
ability/ability_runtime/aacommand/AACommandPrintSync/entry/src/main/ets/test/Ability.test.ets
...CommandPrintSync/entry/src/main/ets/test/Ability.test.ets
+23
-23
ability/ability_runtime/aacommand/AACommandPrintSyncTest/entry/src/main/ets/MainAbility/MainAbility.ts
...intSyncTest/entry/src/main/ets/MainAbility/MainAbility.ts
+1
-10
ability/ability_runtime/aacommand/AACommandPrintSyncTest/entry/src/main/ets/MainAbility/pages/index.ets
...ntSyncTest/entry/src/main/ets/MainAbility/pages/index.ets
+0
-49
ability/ability_runtime/aacommand/AACommandPrintSyncTest/entry/src/main/ets/pages/index.ets
...AACommandPrintSyncTest/entry/src/main/ets/pages/index.ets
+87
-1
ability/ability_runtime/aacommand/AACommandPrintSyncTest/entry/src/main/ets/test/Ability.test.ets
...andPrintSyncTest/entry/src/main/ets/test/Ability.test.ets
+39
-118
ability/ability_runtime/aacommand/AACommandRelyHap/entry/src/main/ets/MainAbility/MainAbility.ts
...mandRelyHap/entry/src/main/ets/MainAbility/MainAbility.ts
+1
-1
ability/ability_runtime/aacommand/AACommandRelyHap/entry/src/main/ets/test/Ability.test.ets
...AACommandRelyHap/entry/src/main/ets/test/Ability.test.ets
+94
-94
ability/ability_runtime/aacommand/AACommandpackage/entry/src/main/ets/MainAbility/MainAbility.ts
...mandpackage/entry/src/main/ets/MainAbility/MainAbility.ts
+1
-1
ability/ability_runtime/aacommand/AACommandpackage/entry/src/main/ets/test/Ability.test.ets
...AACommandpackage/entry/src/main/ets/test/Ability.test.ets
+1
-1
ability/ability_runtime/aacommand/AACommandtest/entry/src/main/ets/MainAbility/MainAbility.ts
...Commandtest/entry/src/main/ets/MainAbility/MainAbility.ts
+1
-10
ability/ability_runtime/aacommand/AACommandtest/entry/src/main/ets/MainAbility/pages/index.ets
...ommandtest/entry/src/main/ets/MainAbility/pages/index.ets
+0
-49
ability/ability_runtime/aacommand/AACommandtest/entry/src/main/ets/pages/index.ets
...acommand/AACommandtest/entry/src/main/ets/pages/index.ets
+497
-1
ability/ability_runtime/aacommand/AACommandtest/entry/src/main/ets/test/Ability.test.ets
...nd/AACommandtest/entry/src/main/ets/test/Ability.test.ets
+153
-652
未找到文件。
ability/ability_runtime/aacommand/AACommand07/entry/src/main/ets/test/Ability.test.ets
浏览文件 @
71affb88
...
...
@@ -13,7 +13,7 @@
* limitations under the License.
*/
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '
hypium/index
'
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '
@ohos/hypium
'
import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'
import commonEvent from "@ohos.commonEvent"
...
...
ability/ability_runtime/aacommand/AACommand08/entry/src/main/ets/test/Ability.test.ets
浏览文件 @
71affb88
...
...
@@ -13,7 +13,7 @@
* limitations under the License.
*/
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '
hypium/index
'
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '
@ohos/hypium
'
import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'
import commonEvent from "@ohos.commonEvent"
...
...
ability/ability_runtime/aacommand/AACommandPrintSync/entry/src/main/ets/MainAbility/MainAbility.ts
浏览文件 @
71affb88
...
...
@@ -15,7 +15,7 @@
import
Ability
from
'
@ohos.application.Ability
'
import
AbilityDelegatorRegistry
from
'
@ohos.application.abilityDelegatorRegistry
'
import
{
Hypium
}
from
'
hypium/index
'
import
{
Hypium
}
from
'
@ohos/hypium
'
import
testsuite
from
'
../test/List.test
'
export
default
class
MainAbility
extends
Ability
{
...
...
ability/ability_runtime/aacommand/AACommandPrintSync/entry/src/main/ets/test/Ability.test.ets
浏览文件 @
71affb88
...
...
@@ -13,39 +13,39 @@
* limitations under the License.
*/
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '
hypium/index
'
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '
@ohos/hypium
'
export default function abilityTest() {
describe('ACTS_AACommand_01_3', function () {
/**
* @tc.number: ACTS_AACommand_printSync_0100
* @tc.number: ACTS_AACommand_printSync_01
_01
00
* @tc.name: The -b, -p, -s, -w and other parameters of the test command are valid,
* The printSync 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_printSync_0100', 0, async function (done) {
console.log("ACTS_AACommand_printSync_0100 start ====> " )
it('ACTS_AACommand_printSync_01
_01
00', 0, async function (done) {
console.log("ACTS_AACommand_printSync_01
_01
00 start ====> " )
var msg = '测试日志!@#$%^&*()_+QWE{}|?><Fafq3146'
globalThis.abilityDelegator.printSync(msg);
console.log("ACTS_AACommand_printSync_0100 printSync end ====> " )
var finishmsg = 'ACTS_AACommand_printSync_0100 end'
console.log("ACTS_AACommand_printSync_01
_01
00 printSync end ====> " )
var finishmsg = 'ACTS_AACommand_printSync_01
_01
00 end'
globalThis.abilityDelegator.finishTest(finishmsg, 1).then((data)=>{
console.log("ACTS_AACommand_printSync_0100 finishTest test end ========> callback " )
console.log("ACTS_AACommand_printSync_0100 finishTest test end " +
console.log("ACTS_AACommand_printSync_01
_01
00 finishTest test end ========> callback " )
console.log("ACTS_AACommand_printSync_01
_01
00 finishTest test end " +
"========> callback data: "+JSON.stringify(data))
done()
})
})
/**
* @tc.number: ACTS_AACommand_printSync_0200
* @tc.number: ACTS_AACommand_printSync_0
1_0
200
* @tc.name: The -b, -p, -s, -w and other parameters of the test command are valid,
* The length of the printSync 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_printSync_0200', 0, async function (done) {
it('ACTS_AACommand_printSync_0
1_0
200', 0, async function (done) {
var msg = '0callbackaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'aaaaaaaaaa' +
'1aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
...
...
@@ -58,22 +58,22 @@ export default function abilityTest() {
'8aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'9aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaae'
globalThis.abilityDelegator.printSync(msg);
console.log("ACTS_AACommand_printSync_0200 printSync end ====> " )
var finishmsg = 'ACTS_AACommand_printSync_0200 end'
console.log("ACTS_AACommand_printSync_0
1_0
200 printSync end ====> " )
var finishmsg = 'ACTS_AACommand_printSync_0
1_0
200 end'
globalThis.abilityDelegator.finishTest(finishmsg, 1).then(()=>{
console.log("ACTS_AACommand_printSync_0200 print test end ========> callback " )
console.log("ACTS_AACommand_printSync_0
1_0
200 print test end ========> callback " )
done()
})
})
/**
* @tc.number: ACTS_AACommand_printSync_0300
* @tc.number: ACTS_AACommand_printSync_0
1_0
300
* @tc.name: The -b, -p, -s, -w and other parameters of the test command are valid
* The length of the printSync 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_printSync_0300', 0, async function (done) {
it('ACTS_AACommand_printSync_0
1_0
300', 0, async function (done) {
var msg = '0callbackaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'aaaaaaaaaa' +
'1aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
...
...
@@ -87,27 +87,27 @@ export default function abilityTest() {
'9aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaae' +
'fffffffffff'
globalThis.abilityDelegator.printSync(msg);
console.log("ACTS_AACommand_printSync_0300 printSync end ====> " )
var finishmsg = 'ACTS_AACommand_printSync_0300 end'
console.log("ACTS_AACommand_printSync_0
1_0
300 printSync end ====> " )
var finishmsg = 'ACTS_AACommand_printSync_0
1_0
300 end'
globalThis.abilityDelegator.finishTest(finishmsg, 1).then(()=>{
console.log("ACTS_AACommand_printSync_0300 print test end ========> callback " )
console.log("ACTS_AACommand_printSync_0
1_0
300 print test end ========> callback " )
done()
})
})
/**
* @tc.number: ACTS_AACommand_printSync_0400
* @tc.number: ACTS_AACommand_printSync_0
1_0
400
* @tc.name: The -b, -p, -s, -w and other parameters of the test command are valid,
* printSync 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_printSync_0400', 0, async function (done) {
it('ACTS_AACommand_printSync_0
1_0
400', 0, async function (done) {
globalThis.abilityDelegator.printSync(null);
console.log("ACTS_AACommand_printSync_0300 printSync end ====> " )
var finishmsg = 'ACTS_AACommand_printSync_0400 end'
console.log("ACTS_AACommand_printSync_0
1_0
300 printSync end ====> " )
var finishmsg = 'ACTS_AACommand_printSync_0
1_0
400 end'
globalThis.abilityDelegator.finishTest(finishmsg, 1).then(()=>{
console.log("ACTS_AACommand_printSync_0400 print test end ========> callback " )
console.log("ACTS_AACommand_printSync_0
1_0
400 print test end ========> callback " )
done()
})
})
...
...
ability/ability_runtime/aacommand/AACommandPrintSyncTest/entry/src/main/ets/MainAbility/MainAbility.ts
浏览文件 @
71affb88
...
...
@@ -14,20 +14,11 @@
*/
import
Ability
from
'
@ohos.application.Ability
'
import
AbilityDelegatorRegistry
from
'
@ohos.application.abilityDelegatorRegistry
'
import
{
Hypium
}
from
'
hypium/index
'
import
testsuite
from
'
../test/List.test
'
export
default
class
MainAbility
extends
Ability
{
onCreate
(
want
,
launchParam
)
{
globalThis
.
abilityContext
=
this
.
context
;
console
.
log
(
'
MainAbility onCreate
'
)
var
abilityDelegator
:
any
abilityDelegator
=
AbilityDelegatorRegistry
.
getAbilityDelegator
()
var
abilityDelegatorArguments
:
any
abilityDelegatorArguments
=
AbilityDelegatorRegistry
.
getArguments
()
console
.
info
(
'
start run testcase!!!
'
)
Hypium
.
hypiumTest
(
abilityDelegator
,
abilityDelegatorArguments
,
testsuite
)
}
onDestroy
()
{
...
...
@@ -36,7 +27,7 @@ export default class MainAbility extends Ability {
onWindowStageCreate
(
windowStage
)
{
console
.
log
(
'
MainAbility onWindowStageCreate
'
)
windowStage
.
setUIContent
(
this
.
context
,
'
MainAbility/
pages/index
'
,
null
)
windowStage
.
setUIContent
(
this
.
context
,
'
pages/index
'
,
null
)
}
...
...
ability/ability_runtime/aacommand/AACommandPrintSyncTest/entry/src/main/ets/MainAbility/pages/index.ets
已删除
100644 → 0
浏览文件 @
a387f71f
/*
* 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 router from '@ohos.router';
@Entry
@Component
struct Index {
aboutToAppear() {
console.info('MainAbility index aboutToAppear')
}
@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
ability/ability_runtime/aacommand/AACommandPrintSyncTest/entry/src/main/ets/pages/index.ets
浏览文件 @
71affb88
...
...
@@ -13,17 +13,103 @@
* limitations under the License.
*/
import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'
import { Hypium } from '@ohos/hypium'
import testsuite from '../test/List.test'
@Entry
@Component
struct Index {
@State message: string = 'Hello World'
aboutToAppear() {
console.info('MainAbility index aboutToAppear')
console.info('start run testcase!!!')
let cmd: any
let abilityDelegatorArguments: any
let abilityDelegator: any
function sleep(delay) {
let start = (new Date()).getTime();
while ((new Date()).getTime() - start < delay) {
continue;
}
}
function test(time) {
sleep(time);
}
abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator()
abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments()
cmd = 'aa test -b com.example.aacommandprintsync -m entry_test -s class ' +
'ACTS_AACommand_01_3#ACTS_AACommand_printSync_01_0100 -s unittest OpenHarmonyTestRunner'
globalThis.abilityDelegator.executeShellCommand(cmd, (err, data) => {
console.log('ACTS_AACommand_printSync_01_0100 start err: ' + JSON.stringify(err))
console.log('ACTS_AACommand_printSync_01_0100 stdResult = ' + data.stdResult)
globalThis.stdResult1 = data.stdResult;
console.log('ACTS_AACommand_printSync_01_0100 - executeShellCommand: end ')
})
test(3000)
cmd = 'aa test -m entry_test -b com.example.aacommandprintsync -s class ' +
'ACTS_AACommand_01_3#ACTS_AACommand_printSync_01_0200 -s unittest OpenHarmonyTestRunner'
globalThis.abilityDelegator.executeShellCommand(cmd, (err, data) => {
console.log('ACTS_AACommand_printSync_01_0200 start err: ' + JSON.stringify(err))
console.log('ACTS_AACommand_printSync_01_0200 stdResult = ' + data.stdResult)
globalThis.stdResult2 = data.stdResult;
console.log('ACTS_AACommand_printSync_01_0200 - executeShellCommand: end ')
})
test(3000)
cmd = 'aa test -m entry_test -b com.example.aacommandprintsync -s class ' +
'ACTS_AACommand_01_3#ACTS_AACommand_printSync_01_0300 -s unittest OpenHarmonyTestRunner'
globalThis.abilityDelegator.executeShellCommand(cmd, (err, data) => {
console.log('ACTS_AACommand_printSync_01_0300 start err: ' + JSON.stringify(err))
console.log('ACTS_AACommand_printSync_01_0300 stdResult = ' + data.stdResult)
globalThis.stdResult3 = data.stdResult;
console.log('ACTS_AACommand_printSync_01_0300 - executeShellCommand: end ')
})
test(3000)
cmd = 'aa test -m entry_test -b com.example.aacommandprintsync -s class ' +
'ACTS_AACommand_01_3#ACTS_AACommand_printSync_01_0400 -s unittest OpenHarmonyTestRunner'
globalThis.abilityDelegator.executeShellCommand(cmd, (err, data) => {
console.log('ACTS_AACommand_printSync_01_0400 start err: ' + JSON.stringify(err))
console.log('ACTS_AACommand_printSync_01_0400 stdResult = ' + data.stdResult)
globalThis.stdResult4 = data.stdResult;
console.log('ACTS_AACommand_printSync_01_0400 - executeShellCommand: end ')
})
test(3000)
setTimeout(() => {
Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite)
}, 15000)
}
@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%')
}
...
...
ability/ability_runtime/aacommand/AACommandPrintSyncTest/entry/src/main/ets/test/Ability.test.ets
浏览文件 @
71affb88
...
...
@@ -14,21 +14,10 @@
*/
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'
import appManager from '@ohos.application.appManager';
const DELAY = 3000
import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'
let msg: any
export default function abilityTest() {
describe('ActsAbilityTest', function () {
var abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator()
function checkRunningProcess(name, dataInfo) {
for (let i = 0, len = dataInfo.length; i < len; i++) {
if (dataInfo[i].processName == name) {
return true;
}
}
return false;
}
/**
* @tc.number: ACTS_AACommand_printSync_0100
* @tc.name: The -b, -p, -s, -w and other parameters of the test command are valid
...
...
@@ -37,27 +26,10 @@ export default function abilityTest() {
* the test command.
*/
it('ACTS_AACommand_printSync_0100', 0, async function (done) {
console.log("ACTS_AACommand_printSync_0100 --- start")
var cmd = 'aa test -b com.example.aacommandprintsync -m entry_test -s class ' +
'ACTS_AACommand_01_3#ACTS_AACommand_printSync_0100 -s unittest OpenHarmonyTestRunner'
var msg = '测试日志!@#$%^&*()_+QWE{}|?><Fafq3146'
globalThis.abilityDelegator.executeShellCommand(cmd, (err, data) => {
console.log('ACTS_AACommand_printSync_0100 - executeShellCommand: start ')
console.log('ACTS_AACommand_printSync_0100 stdResult = ' + data.stdResult)
var i = data.stdResult.indexOf(msg);
console.log('ACTS_AACommand_printSync_0100 query string i = ' + i);
expect(i == -1).assertEqual(false);
console.log('ACTS_AACommand_printSync_0100 - executeShellCommand: end')
})
setTimeout(async() => {
var procrssinfo = await appManager.getProcessRunningInfos()
console.log('ACTS_AACommand_printSync_0100 getProcessRunningInfos ======> '
+ JSON.stringify(procrssinfo));
var infores = checkRunningProcess('com.example.aacommandprintsync', procrssinfo)
console.log("====>ACTS_AACommand_printSync_0100====>infores = " + infores)
expect(infores==false).assertEqual(true);
done();
}, DELAY )
console.log('ACTS_AACommand_printSync_0100 --- start')
msg = '测试日志!@#$%^&*()_+QWE{}|?><Fafq3146'
expect(globalThis.stdResult1).assertContain(msg)
done()
})
/**
...
...
@@ -68,37 +40,20 @@ export default function abilityTest() {
* the test command.
*/
it('ACTS_AACommand_printSync_0200', 0, async function (done) {
console.log("ACTS_AACommand_printSync_0200 --- start")
var cmd = 'aa test -m entry_test -b com.example.aacommandprintsync -s class ' +
'ACTS_AACommand_01_3#ACTS_AACommand_printSync_0200 -s unittest OpenHarmonyTestRunner'
var msg = '0callbackaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'aaaaaaaaaa' +
'1aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'2aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'3aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'4aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'5aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'6aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'7aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'8aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'9aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaae'
globalThis.abilityDelegator.executeShellCommand(cmd, (err, data) => {
console.log('ACTS_AACommand_printSync_0200 - executeShellCommand: start ')
console.log('ACTS_AACommand_printSync_0200 stdResult = ' + data.stdResult)
var i = data.stdResult.indexOf(msg);
console.log('ACTS_AACommand_printSync_0200 query string i = ' + i);
expect(i == -1).assertEqual(false);
console.log('ACTS_AACommand_printSync_0200 - executeShellCommand: end')
})
setTimeout(async() => {
var procrssinfo = await appManager.getProcessRunningInfos()
console.log('ACTS_AACommand_printSync_0200 getProcessRunningInfos ======> ' +
'' + JSON.stringify(procrssinfo));
var infores = checkRunningProcess('com.example.aacommandprintsync', procrssinfo)
console.log("====>ACTS_AACommand_printSync_0200====>infores = " + infores)
expect(infores).assertEqual(false);
done();
}, DELAY )
console.log('ACTS_AACommand_printSync_0200 --- start')
msg = '0callbackaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'aaaaaaaaaa' +
'1aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'2aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'3aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'4aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'5aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'6aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'7aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'8aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'9aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaae'
expect(globalThis.stdResult2).assertContain(msg);
done();
})
/**
...
...
@@ -109,41 +64,21 @@ export default function abilityTest() {
* the test command.
*/
it('ACTS_AACommand_printSync_0300', 0, async function (done) {
console.log("ACTS_AACommand_printSync_0300 --- start")
var cmd = 'aa test -m entry_test -b com.example.aacommandprintsync -s class ' +
'ACTS_AACommand_01_3#ACTS_AACommand_printSync_0300 -s unittest OpenHarmonyTestRunner'
var msg = '0callbackaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'aaaaaaaaaa' +
'1aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'2aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'3aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'4aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'5aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'6aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'7aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'8aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'9aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaae'
var msgcopy = 'fffffffffff'
globalThis.abilityDelegator.executeShellCommand(cmd, (err, data) => {
console.log('ACTS_AACommand_printSync_0300 - executeShellCommand: start ')
console.log('ACTS_AACommand_printSync_0300 stdResult = ' + data.stdResult)
var i = data.stdResult.indexOf(msg);
console.log('ACTS_AACommand_printSync_0300 query string i = ' + i);
expect(i == -1).assertEqual(false);
var j = data.stdResult.indexOf(msgcopy);
console.log('ACTS_AACommand_printSync_0300 === query string j = ' + j);
expect(j == -1).assertEqual(true);
console.log('ACTS_AACommand_printSync_0300 - executeShellCommand: end')
})
setTimeout(async() => {
var procrssinfo = await appManager.getProcessRunningInfos()
console.log('ACTS_AACommand_printSync_0300 getProcessRunningInfos ======> '
+ JSON.stringify(procrssinfo));
var infores = checkRunningProcess('com.example.aacommandprintsync', procrssinfo)
console.log("====>ACTS_AACommand_printSync_0300====>infores = " + infores)
expect(infores).assertEqual(false);
done();
}, DELAY )
console.log('ACTS_AACommand_printSync_0300 --- start')
msg = '0callbackaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'aaaaaaaaaa' +
'1aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'2aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'3aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'4aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'5aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'6aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'7aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'8aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'9aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaae'
expect(globalThis.stdResult3).assertContain(msg);
done()
})
/**
...
...
@@ -154,24 +89,10 @@ export default function abilityTest() {
* the test command.
*/
it('ACTS_AACommand_printSync_0400', 0, async function (done) {
console.log("ACTS_AACommand_printSync_0400 --- start")
var cmd = 'aa test -m entry_test -b com.example.aacommandprintsync -s class ' +
'ACTS_AACommand_01_3#ACTS_AACommand_printSync_0400 -s unittest OpenHarmonyTestRunner'
globalThis.abilityDelegator.executeShellCommand(cmd, (err, data) => {
console.log('ACTS_AACommand_printSync_0400 - executeShellCommand: start ')
console.log('ACTS_AACommand_printSync_0400 stdResult = ' + data.stdResult)
expect(data.stdResult.indexOf('start ability successfully')==-1).assertEqual(false);
console.log('ACTS_AACommand_printSync_0400 - executeShellCommand: end')
})
setTimeout(async() => {
var procrssinfo = await appManager.getProcessRunningInfos()
console.log('ACTS_AACommand_printSync_0400 getProcessRunningInfos ======> '
+ JSON.stringify(procrssinfo));
var infores = checkRunningProcess('com.example.aacommandprintsync', procrssinfo)
console.log("====>ACTS_AACommand_printSync_0400====>infores = ")
expect(infores).assertEqual(false);
done();
}, DELAY )
console.log('ACTS_AACommand_printSync_0400 --- start')
msg = 'start ability successfully';
expect(globalThis.stdResult4).assertContain(msg);
done();
})
})
}
\ No newline at end of file
ability/ability_runtime/aacommand/AACommandRelyHap/entry/src/main/ets/MainAbility/MainAbility.ts
浏览文件 @
71affb88
...
...
@@ -15,7 +15,7 @@
import
Ability
from
'
@ohos.application.Ability
'
import
AbilityDelegatorRegistry
from
'
@ohos.application.abilityDelegatorRegistry
'
import
{
Hypium
}
from
'
hypium/index
'
import
{
Hypium
}
from
'
@ohos/hypium
'
import
testsuite
from
'
../test/List.test
'
export
default
class
MainAbility
extends
Ability
{
...
...
ability/ability_runtime/aacommand/AACommandRelyHap/entry/src/main/ets/test/Ability.test.ets
浏览文件 @
71affb88
此差异已折叠。
点击以展开。
ability/ability_runtime/aacommand/AACommandpackage/entry/src/main/ets/MainAbility/MainAbility.ts
浏览文件 @
71affb88
...
...
@@ -15,7 +15,7 @@
import
Ability
from
'
@ohos.application.Ability
'
import
AbilityDelegatorRegistry
from
'
@ohos.application.abilityDelegatorRegistry
'
import
{
Hypium
}
from
'
hypium/index
'
import
{
Hypium
}
from
'
@ohos/hypium
'
import
testsuite
from
'
../test/List.test
'
export
default
class
MainAbility
extends
Ability
{
...
...
ability/ability_runtime/aacommand/AACommandpackage/entry/src/main/ets/test/Ability.test.ets
浏览文件 @
71affb88
...
...
@@ -13,7 +13,7 @@
* limitations under the License.
*/
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '
hypium/index
'
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '
@ohos/hypium
'
import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'
export default function abilityTest() {
describe('ACTS_AACommand_01_3', function () {
...
...
ability/ability_runtime/aacommand/AACommandtest/entry/src/main/ets/MainAbility/MainAbility.ts
浏览文件 @
71affb88
...
...
@@ -14,19 +14,10 @@
*/
import
Ability
from
'
@ohos.application.Ability
'
import
AbilityDelegatorRegistry
from
'
@ohos.application.abilityDelegatorRegistry
'
import
{
Hypium
}
from
'
hypium/index
'
import
testsuite
from
'
../test/List.test
'
export
default
class
MainAbility
extends
Ability
{
onCreate
(
want
,
launchParam
)
{
console
.
log
(
'
MainAbility onCreate
'
)
var
abilityDelegator
:
any
abilityDelegator
=
AbilityDelegatorRegistry
.
getAbilityDelegator
()
var
abilityDelegatorArguments
:
any
abilityDelegatorArguments
=
AbilityDelegatorRegistry
.
getArguments
()
console
.
info
(
'
start run testcase!!!
'
)
Hypium
.
hypiumTest
(
abilityDelegator
,
abilityDelegatorArguments
,
testsuite
)
}
onDestroy
()
{
...
...
@@ -35,7 +26,7 @@ export default class MainAbility extends Ability {
onWindowStageCreate
(
windowStage
)
{
console
.
log
(
'
MainAbility onWindowStageCreate
'
)
windowStage
.
setUIContent
(
this
.
context
,
'
MainAbility/
pages/index
'
,
null
)
windowStage
.
setUIContent
(
this
.
context
,
'
pages/index
'
,
null
)
globalThis
.
abilityContext
=
this
.
context
;
}
...
...
ability/ability_runtime/aacommand/AACommandtest/entry/src/main/ets/MainAbility/pages/index.ets
已删除
100644 → 0
浏览文件 @
a387f71f
/*
* 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 router from '@ohos.router';
@Entry
@Component
struct Index {
aboutToAppear() {
console.info('MainAbility index aboutToAppear')
}
@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
ability/ability_runtime/aacommand/AACommandtest/entry/src/main/ets/pages/index.ets
浏览文件 @
71affb88
此差异已折叠。
点击以展开。
ability/ability_runtime/aacommand/AACommandtest/entry/src/main/ets/test/Ability.test.ets
浏览文件 @
71affb88
此差异已折叠。
点击以展开。
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录