Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
f68e5fce
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,发现更多精彩内容 >>
未验证
提交
f68e5fce
编写于
7月 28, 2022
作者:
O
openharmony_ci
提交者:
Gitee
7月 28, 2022
浏览文件
操作
浏览文件
下载
差异文件
!4686 Adapt to the new framework
Merge pull request !4686 from jiyong/local-20220728-0002
上级
d89989ef
9a07042b
变更
23
隐藏空白更改
内联
并排
Showing
23 changed file
with
365 addition
and
66 deletion
+365
-66
barrierfree/accessibilityconfig/Test.json
barrierfree/accessibilityconfig/Test.json
+6
-4
barrierfree/accessibilityconfig/entry/src/main/ets/MainAbility/MainAbility.ts
...ilityconfig/entry/src/main/ets/MainAbility/MainAbility.ts
+15
-1
barrierfree/accessibilityconfig/entry/src/main/ets/MainAbility/pages/index/index.ets
...nfig/entry/src/main/ets/MainAbility/pages/index/index.ets
+1
-20
barrierfree/accessibilityconfig/entry/src/main/ets/TestAbility/TestAbility.ts
...ilityconfig/entry/src/main/ets/TestAbility/TestAbility.ts
+53
-0
barrierfree/accessibilityconfig/entry/src/main/ets/TestAbility/pages/index.ets
...lityconfig/entry/src/main/ets/TestAbility/pages/index.ets
+48
-0
barrierfree/accessibilityconfig/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts
...ig/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts
+72
-0
barrierfree/accessibilityconfig/entry/src/main/ets/test/AccessibilityConfig.test.ets
...nfig/entry/src/main/ets/test/AccessibilityConfig.test.ets
+2
-2
barrierfree/accessibilityconfig/entry/src/main/ets/test/List.test.ets
...accessibilityconfig/entry/src/main/ets/test/List.test.ets
+2
-2
barrierfree/accessibilityconfig/entry/src/main/module.json
barrierfree/accessibilityconfig/entry/src/main/module.json
+2
-2
barrierfree/accessibilityconfig/entry/src/main/resources/base/profile/main_pages.json
...fig/entry/src/main/resources/base/profile/main_pages.json
+1
-1
bundlemanager/bundle_standard/bundlemanager/actsbmsstageetstest/Test.json
...ndle_standard/bundlemanager/actsbmsstageetstest/Test.json
+5
-3
bundlemanager/bundle_standard/bundlemanager/actsbmsstageetstest/entry/src/main/ets/MainAbility/MainAbility.ts
...tageetstest/entry/src/main/ets/MainAbility/MainAbility.ts
+1
-1
bundlemanager/bundle_standard/bundlemanager/actsbmsstageetstest/entry/src/main/ets/MainAbility/pages/index/index.ets
...test/entry/src/main/ets/MainAbility/pages/index/index.ets
+10
-19
bundlemanager/bundle_standard/bundlemanager/actsbmsstageetstest/entry/src/main/ets/MainAbility/pages/second/second.ets
...st/entry/src/main/ets/MainAbility/pages/second/second.ets
+0
-0
bundlemanager/bundle_standard/bundlemanager/actsbmsstageetstest/entry/src/main/ets/TestAbility/TestAbility.ts
...tageetstest/entry/src/main/ets/TestAbility/TestAbility.ts
+30
-0
bundlemanager/bundle_standard/bundlemanager/actsbmsstageetstest/entry/src/main/ets/TestAbility/pages/index.ets
...ageetstest/entry/src/main/ets/TestAbility/pages/index.ets
+48
-0
bundlemanager/bundle_standard/bundlemanager/actsbmsstageetstest/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts
...st/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts
+58
-0
bundlemanager/bundle_standard/bundlemanager/actsbmsstageetstest/entry/src/main/ets/test/GetProfileByAbility.test.ets
...test/entry/src/main/ets/test/GetProfileByAbility.test.ets
+2
-2
bundlemanager/bundle_standard/bundlemanager/actsbmsstageetstest/entry/src/main/ets/test/GetProfileByExtensionAbility.test.ets
...y/src/main/ets/test/GetProfileByExtensionAbility.test.ets
+2
-2
bundlemanager/bundle_standard/bundlemanager/actsbmsstageetstest/entry/src/main/ets/test/List.test.ets
...actsbmsstageetstest/entry/src/main/ets/test/List.test.ets
+1
-1
bundlemanager/bundle_standard/bundlemanager/actsbmsstageetstest/entry/src/main/resources/base/profile/form_config.json
...st/entry/src/main/resources/base/profile/form_config.json
+2
-2
bundlemanager/bundle_standard/bundlemanager/actsbmsstageetstest/entry/src/main/resources/base/profile/main_pages.json
...est/entry/src/main/resources/base/profile/main_pages.json
+2
-2
bundlemanager/bundle_standard/bundlemanager/actsbmsstageetstest/entry/src/main/resources/base/profile/shortcuts_config.json
...try/src/main/resources/base/profile/shortcuts_config.json
+2
-2
未找到文件。
barrierfree/accessibilityconfig/Test.json
浏览文件 @
f68e5fce
{
{
"description"
:
"Configuration for hjunit demo Tests"
,
"description"
:
"Configuration for hjunit demo Tests"
,
"driver"
:
{
"driver"
:
{
"type"
:
"JSUnitTest"
,
"type"
:
"OHJSUnitTest"
,
"test-timeout"
:
"180000"
,
"test-timeout"
:
"240000"
,
"package"
:
"com.example.accessibilityconfig"
,
"bundle-name"
:
"com.example.accessibilityconfig"
,
"shell-timeout"
:
"180000"
"module-name"
:
"phone"
,
"shell-timeout"
:
"600000"
,
"testcase-timeout"
:
70000
},
},
"kits"
:
[
"kits"
:
[
{
{
...
...
barrierfree/accessibilityconfig/entry/src/main/ets/MainAbility/MainAbility.ts
浏览文件 @
f68e5fce
/*
* 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
Ability
from
'
@ohos.application.Ability
'
export
default
class
MainAbility
extends
Ability
{
export
default
class
MainAbility
extends
Ability
{
...
@@ -18,7 +32,7 @@ export default class MainAbility extends Ability {
...
@@ -18,7 +32,7 @@ export default class MainAbility extends Ability {
//globalThis.windowStage = windowStage
//globalThis.windowStage = windowStage
//globalThis.abilityStorage = this.storage
//globalThis.abilityStorage = this.storage
globalThis
.
abilityContext
=
this
.
context
globalThis
.
abilityContext
=
this
.
context
windowStage
.
setUIContent
(
this
.
context
,
"
pages/index/index
"
,
null
)
windowStage
.
setUIContent
(
this
.
context
,
"
MainAbility/
pages/index/index
"
,
null
)
}
}
onWindowStageDestroy
()
{
onWindowStageDestroy
()
{
...
...
barrierfree/accessibilityconfig/entry/src/main/ets/pages/index/index.ets
→
barrierfree/accessibilityconfig/entry/src/main/ets/
MainAbility/
pages/index/index.ets
浏览文件 @
f68e5fce
...
@@ -12,10 +12,7 @@
...
@@ -12,10 +12,7 @@
* See the License for the specific language governing permissions and
* See the License for the specific language governing permissions and
* limitations under the License.
* limitations under the License.
*/
*/
import router from '@ohos.router';
import file from '@system.file';
import {Core, ExpectExtend, InstrumentLog, ReportExtend} from "deccjsunit/index"
import testsuite from "../../test/List.test"
@Entry
@Entry
@Component
@Component
...
@@ -24,22 +21,6 @@ struct Index {
...
@@ -24,22 +21,6 @@ struct Index {
aboutToAppear(){
aboutToAppear(){
console.info("start run testcase!!!!");
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);
core.execute();
}
}
build() {
build() {
...
...
barrierfree/accessibilityconfig/entry/src/main/ets/TestAbility/TestAbility.ts
0 → 100644
浏览文件 @
f68e5fce
/*
* 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
'
hypium/index
'
import
testsuite
from
'
../test/List.test
'
export
default
class
TestAbility
extends
Ability
{
onCreate
(
want
,
launchParam
)
{
console
.
log
(
'
TestAbility onCreate
'
)
var
abilityDelegator
:
any
abilityDelegator
=
AbilityDelegatorRegistry
.
getAbilityDelegator
()
var
abilityDelegatorArguments
:
any
abilityDelegatorArguments
=
AbilityDelegatorRegistry
.
getArguments
()
console
.
info
(
'
start run testcase!!!
'
)
Hypium
.
hypiumTest
(
abilityDelegator
,
abilityDelegatorArguments
,
testsuite
)
}
onDestroy
()
{
console
.
log
(
'
TestAbility onDestroy
'
)
}
onWindowStageCreate
(
windowStage
)
{
console
.
log
(
'
TestAbility onWindowStageCreate
'
)
windowStage
.
setUIContent
(
this
.
context
,
'
TestAbility/pages/index
'
,
null
)
globalThis
.
abilityContext
=
this
.
context
;
}
onWindowStageDestroy
()
{
console
.
log
(
'
TestAbility onWindowStageDestroy
'
)
}
onForeground
()
{
console
.
log
(
'
TestAbility onForeground
'
)
}
onBackground
()
{
console
.
log
(
'
TestAbility onBackground
'
)
}
};
\ No newline at end of file
barrierfree/accessibilityconfig/entry/src/main/ets/TestAbility/pages/index.ets
0 → 100644
浏览文件 @
f68e5fce
/*
* 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('TestAbility 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
barrierfree/accessibilityconfig/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts
0 → 100644
浏览文件 @
f68e5fce
/*
* 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
testAbilityName
=
abilityDelegatorArguments
.
bundleName
+
'
.TestAbility
'
let
lMonitor
=
{
abilityName
:
testAbilityName
,
onAbilityCreate
:
onAbilityCreateCallback
,
};
abilityDelegator
.
addAbilityMonitor
(
lMonitor
,
addAbilityMonitorCallback
)
var
cmd
=
'
aa start -d 0 -a TestAbility
'
+
'
-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
barrierfree/accessibilityconfig/entry/src/main/ets/test/AccessibilityConfig.test.ets
浏览文件 @
f68e5fce
...
@@ -12,10 +12,10 @@
...
@@ -12,10 +12,10 @@
* See the License for the specific language governing permissions and
* See the License for the specific language governing permissions and
* limitations under the License.
* limitations under the License.
*/
*/
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from
'deccjsunit/index'
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from
"@ohos/hypium"
import config from '@ohos.accessibility.config'
import config from '@ohos.accessibility.config'
export default function abilityTest(
abilityContext
) {
export default function abilityTest() {
describe('AccessibilityConfigTest', function () {
describe('AccessibilityConfigTest', function () {
beforeEach(async function (done) {
beforeEach(async function (done) {
...
...
barrierfree/accessibilityconfig/entry/src/main/ets/test/List.test.ets
浏览文件 @
f68e5fce
...
@@ -14,6 +14,6 @@
...
@@ -14,6 +14,6 @@
*/
*/
import abilityTest from './AccessibilityConfig.test.ets'
import abilityTest from './AccessibilityConfig.test.ets'
export default function testsuite(
abilityContext
) {
export default function testsuite() {
abilityTest(
abilityContext
)
abilityTest()
}
}
\ No newline at end of file
barrierfree/accessibilityconfig/entry/src/main/module.json
浏览文件 @
f68e5fce
...
@@ -13,8 +13,8 @@
...
@@ -13,8 +13,8 @@
"uiSyntax"
:
"ets"
,
"uiSyntax"
:
"ets"
,
"pages"
:
"$profile:main_pages"
,
"pages"
:
"$profile:main_pages"
,
"abilities"
:
[{
"abilities"
:
[{
"name"
:
"
com.example.accessibilityconfig.Main
Ability"
,
"name"
:
"
Test
Ability"
,
"srcEntrance"
:
"./ets/
MainAbility/Main
Ability.ts"
,
"srcEntrance"
:
"./ets/
TestAbility/Test
Ability.ts"
,
"description"
:
"$string:phone_entry_main"
,
"description"
:
"$string:phone_entry_main"
,
"icon"
:
"$media:icon"
,
"icon"
:
"$media:icon"
,
"label"
:
"$string:entry_label"
,
"label"
:
"$string:entry_label"
,
...
...
barrierfree/accessibilityconfig/entry/src/main/resources/base/profile/main_pages.json
浏览文件 @
f68e5fce
{
{
"src"
:
[
"src"
:
[
"
pages/index
/index"
"
TestAbility/pages
/index"
]
]
}
}
\ No newline at end of file
bundlemanager/bundle_standard/bundlemanager/actsbmsstageetstest/Test.json
浏览文件 @
f68e5fce
{
{
"description"
:
"Configuration for hjunit demo Tests"
,
"description"
:
"Configuration for hjunit demo Tests"
,
"driver"
:
{
"driver"
:
{
"type"
:
"JSUnitTest"
,
"type"
:
"
OH
JSUnitTest"
,
"test-timeout"
:
"180000"
,
"test-timeout"
:
"180000"
,
"package"
:
"ohos.acts.bundle.stage.test"
,
"bundle-name"
:
"ohos.acts.bundle.stage.test"
,
"shell-timeout"
:
"600000"
"module-name"
:
"phone"
,
"shell-timeout"
:
"600000"
,
"testcase-timeout"
:
70000
},
},
"kits"
:
[
"kits"
:
[
{
{
...
...
bundlemanager/bundle_standard/bundlemanager/actsbmsstageetstest/entry/src/main/ets/MainAbility/MainAbility.ts
浏览文件 @
f68e5fce
...
@@ -16,7 +16,7 @@ export default class MainAbility extends Ability {
...
@@ -16,7 +16,7 @@ export default class MainAbility extends Ability {
// Main window is created, set main page for this ability
// Main window is created, set main page for this ability
console
.
log
(
"
[Demo] MainAbility onWindowStageCreate
"
)
console
.
log
(
"
[Demo] MainAbility onWindowStageCreate
"
)
globalThis
.
abilityContext
=
this
.
context
globalThis
.
abilityContext
=
this
.
context
windowStage
.
setUIContent
(
this
.
context
,
"
pages/index/index
"
,
null
)
windowStage
.
setUIContent
(
this
.
context
,
"
MainAbility/
pages/index/index
"
,
null
)
}
}
onWindowStageDestroy
()
{
onWindowStageDestroy
()
{
...
...
bundlemanager/bundle_standard/bundlemanager/actsbmsstageetstest/entry/src/main/ets/pages/index/index.ets
→
bundlemanager/bundle_standard/bundlemanager/actsbmsstageetstest/entry/src/main/ets/
MainAbility/
pages/index/index.ets
浏览文件 @
f68e5fce
...
@@ -12,10 +12,11 @@
...
@@ -12,10 +12,11 @@
* See the License for the specific language governing permissions and
* See the License for the specific language governing permissions and
* limitations under the License.
* limitations under the License.
*/
*/
import
file from '@system.file
';
import
router from '@ohos.router
';
import {Core, ExpectExtend, InstrumentLog, ReportExtend} from "deccjsunit/index"
import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'
import testsuite from "../../test/List.test.ets"
import { Hypium } from '@ohos/hypium'
import testsuite from '../../../test/List.test'
@Entry
@Entry
...
@@ -24,22 +25,12 @@ struct Index {
...
@@ -24,22 +25,12 @@ struct Index {
aboutToAppear(){
aboutToAppear(){
console.info("start run testcase!!!!")
console.info("start run testcase!!!!")
const core = Core.getInstance()
var abilityDelegator: any
const expectExtend = new ExpectExtend({
abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator()
'id': 'extend'
var abilityDelegatorArguments: any
})
abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments()
core.addService('expect', expectExtend)
console.info('start run testcase!!!')
const reportExtend = new ReportExtend(file)
Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite)
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)
core.execute()
}
}
build() {
build() {
...
...
bundlemanager/bundle_standard/bundlemanager/actsbmsstageetstest/entry/src/main/ets/pages/second/second.ets
→
bundlemanager/bundle_standard/bundlemanager/actsbmsstageetstest/entry/src/main/ets/
MainAbility/
pages/second/second.ets
浏览文件 @
f68e5fce
文件已移动
bundlemanager/bundle_standard/bundlemanager/actsbmsstageetstest/entry/src/main/ets/TestAbility/TestAbility.ts
0 → 100644
浏览文件 @
f68e5fce
import
Ability
from
'
@ohos.application.Ability
'
export
default
class
TestAbility
extends
Ability
{
onCreate
(
want
,
launchParam
)
{
console
.
log
(
'
TestAbility onCreate
'
)
}
onDestroy
()
{
console
.
log
(
'
TestAbility onDestroy
'
)
}
onWindowStageCreate
(
windowStage
)
{
console
.
log
(
'
TestAbility onWindowStageCreate
'
)
windowStage
.
setUIContent
(
this
.
context
,
'
TestAbility/pages/index
'
,
null
)
globalThis
.
abilityContext
=
this
.
context
;
}
onWindowStageDestroy
()
{
console
.
log
(
'
TestAbility onWindowStageDestroy
'
)
}
onForeground
()
{
console
.
log
(
'
TestAbility onForeground
'
)
}
onBackground
()
{
console
.
log
(
'
TestAbility onBackground
'
)
}
};
\ No newline at end of file
bundlemanager/bundle_standard/bundlemanager/actsbmsstageetstest/entry/src/main/ets/TestAbility/pages/index.ets
0 → 100644
浏览文件 @
f68e5fce
/*
* 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('TestAbility 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
bundlemanager/bundle_standard/bundlemanager/actsbmsstageetstest/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts
0 → 100644
浏览文件 @
f68e5fce
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
testAbilityName
=
abilityDelegatorArguments
.
bundleName
+
'
.MainAbility
'
let
lMonitor
=
{
abilityName
:
testAbilityName
,
onAbilityCreate
:
onAbilityCreateCallback
,
};
abilityDelegator
.
addAbilityMonitor
(
lMonitor
,
addAbilityMonitorCallback
)
var
cmd
=
'
aa start -d 0 -a ohos.acts.bundle.stage.test.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
bundlemanager/bundle_standard/bundlemanager/actsbmsstageetstest/entry/src/main/ets/test/GetProfileByAbility.test.ets
浏览文件 @
f68e5fce
...
@@ -14,7 +14,7 @@
...
@@ -14,7 +14,7 @@
*/
*/
import bundle from '@ohos.bundle';
import bundle from '@ohos.bundle';
import {
describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "deccjsunit/index
"
import {
describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from "@ohos/hypium
"
const MODULE_NAME = "phone"
const MODULE_NAME = "phone"
const MODULE_NAME_TEST = "phone1"
const MODULE_NAME_TEST = "phone1"
...
@@ -26,7 +26,7 @@ const METADATA_NAME1 = "ohos.ability.form1"
...
@@ -26,7 +26,7 @@ const METADATA_NAME1 = "ohos.ability.form1"
const METADATA_NAME2 = "ohos.ability.form2"
const METADATA_NAME2 = "ohos.ability.form2"
const METADATA_NAME3 = "ohos.ability.form3"
const METADATA_NAME3 = "ohos.ability.form3"
const METADATA_NAME_TEST = "ohos.test.form"
const METADATA_NAME_TEST = "ohos.test.form"
const PROFILE_JSON_STRING = "{\"src\":[\"
pages/index/index\",\"
pages/second/second\"]}"
const PROFILE_JSON_STRING = "{\"src\":[\"
MainAbility/pages/index/index\",\"MainAbility/
pages/second/second\"]}"
export default function getProfileByAbility() {
export default function getProfileByAbility() {
describe('getProfileByAbility', function () {
describe('getProfileByAbility', function () {
...
...
bundlemanager/bundle_standard/bundlemanager/actsbmsstageetstest/entry/src/main/ets/test/GetProfileByExtensionAbility.test.ets
浏览文件 @
f68e5fce
...
@@ -14,7 +14,7 @@
...
@@ -14,7 +14,7 @@
*/
*/
import bundle from '@ohos.bundle';
import bundle from '@ohos.bundle';
import {
describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "deccjsunit/index
"
import {
describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from "@ohos/hypium
"
const MODULE_NAME = "phone"
const MODULE_NAME = "phone"
const MODULE_NAME_TEST = "phone1"
const MODULE_NAME_TEST = "phone1"
...
@@ -26,7 +26,7 @@ const METADATA_NAME1 = "ohos.extension.form1"
...
@@ -26,7 +26,7 @@ const METADATA_NAME1 = "ohos.extension.form1"
const METADATA_NAME2 = "ohos.extension.form2"
const METADATA_NAME2 = "ohos.extension.form2"
const METADATA_NAME3 = "ohos.extension.form3"
const METADATA_NAME3 = "ohos.extension.form3"
const METADATA_NAME_TEST = "ohos.test.form"
const METADATA_NAME_TEST = "ohos.test.form"
const PROFILE_JSON_STRING = "{\"src\":[\"
pages/index/index\",\"
pages/second/second\"]}"
const PROFILE_JSON_STRING = "{\"src\":[\"
MainAbility/pages/index/index\",\"MainAbility/
pages/second/second\"]}"
export default function getProfileByExtensionAbility() {
export default function getProfileByExtensionAbility() {
describe('getProfileByExtensionAbility', function () {
describe('getProfileByExtensionAbility', function () {
...
...
bundlemanager/bundle_standard/bundlemanager/actsbmsstageetstest/entry/src/main/ets/test/List.test.ets
浏览文件 @
f68e5fce
...
@@ -16,7 +16,7 @@
...
@@ -16,7 +16,7 @@
import getProfileByAbility from './GetProfileByAbility.test.ets';
import getProfileByAbility from './GetProfileByAbility.test.ets';
import getProfileByExtensionAbility from './GetProfileByExtensionAbility.test.ets';
import getProfileByExtensionAbility from './GetProfileByExtensionAbility.test.ets';
export default function testsuite(
context
) {
export default function testsuite() {
getProfileByAbility();
getProfileByAbility();
getProfileByExtensionAbility();
getProfileByExtensionAbility();
}
}
\ No newline at end of file
bundlemanager/bundle_standard/bundlemanager/actsbmsstageetstest/entry/src/main/resources/base/profile/form_config.json
浏览文件 @
f68e5fce
{
{
"src"
:
[
"src"
:
[
"pages/index/index"
,
"
MainAbility/
pages/index/index"
,
"pages/second/second"
"
MainAbility/
pages/second/second"
]
]
}
}
\ No newline at end of file
bundlemanager/bundle_standard/bundlemanager/actsbmsstageetstest/entry/src/main/resources/base/profile/main_pages.json
浏览文件 @
f68e5fce
{
{
"src"
:
[
"src"
:
[
"pages/index/index"
,
"
MainAbility/
pages/index/index"
,
"pages/second/second"
"
MainAbility/
pages/second/second"
]
]
}
}
\ No newline at end of file
bundlemanager/bundle_standard/bundlemanager/actsbmsstageetstest/entry/src/main/resources/base/profile/shortcuts_config.json
浏览文件 @
f68e5fce
{
{
"src"
:
[
"src"
:
[
"pages/index/index"
,
"
MainAbility/
pages/index/index"
,
"pages/second/second"
"
MainAbility/
pages/second/second"
]
]
}
}
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录