Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
c01b19c4
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看板
未验证
提交
c01b19c4
编写于
9月 27, 2022
作者:
O
openharmony_ci
提交者:
Gitee
9月 27, 2022
浏览文件
操作
浏览文件
下载
差异文件
!5706 XTS冻结修改
Merge pull request !5706 from chengxingzhen/master
上级
44cf90e5
7b3caf71
变更
13
隐藏空白更改
内联
并排
Showing
13 changed file
with
197 addition
and
35 deletion
+197
-35
ability/ability_runtime/aacommand/AACommandPrintOneTest/entry/src/main/ets/MainAbility/MainAbility.ts
...rintOneTest/entry/src/main/ets/MainAbility/MainAbility.ts
+36
-8
ability/ability_runtime/aacommand/AACommandPrintOneTest/entry/src/main/ets/test/Ability.test.ets
...mandPrintOneTest/entry/src/main/ets/test/Ability.test.ets
+19
-0
ability/ability_runtime/aacommand/AACommandPrintOneTest/entry/src/main/module.json
...acommand/AACommandPrintOneTest/entry/src/main/module.json
+1
-0
ability/ability_runtime/aacommand/AACommandPrintSyncTest/entry/src/main/ets/MainAbility/MainAbility.ts
...intSyncTest/entry/src/main/ets/MainAbility/MainAbility.ts
+24
-4
ability/ability_runtime/aacommand/AACommandPrintSyncTest/entry/src/main/ets/test/Ability.test.ets
...andPrintSyncTest/entry/src/main/ets/test/Ability.test.ets
+19
-0
ability/ability_runtime/aacommand/AACommandPrintSyncTest/entry/src/main/module.json
...command/AACommandPrintSyncTest/entry/src/main/module.json
+1
-0
ability/ability_runtime/aacommand/AACommandtest/entry/src/main/ets/MainAbility/MainAbility.ts
...Commandtest/entry/src/main/ets/MainAbility/MainAbility.ts
+45
-11
ability/ability_runtime/aacommand/AACommandtest/entry/src/main/ets/test/Ability.test.ets
...nd/AACommandtest/entry/src/main/ets/test/Ability.test.ets
+18
-0
ability/ability_runtime/aacommand/AACommandtest/entry/src/main/module.json
...untime/aacommand/AACommandtest/entry/src/main/module.json
+1
-0
ability/ability_runtime/newwant/actsnewwanttest/entry/src/main/ets/MainAbility/MainAbility.ts
...newwanttest/entry/src/main/ets/MainAbility/MainAbility.ts
+13
-1
ability/ability_runtime/newwant/actsnewwanttest/entry/src/main/ets/MainAbility/pages/index/index.ets
...test/entry/src/main/ets/MainAbility/pages/index/index.ets
+1
-11
ability/ability_runtime/newwant/actsnewwanttest/entry/src/main/ets/test/Ability.test.ets
.../actsnewwanttest/entry/src/main/ets/test/Ability.test.ets
+18
-0
ability/ability_runtime/newwant/actsnewwanttest/entry/src/main/module.json
...untime/newwant/actsnewwanttest/entry/src/main/module.json
+1
-0
未找到文件。
ability/ability_runtime/aacommand/AACommandPrintOneTest/entry/src/main/ets/MainAbility/MainAbility.ts
浏览文件 @
c01b19c4
...
...
@@ -18,6 +18,18 @@ import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry
import
{
Hypium
}
from
'
@ohos/hypium
'
import
testsuite
from
'
../test/List.test
'
async
function
startAbilityTest
(
TAG
,
context
)
{
let
wantInfo
=
{
bundleName
:
"
com.example.aacommandprintonetest
"
,
abilityName
:
"
MainAbility
"
}
await
context
.
startAbility
(
wantInfo
).
then
((
data
)
=>
{
console
.
log
(
TAG
+
"
startAbility data :
"
+
JSON
.
stringify
(
data
));
}).
catch
((
err
)
=>
{
console
.
log
(
TAG
+
"
startAbility err :
"
+
JSON
.
stringify
(
err
));
})
}
export
default
class
MainAbility
extends
Ability
{
async
onCreate
(
want
,
launchParam
)
{
globalThis
.
abilityContext
=
this
.
context
;
...
...
@@ -34,96 +46,112 @@ export default class MainAbility extends Ability {
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
)
=>
{
abilityDelegator
.
executeShellCommand
(
cmd
,
async
(
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
startAbilityTest
(
'
ACTS_AACommand_print_01_0100
'
,
this
.
context
);
})
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
)
=>
{
abilityDelegator
.
executeShellCommand
(
cmd
,
async
(
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
startAbilityTest
(
'
ACTS_AACommand_print_01_0200
'
,
this
.
context
);
})
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
)
=>
{
abilityDelegator
.
executeShellCommand
(
cmd
,
async
(
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
startAbilityTest
(
'
ACTS_AACommand_print_01_0300
'
,
this
.
context
);
})
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
)
=>
{
abilityDelegator
.
executeShellCommand
(
cmd
,
async
(
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
startAbilityTest
(
'
ACTS_AACommand_print_01_0400
'
,
this
.
context
);
})
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
)
=>
{
abilityDelegator
.
executeShellCommand
(
cmd
,
async
(
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
startAbilityTest
(
'
ACTS_AACommand_print_01_0500
'
,
this
.
context
);
})
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
)
=>
{
abilityDelegator
.
executeShellCommand
(
cmd
,
async
(
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
startAbilityTest
(
'
ACTS_AACommand_print_01_0600
'
,
this
.
context
);
})
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
)
=>
{
abilityDelegator
.
executeShellCommand
(
cmd
,
async
(
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
startAbilityTest
(
'
ACTS_AACommand_print_01_0700
'
,
this
.
context
);
})
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
)
=>
{
abilityDelegator
.
executeShellCommand
(
cmd
,
async
(
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
startAbilityTest
(
'
ACTS_AACommand_print_01_0800
'
,
this
.
context
);
})
setTimeout
(()
=>
{
...
...
ability/ability_runtime/aacommand/AACommandPrintOneTest/entry/src/main/ets/test/Ability.test.ets
浏览文件 @
c01b19c4
...
...
@@ -20,6 +20,25 @@ let msgcopy: any
export default function abilityTest() {
describe('ActsAACommandPrinOneTest', function () {
afterEach(async (done) => {
console.log("ActsAACommandPrinOneTest afterEach called");
let wantInfo = {
bundleName: "com.example.aacommandprintonetest",
abilityName: "MainAbility"
}
await globalThis.abilityTestContext.startAbility(wantInfo).then((data) => {
console.log("ActsAACommandPrinOneTest startAbility data : " + JSON.stringify(data));
}).catch((err) => {
console.log("ActsAACommandPrinOneTest startAbility err : " + JSON.stringify(err));
})
setTimeout(function () {
console.log("ActsAACommandPrinOneTest afterEach end");
done();
}, 1000);
})
/**
* @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
...
...
ability/ability_runtime/aacommand/AACommandPrintOneTest/entry/src/main/module.json
浏览文件 @
c01b19c4
...
...
@@ -21,6 +21,7 @@
"icon"
:
"$media:icon"
,
"label"
:
"$string:MainAbility_label"
,
"visible"
:
true
,
"launchType"
:
"singleton"
,
"skills"
:
[
{
"entities"
:
[
...
...
ability/ability_runtime/aacommand/AACommandPrintSyncTest/entry/src/main/ets/MainAbility/MainAbility.ts
浏览文件 @
c01b19c4
...
...
@@ -18,6 +18,18 @@ import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry
import
{
Hypium
}
from
'
@ohos/hypium
'
import
testsuite
from
'
../test/List.test
'
async
function
startAbilityTest
(
TAG
,
context
)
{
let
wantInfo
=
{
bundleName
:
"
com.example.aacommandprintsynctest
"
,
abilityName
:
"
MainAbility
"
}
await
context
.
startAbility
(
wantInfo
).
then
((
data
)
=>
{
console
.
log
(
TAG
+
"
startAbility data :
"
+
JSON
.
stringify
(
data
));
}).
catch
((
err
)
=>
{
console
.
log
(
TAG
+
"
startAbility err :
"
+
JSON
.
stringify
(
err
));
})
}
export
default
class
MainAbility
extends
Ability
{
async
onCreate
(
want
,
launchParam
)
{
globalThis
.
abilityContext
=
this
.
context
;
...
...
@@ -34,44 +46,52 @@ export default class MainAbility extends Ability {
cmd
=
'
aa test -b com.example.aacommandprintsync -m entry_test -s class
'
+
'
ACTS_AACommand_01_3#ACTS_AACommand_printSync_01_0100 -s unittest OpenHarmonyTestRunner
'
abilityDelegator
.
executeShellCommand
(
cmd
,
(
err
,
data
)
=>
{
abilityDelegator
.
executeShellCommand
(
cmd
,
async
(
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
'
)
await
startAbilityTest
(
'
ACTS_AACommand_printSync_01_0100
'
,
this
.
context
);
})
await
sleep
(
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
'
abilityDelegator
.
executeShellCommand
(
cmd
,
(
err
,
data
)
=>
{
abilityDelegator
.
executeShellCommand
(
cmd
,
async
(
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
'
)
await
startAbilityTest
(
'
ACTS_AACommand_printSync_01_0200
'
,
this
.
context
);
})
await
sleep
(
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
'
abilityDelegator
.
executeShellCommand
(
cmd
,
(
err
,
data
)
=>
{
abilityDelegator
.
executeShellCommand
(
cmd
,
async
(
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
'
)
await
startAbilityTest
(
'
ACTS_AACommand_printSync_01_0300
'
,
this
.
context
);
})
await
sleep
(
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
'
abilityDelegator
.
executeShellCommand
(
cmd
,
(
err
,
data
)
=>
{
abilityDelegator
.
executeShellCommand
(
cmd
,
async
(
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
'
)
await
startAbilityTest
(
'
ACTS_AACommand_printSync_01_0400
'
,
this
.
context
);
})
setTimeout
(()
=>
{
...
...
ability/ability_runtime/aacommand/AACommandPrintSyncTest/entry/src/main/ets/test/Ability.test.ets
浏览文件 @
c01b19c4
...
...
@@ -18,6 +18,25 @@ import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from
let msg: any
export default function abilityTest() {
describe('ActsAbilityTest', function () {
afterEach(async (done) => {
console.log("ActsAACommandPrintSyncTest afterEach called");
let wantInfo = {
bundleName: "com.example.aacommandprintsynctest",
abilityName: "MainAbility"
}
await globalThis.abilityTestContext.startAbility(wantInfo).then((data) => {
console.log("ActsAACommandPrintSyncTest startAbility data : " + JSON.stringify(data));
}).catch((err) => {
console.log("ActsAACommandPrintSyncTest startAbility err : " + JSON.stringify(err));
})
setTimeout(function () {
console.log("ActsAACommandPrintSyncTest afterEach end");
done();
}, 1000);
})
/**
* @tc.number: ACTS_AACommand_printSync_0100
* @tc.name: The -b, -p, -s, -w and other parameters of the test command are valid
...
...
ability/ability_runtime/aacommand/AACommandPrintSyncTest/entry/src/main/module.json
浏览文件 @
c01b19c4
...
...
@@ -21,6 +21,7 @@
"icon"
:
"$media:icon"
,
"label"
:
"$string:MainAbility_label"
,
"visible"
:
true
,
"launchType"
:
"singleton"
,
"skills"
:
[
{
"entities"
:
[
...
...
ability/ability_runtime/aacommand/AACommandtest/entry/src/main/ets/MainAbility/MainAbility.ts
浏览文件 @
c01b19c4
...
...
@@ -18,6 +18,18 @@ import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry
import
{
Hypium
}
from
'
@ohos/hypium
'
import
testsuite
from
'
../test/List.test
'
async
function
startAbilityTest
(
TAG
,
context
)
{
let
wantInfo
=
{
bundleName
:
"
com.example.aacommandtest
"
,
abilityName
:
"
MainAbility
"
}
await
context
.
startAbility
(
wantInfo
).
then
((
data
)
=>
{
console
.
log
(
TAG
+
"
startAbility data :
"
+
JSON
.
stringify
(
data
));
}).
catch
((
err
)
=>
{
console
.
log
(
TAG
+
"
startAbility err :
"
+
JSON
.
stringify
(
err
));
})
}
export
default
class
MainAbility
extends
Ability
{
async
onCreate
(
want
,
launchParam
)
{
console
.
log
(
'
MainAbility onCreate
'
)
...
...
@@ -34,11 +46,13 @@ export default class MainAbility extends Ability {
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
)
=>
{
abilityDelegator
.
executeShellCommand
(
cmd
,
async
(
err
,
data
)
=>
{
console
.
log
(
'
ACTS_AACommand_finish_01_0700 start err:
'
+
JSON
.
stringify
(
err
))
console
.
log
(
'
ACTS_AACommand_finish_01_0700 stdResult =
'
+
data
.
stdResult
)
globalThis
.
stdResult1
=
data
.
stdResult
;
console
.
log
(
'
ACTS_AACommand_finish_01_0700 - executeShellCommand: end
'
)
await
startAbilityTest
(
'
ACTS_AACommand_finish_01_0700
'
,
this
.
context
);
})
await
sleep
(
4000
)
...
...
@@ -55,12 +69,14 @@ export default class MainAbility extends Ability {
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
)
=>
{
abilityDelegator
.
executeShellCommand
(
cmd
,
async
(
err
,
data
)
=>
{
console
.
log
(
'
ACTS_AACommand_finish_01_0400 - executeShellCommand: start
'
)
console
.
log
(
'
ACTS_AACommand_finish_01_0400 start err:
'
+
JSON
.
stringify
(
err
))
console
.
log
(
'
ACTS_AACommand_finish_01_0400 stdResult =
'
+
data
.
stdResult
)
globalThis
.
stdResult11
=
data
.
stdResult
;
console
.
log
(
'
ACTS_AACommand_finish_01_0400 - executeShellCommand: end
'
)
await
startAbilityTest
(
'
ACTS_AACommand_finish_01_0400
'
,
this
.
context
);
})
await
sleep
(
4000
)
...
...
@@ -77,12 +93,14 @@ export default class MainAbility extends Ability {
cmd
=
'
aa test -m entry_test -b com.example.aacommandrelyhap -s
'
+
'
class ACTS_AACommand_01_3#ACTS_AACommand_finish_01_0100 -s unittest OpenHarmonyTestRunner
'
abilityDelegator
.
executeShellCommand
(
cmd
,
(
err
,
data
)
=>
{
abilityDelegator
.
executeShellCommand
(
cmd
,
async
(
err
,
data
)
=>
{
console
.
log
(
'
ACTS_AACommand_finish_01_0100 - executeShellCommand: start
'
)
console
.
log
(
'
ACTS_AACommand_finish_01_0100 start err:
'
+
JSON
.
stringify
(
err
))
console
.
log
(
'
ACTS_AACommand_finish_01_0100 stdResult =
'
+
data
.
stdResult
)
globalThis
.
stdResult13
=
data
.
stdResult
;
console
.
log
(
'
ACTS_AACommand_finish_01_0100 - executeShellCommand: end
'
)
await
startAbilityTest
(
'
ACTS_AACommand_finish_01_0100
'
,
this
.
context
);
})
await
sleep
(
4000
)
...
...
@@ -99,12 +117,14 @@ export default class MainAbility extends Ability {
cmd
=
'
aa test -m entry_test -b com.example.aacommandrelyhap -s class
'
+
'
ACTS_AACommand_01_3#ACTS_AACommand_finish_01_0500 -s unittest OpenHarmonyTestRunner
'
abilityDelegator
.
executeShellCommand
(
cmd
,
(
err
,
data
)
=>
{
abilityDelegator
.
executeShellCommand
(
cmd
,
async
(
err
,
data
)
=>
{
console
.
log
(
'
ACTS_AACommand_finish_01_0500 - executeShellCommand: start
'
)
console
.
log
(
'
ACTS_AACommand_finish_01_0500 start err:
'
+
JSON
.
stringify
(
err
))
console
.
log
(
'
ACTS_AACommand_finish_01_0500 stdResult =
'
+
data
.
stdResult
)
globalThis
.
stdResult15
=
data
.
stdResult
;
console
.
log
(
'
ACTS_AACommand_finish_01_0500 - executeShellCommand: end
'
)
await
startAbilityTest
(
'
ACTS_AACommand_finish_01_0500
'
,
this
.
context
);
})
await
sleep
(
4000
)
...
...
@@ -121,12 +141,14 @@ export default class MainAbility extends Ability {
cmd
=
'
aa test -m entry_test -b com.example.aacommandrelyhap -s
'
+
'
class ACTS_AACommand_01_3#ACTS_AACommand_finish_01_0600 -s unittest OpenHarmonyTestRunner
'
abilityDelegator
.
executeShellCommand
(
cmd
,
(
err
,
data
)
=>
{
abilityDelegator
.
executeShellCommand
(
cmd
,
async
(
err
,
data
)
=>
{
console
.
log
(
'
ACTS_AACommand_finish_01_0600 - executeShellCommand: start
'
)
console
.
log
(
'
ACTS_AACommand_finish_01_0600 start err:
'
+
JSON
.
stringify
(
err
))
console
.
log
(
'
ACTS_AACommand_finish_01_0600 stdResult =
'
+
data
.
stdResult
)
globalThis
.
stdResult17
=
data
.
stdResult
;
console
.
log
(
'
ACTS_AACommand_finish_01_0600 - executeShellCommand: end
'
)
await
startAbilityTest
(
'
ACTS_AACommand_finish_01_0600
'
,
this
.
context
);
})
await
sleep
(
4000
)
...
...
@@ -143,12 +165,14 @@ export default class MainAbility extends Ability {
cmd
=
'
aa test -m entry_test -b com.example.aacommandrelyhap -s
'
+
'
class ACTS_AACommand_01_3#ACTS_AACommand_finish_01_0900 -s unittest OpenHarmonyTestRunner
'
abilityDelegator
.
executeShellCommand
(
cmd
,
(
err
,
data
)
=>
{
abilityDelegator
.
executeShellCommand
(
cmd
,
async
(
err
,
data
)
=>
{
console
.
log
(
'
ACTS_AACommand_finish_01_0900 - executeShellCommand: start
'
)
console
.
log
(
'
ACTS_AACommand_finish_01_0900 start err:
'
+
JSON
.
stringify
(
err
))
console
.
log
(
'
ACTS_AACommand_finish_01_0900 stdResult =
'
+
data
.
stdResult
)
globalThis
.
stdResult19
=
data
.
stdResult
;
console
.
log
(
'
ACTS_AACommand_finish_01_0900 - executeShellCommand: end
'
)
await
startAbilityTest
(
'
ACTS_AACommand_finish_01_0900
'
,
this
.
context
);
})
await
sleep
(
4000
)
...
...
@@ -165,12 +189,14 @@ export default class MainAbility extends Ability {
cmd
=
'
aa test -m entry_test -b com.example.aacommandrelyhap
'
+
'
-s class ACTS_AACommand_01_3#ACTS_AACommand_finish_01_1300 -s unittest OpenHarmonyTestRunner
'
abilityDelegator
.
executeShellCommand
(
cmd
,
(
err
,
data
)
=>
{
abilityDelegator
.
executeShellCommand
(
cmd
,
async
(
err
,
data
)
=>
{
console
.
log
(
'
ACTS_AACommand_finish_01_1300 - executeShellCommand: start
'
)
console
.
log
(
'
ACTS_AACommand_finish_01_1300 start err:
'
+
JSON
.
stringify
(
err
))
console
.
log
(
'
ACTS_AACommand_finish_01_1300 stdResult =
'
+
data
.
stdResult
)
globalThis
.
stdResult23
=
data
.
stdResult
;
console
.
log
(
'
ACTS_AACommand_finish_01_1300 - executeShellCommand: end
'
)
await
startAbilityTest
(
'
ACTS_AACommand_finish_01_1300
'
,
this
.
context
);
})
await
sleep
(
4000
)
...
...
@@ -187,12 +213,14 @@ export default class MainAbility extends Ability {
cmd
=
'
aa test -m entry_test -b com.example.aacommandrelyhap
'
+
'
-s class ACTS_AACommand_01_3#ACTS_AACommand_finish_01_1400 -s unittest OpenHarmonyTestRunner
'
abilityDelegator
.
executeShellCommand
(
cmd
,
(
err
,
data
)
=>
{
abilityDelegator
.
executeShellCommand
(
cmd
,
async
(
err
,
data
)
=>
{
console
.
log
(
'
ACTS_AACommand_finish_01_1400 - executeShellCommand: start
'
)
console
.
log
(
'
ACTS_AACommand_finish_01_1400 start err:
'
+
JSON
.
stringify
(
err
))
console
.
log
(
'
ACTS_AACommand_finish_01_1400 stdResult =
'
+
data
.
stdResult
)
globalThis
.
stdResult25
=
data
.
stdResult
;
console
.
log
(
'
ACTS_AACommand_finish_01_1400 - executeShellCommand: end
'
)
await
startAbilityTest
(
'
ACTS_AACommand_finish_01_1400
'
,
this
.
context
);
})
await
sleep
(
4000
)
...
...
@@ -209,12 +237,14 @@ export default class MainAbility extends Ability {
cmd
=
'
aa test -m entry_test -b com.example.aacommandrelyhap
'
+
'
-s class ACTS_AACommand_01_3#ACTS_AACommand_finish_01_1500 -s unittest OpenHarmonyTestRunner
'
abilityDelegator
.
executeShellCommand
(
cmd
,
(
err
,
data
)
=>
{
abilityDelegator
.
executeShellCommand
(
cmd
,
async
(
err
,
data
)
=>
{
console
.
log
(
'
ACTS_AACommand_finish_01_1500 - executeShellCommand: start
'
)
console
.
log
(
'
ACTS_AACommand_finish_01_1500 start err:
'
+
JSON
.
stringify
(
err
))
console
.
log
(
'
ACTS_AACommand_finish_01_1500 stdResult =
'
+
data
.
stdResult
)
globalThis
.
stdResult27
=
data
.
stdResult
;
console
.
log
(
'
ACTS_AACommand_finish_01_1500 - executeShellCommand: end
'
)
await
startAbilityTest
(
'
ACTS_AACommand_finish_01_1500
'
,
this
.
context
);
})
await
sleep
(
4000
)
...
...
@@ -231,11 +261,13 @@ export default class MainAbility extends Ability {
cmd
=
'
aa test -m entry_test -b com.example.aacommandrelyhap
'
+
'
-s class ACTS_AACommand_01_3#ACTS_AACommand_finish_01_0300 -s unittest OpenHarmonyTestRunner
'
abilityDelegator
.
executeShellCommand
(
cmd
,
(
err
,
data
)
=>
{
abilityDelegator
.
executeShellCommand
(
cmd
,
async
(
err
,
data
)
=>
{
console
.
log
(
'
ACTS_AACommand_finish_01_0300 - executeShellCommand: start
'
)
console
.
log
(
'
ACTS_AACommand_finish_01_0300 start err:
'
+
JSON
.
stringify
(
err
))
console
.
log
(
'
ACTS_AACommand_finish_01_0300 stdResult =
'
+
data
.
stdResult
)
console
.
log
(
'
ACTS_AACommand_finish_01_0300 - executeShellCommand: end
'
)
await
startAbilityTest
(
'
ACTS_AACommand_finish_01_0300
'
,
this
.
context
);
})
await
sleep
(
3000
)
...
...
@@ -252,11 +284,13 @@ export default class MainAbility extends Ability {
cmd
=
'
aa test -m entry_test -b com.example.aacommandrelyhap
'
+
'
-s class ACTS_AACommand_01_3#ACTS_AACommand_finish_01_1600 -s unittest OpenHarmonyTestRunner
'
abilityDelegator
.
executeShellCommand
(
cmd
,
(
err
,
data
)
=>
{
abilityDelegator
.
executeShellCommand
(
cmd
,
async
(
err
,
data
)
=>
{
console
.
log
(
'
ACTS_AACommand_finish_01_1600 - executeShellCommand: start
'
)
console
.
log
(
'
ACTS_AACommand_finish_01_1600 start err:
'
+
JSON
.
stringify
(
err
))
console
.
log
(
'
ACTS_AACommand_finish_01_1600 stdResult =
'
+
data
.
stdResult
)
console
.
log
(
'
ACTS_AACommand_finish_01_1600 - executeShellCommand: end
'
)
await
startAbilityTest
(
'
ACTS_AACommand_finish_01_1600
'
,
this
.
context
);
})
await
sleep
(
3000
)
...
...
ability/ability_runtime/aacommand/AACommandtest/entry/src/main/ets/test/Ability.test.ets
浏览文件 @
c01b19c4
...
...
@@ -22,6 +22,24 @@ let finishmsg1: any
export default function abilityTest() {
describe('ACTS_AACommand_Test', function () {
afterEach(async (done) => {
console.log("ActsAACommandTest afterEach called");
let wantInfo = {
bundleName: "com.example.aacommandtest",
abilityName: "MainAbility"
}
await globalThis.abilityTestContext.startAbility(wantInfo).then((data) => {
console.log("ActsAACommandTest startAbility data : " + JSON.stringify(data));
}).catch((err) => {
console.log("ActsAACommandTest startAbility err : " + JSON.stringify(err));
})
setTimeout(function () {
console.log("ActsAACommandTest afterEach end");
done();
}, 1000);
})
/**
* @tc.number: ACTS_AACommand_0100
* @tc.name: -b, -s unittest, -p, -s class, -s level, -s size, -s testType, -s timeout,
...
...
ability/ability_runtime/aacommand/AACommandtest/entry/src/main/module.json
浏览文件 @
c01b19c4
...
...
@@ -21,6 +21,7 @@
"icon"
:
"$media:icon"
,
"label"
:
"$string:MainAbility_label"
,
"visible"
:
true
,
"launchType"
:
"singleton"
,
"skills"
:
[
{
"entities"
:
[
...
...
ability/ability_runtime/newwant/actsnewwanttest/entry/src/main/ets/MainAbility/MainAbility.ts
浏览文件 @
c01b19c4
...
...
@@ -14,6 +14,9 @@
*/
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
{
...
...
@@ -21,6 +24,15 @@ export default class MainAbility extends Ability {
// Ability is creating, initialize resources for this ability
console
.
log
(
"
MainAbility onCreate
"
)
globalThis
.
abilityWant
=
want
;
globalThis
.
abilityContext
=
this
.
context
console
.
info
(
"
start run testcase!!!!
"
)
var
abilityDelegator
:
any
abilityDelegator
=
AbilityDelegatorRegistry
.
getAbilityDelegator
()
var
abilityDelegatorArguments
:
any
abilityDelegatorArguments
=
AbilityDelegatorRegistry
.
getArguments
()
console
.
info
(
'
start run testcase!!!
'
)
Hypium
.
hypiumTest
(
abilityDelegator
,
abilityDelegatorArguments
,
testsuite
)
}
onDestroy
()
{
...
...
@@ -31,7 +43,7 @@ export default class MainAbility extends Ability {
onWindowStageCreate
(
windowStage
)
{
// Main window is created, set main page for this ability
console
.
log
(
"
MainAbility onWindowStageCreate
"
)
globalThis
.
abilityContext
=
this
.
context
windowStage
.
setUIContent
(
this
.
context
,
"
MainAbility/pages/index/index
"
,
null
)
}
...
...
ability/ability_runtime/newwant/actsnewwanttest/entry/src/main/ets/MainAbility/pages/index/index.ets
浏览文件 @
c01b19c4
...
...
@@ -14,23 +14,13 @@
*/
import router from '@ohos.router';
import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'
import { Hypium } from '@ohos/hypium'
import testsuite from '../../../test/List.test'
@Entry
@Component
struct Index {
aboutToAppear(){
console.info("start run testcase!!!!")
var abilityDelegator: any
abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator()
var abilityDelegatorArguments: any
abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments()
console.info('start run testcase!!!')
Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite)
aboutToAppear(){
}
build() {
...
...
ability/ability_runtime/newwant/actsnewwanttest/entry/src/main/ets/test/Ability.test.ets
浏览文件 @
c01b19c4
...
...
@@ -38,6 +38,24 @@ let flagNewWant = false;
export default function abilityTest() {
describe('ActsNewWantTest', function () {
afterEach(async (done) => {
console.log("ACTS_NewWant afterEach called");
let wantInfo = {
bundleName: "com.example.newwanttest",
abilityName: "com.example.newwanttest.MainAbility"
}
await globalThis.abilityTestContext.startAbility(wantInfo).then((data) => {
console.log("ACTS_NewWant startAbility data : " + JSON.stringify(data));
}).catch((err) => {
console.log("ACTS_NewWant startAbility err : " + JSON.stringify(err));
})
setTimeout(function () {
console.log("ACTS_NewWant afterEach end");
done();
}, 1000);
})
/**
* @tc.number: ACTS_NewWant_Test_0100
* @tc.name: Starting standard Ability for the first time does not trigger onNewWant.
...
...
ability/ability_runtime/newwant/actsnewwanttest/entry/src/main/module.json
浏览文件 @
c01b19c4
...
...
@@ -21,6 +21,7 @@
"label"
:
"$string:entry_label"
,
"visible"
:
true
,
"orientation"
:
"portrait"
,
"launchType"
:
"singleton"
,
"skills"
:
[
{
"actions"
:
[
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录