Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
76c05829
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看板
未验证
提交
76c05829
编写于
9月 23, 2022
作者:
O
openharmony_ci
提交者:
Gitee
9月 23, 2022
浏览文件
操作
浏览文件
下载
差异文件
!5631 定制子系统xts block问题修复
Merge pull request !5631 from 蔡明港/master
上级
9d71b998
ecd3626a
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
90 addition
and
32 deletion
+90
-32
customization/edm_xts_stage/Test.json
customization/edm_xts_stage/Test.json
+3
-2
customization/edm_xts_stage/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts
...ge/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts
+72
-0
customization/edm_xts_stage/entry/src/main/ets/pages/index/index.ets
...on/edm_xts_stage/entry/src/main/ets/pages/index/index.ets
+8
-22
customization/edm_xts_stage/entry/src/main/ets/test/edmCallback.test.ets
...dm_xts_stage/entry/src/main/ets/test/edmCallback.test.ets
+6
-7
customization/edm_xts_stage/entry/src/main/ets/test/edmPromise.test.ets
...edm_xts_stage/entry/src/main/ets/test/edmPromise.test.ets
+1
-1
未找到文件。
customization/edm_xts_stage/Test.json
浏览文件 @
76c05829
{
"description"
:
"Configuration for hjunit demo Tests"
,
"driver"
:
{
"type"
:
"JSUnitTest"
,
"type"
:
"
OH
JSUnitTest"
,
"test-timeout"
:
"180000"
,
"package"
:
"com.example.myapplication"
,
"bundle-name"
:
"com.example.myapplication"
,
"module-name"
:
"phone"
,
"shell-timeout"
:
"600000"
},
"kits"
:
[
...
...
customization/edm_xts_stage/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts
0 → 100644
浏览文件 @
76c05829
/*
* 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
'
])
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
()
var
MainAbilityName
=
abilityDelegatorArguments
.
bundleName
+
'
.MainAbility
'
let
lMonitor
=
{
abilityName
:
MainAbilityName
,
onAbilityCreate
:
onAbilityCreateCallback
,
};
abilityDelegator
.
addAbilityMonitor
(
lMonitor
,
addAbilityMonitorCallback
)
var
cmd
=
'
aa start -d 0 -a com.example.myapplication.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
customization/edm_xts_stage/entry/src/main/ets/pages/index/index.ets
浏览文件 @
76c05829
...
...
@@ -12,35 +12,21 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import file from '@system.file';
import {Core, ExpectExtend, InstrumentLog, ReportExtend} from "deccjsunit/index"
import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'
import { Hypium } from '@ohos/hypium'
import testsuite from "../../test/List.test.ets"
@Entry
@Component
struct Index {
aboutToAppear(){
console.info("start run testcase!!!!")
const core = Core.getInstance()
const expectExtend = new ExpectExtend({
'id': 'extend'
})
core.addService('expect', expectExtend)
const reportExtend = new ReportExtend(file)
core.addService('report', reportExtend)
core.init()
core.subscribeEvent('task', reportExtend)
const configService = core.getDefaultService('config')
console.info('parameters---->' + JSON.stringify(globalThis.abilityWant.parameters))
globalThis.abilityWant.parameters.timeout = 70000;
configService.setConfig(globalThis.abilityWant.parameters)
// testsuite(globalThis.abilityContext,globalThis.windowStage,globalThis.abilityStorage)
testsuite()
core.execute()
var abilityDelegator: any
abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator()
var abilityDelegatorArguments: any
abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments()
console.info('start run testcase!!!!')
Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite)
}
build() {
...
...
customization/edm_xts_stage/entry/src/main/ets/test/edmCallback.test.ets
浏览文件 @
76c05829
...
...
@@ -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
{
WANT1
,
ENTINFO1
,
SELFWANT
,
SELFHAPNAME
,
COMPANYNAME2
,
DESCRIPTION2
,
ENTINFO2
,
DEFAULT_USER_ID
,
TEST_USER_ID
,
ERR_USER_ID
...
...
@@ -283,12 +283,11 @@ export default function edmCallbackTest() {
let
dsmgr
=
await
enterpriseDeviceManager
.
getDeviceSettingsManager
();
expect
(
dsmgr
!==
null
)
.
assertTrue
();
console
.
log
(
'before setDateTime'
);
await
dsmgr
.
setDateTime
(
SELFWANT
,
1526003846000
,
(
error
,
data
)
=>
{
console
.
log
(
"setDateTime ===data: "
+
data
);
console
.
log
(
"setDateTime ===error: "
+
error
);
});
await
enterpriseDeviceManager
.
disableSuperAdmin
(
SELFHAPNAME
);
done
();
await
dsmgr
.
setDateTime
(
SELFWANT
,
1526003846000
,
OnReceiveEvent
);
async
function
OnReceiveEvent
()
{
await
enterpriseDeviceManager
.
disableSuperAdmin
(
SELFHAPNAME
);
done
();
}
})
})
}
customization/edm_xts_stage/entry/src/main/ets/test/edmPromise.test.ets
浏览文件 @
76c05829
...
...
@@ -12,7 +12,7 @@
* See the License for the specific language governing permissions and
* 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
{
WANT1
,
ENTINFO1
,
SELFWANT
,
SELFHAPNAME
,
COMPANYNAME2
,
DESCRIPTION2
,
ENTINFO2
,
DEFAULT_USER_ID
,
TEST_USER_ID
,
ERR_USER_ID
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录