Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
232cbfd6
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看板
未验证
提交
232cbfd6
编写于
9月 06, 2022
作者:
O
openharmony_ci
提交者:
Gitee
9月 06, 2022
浏览文件
操作
浏览文件
下载
差异文件
!5356 XTS-master元能力代码上库-XTS_AACommandTest用例优化
Merge pull request !5356 from chengxingzhen/master
上级
1fc61227
f33ca160
变更
4
展开全部
隐藏空白更改
内联
并排
Showing
4 changed file
with
519 addition
and
560 deletion
+519
-560
ability/ability_runtime/aacommand/AACommandPrintSyncTest/entry/src/main/ets/MainAbility/MainAbility.ts
...intSyncTest/entry/src/main/ets/MainAbility/MainAbility.ts
+60
-1
ability/ability_runtime/aacommand/AACommandPrintSyncTest/entry/src/main/ets/pages/index.ets
...AACommandPrintSyncTest/entry/src/main/ets/pages/index.ets
+0
-74
ability/ability_runtime/aacommand/AACommandtest/entry/src/main/ets/MainAbility/MainAbility.ts
...Commandtest/entry/src/main/ets/MainAbility/MainAbility.ts
+459
-1
ability/ability_runtime/aacommand/AACommandtest/entry/src/main/ets/pages/index.ets
...acommand/AACommandtest/entry/src/main/ets/pages/index.ets
+0
-484
未找到文件。
ability/ability_runtime/aacommand/AACommandPrintSyncTest/entry/src/main/ets/MainAbility/MainAbility.ts
浏览文件 @
232cbfd6
...
...
@@ -14,11 +14,70 @@
*/
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
{
onCreate
(
want
,
launchParam
)
{
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.aacommandprintsync -m entry_test -s class
'
+
'
ACTS_AACommand_01_3#ACTS_AACommand_printSync_01_0100 -s unittest OpenHarmonyTestRunner
'
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
'
)
})
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
)
=>
{
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
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
)
=>
{
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
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
)
=>
{
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
'
)
})
setTimeout
(()
=>
{
Hypium
.
hypiumTest
(
abilityDelegator
,
abilityDelegatorArguments
,
testsuite
)
},
5000
)
}
onDestroy
()
{
...
...
ability/ability_runtime/aacommand/AACommandPrintSyncTest/entry/src/main/ets/pages/index.ets
浏览文件 @
232cbfd6
...
...
@@ -13,83 +13,9 @@
* 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 {
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() {
...
...
ability/ability_runtime/aacommand/AACommandtest/entry/src/main/ets/MainAbility/MainAbility.ts
浏览文件 @
232cbfd6
此差异已折叠。
点击以展开。
ability/ability_runtime/aacommand/AACommandtest/entry/src/main/ets/pages/index.ets
浏览文件 @
232cbfd6
此差异已折叠。
点击以展开。
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录