Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
J
jump_hm_warehouse
概览
Overview
Details
Activity
Cycle Analytics
版本库
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
问题
0
Issues
0
列表
Board
标记
里程碑
合并请求
0
Merge Requests
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
Snippets
成员
Members
Collapse sidebar
Close sidebar
活动
图像
聊天
创建新问题
作业
提交
Issue Boards
Open sidebar
毛勇泽
jump_hm_warehouse
Commits
8c8df1ea
Commit
8c8df1ea
authored
Jan 14, 2024
by
毛勇泽
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
重构
parent
7b02a1bb
隐藏空白字符变更
内嵌
并排
正在显示
115 个修改的文件
包含
129 行增加
和
1831 行删除
+129
-1831
build-profile.json5
build-profile.json5
+6
-45
build-profile.json5
common/build-profile.json5
+2
-9
hvigorfile.ts
common/hvigorfile.ts
+2
-1
index.ets
common/index.ets
+2
-3
oh-package.json5
common/oh-package.json5
+2
-2
module.json5
common/src/main/module.json5
+3
-6
color.json
common/src/main/resources/base/element/color.json
+0
-57
float.json
common/src/main/resources/base/element/float.json
+0
-117
string.json
common/src/main/resources/base/element/string.json
+3
-12
icon.png
common/src/main/resources/base/media/icon.png
+0
-0
string.json
common/src/main/resources/en_US/element/string.json
+3
-12
string.json
common/src/main/resources/zh_CN/element/string.json
+3
-12
Ability.test.ets
common/src/ohosTest/ets/test/Ability.test.ets
+0
-36
List.test.ets
common/src/ohosTest/ets/test/List.test.ets
+0
-6
TestAbility.ets
common/src/ohosTest/ets/testability/TestAbility.ets
+0
-49
Index.ets
common/src/ohosTest/ets/testability/pages/Index.ets
+0
-35
OpenHarmonyTestRunner.ts
common/src/ohosTest/ets/testrunner/OpenHarmonyTestRunner.ts
+0
-50
module.json5
common/src/ohosTest/module.json5
+0
-37
color.json
common/src/ohosTest/resources/base/element/color.json
+0
-9
string.json
common/src/ohosTest/resources/base/element/string.json
+0
-17
icon.png
common/src/ohosTest/resources/base/media/icon.png
+0
-0
test_pages.json
common/src/ohosTest/resources/base/profile/test_pages.json
+0
-5
oh-package.json5
entry/oh-package.json5
+1
-1
build-profile.json5
features/DirectConnect/build-profile.json5
+2
-9
hvigorfile.ts
features/DirectConnect/hvigorfile.ts
+2
-1
index.ets
features/DirectConnect/index.ets
+1
-1
oh-package.json5
features/DirectConnect/oh-package.json5
+2
-3
DirectConnect.ets
features/DirectConnect/src/main/ets/components/DirectConnect.ets
+0
-1
Index.ets
features/DirectConnect/src/main/ets/pages/Index.ets
+0
-18
module.json5
features/DirectConnect/src/main/module.json5
+3
-6
color.json
features/DirectConnect/src/main/resources/base/element/color.json
+0
-9
string.json
features/DirectConnect/src/main/resources/base/element/string.json
+3
-12
icon.png
features/DirectConnect/src/main/resources/base/media/icon.png
+0
-0
main_pages.json
features/DirectConnect/src/main/resources/base/profile/main_pages.json
+0
-5
string.json
features/DirectConnect/src/main/resources/en_US/element/string.json
+3
-12
string.json
features/DirectConnect/src/main/resources/zh_CN/element/string.json
+3
-12
Ability.test.ets
features/DirectConnect/src/ohosTest/ets/test/Ability.test.ets
+0
-36
List.test.ets
features/DirectConnect/src/ohosTest/ets/test/List.test.ets
+0
-6
TestAbility.ets
features/DirectConnect/src/ohosTest/ets/testability/TestAbility.ets
+0
-49
Index.ets
features/DirectConnect/src/ohosTest/ets/testability/pages/Index.ets
+0
-35
OpenHarmonyTestRunner.ts
features/DirectConnect/src/ohosTest/ets/testrunner/OpenHarmonyTestRunner.ts
+0
-50
module.json5
features/DirectConnect/src/ohosTest/module.json5
+0
-37
color.json
features/DirectConnect/src/ohosTest/resources/base/element/color.json
+0
-9
string.json
features/DirectConnect/src/ohosTest/resources/base/element/string.json
+0
-17
icon.png
features/DirectConnect/src/ohosTest/resources/base/media/icon.png
+0
-0
test_pages.json
features/DirectConnect/src/ohosTest/resources/base/profile/test_pages.json
+0
-5
build-profile.json5
features/MaterialManagement/build-profile.json5
+2
-9
hvigorfile.ts
features/MaterialManagement/hvigorfile.ts
+2
-1
index.ets
features/MaterialManagement/index.ets
+1
-1
oh-package.json5
features/MaterialManagement/oh-package.json5
+2
-3
MaterialManagement.ets
features/MaterialManagement/src/main/ets/components/MaterialManagement.ets
+26
-0
Index.ets
features/MaterialManagement/src/main/ets/pages/Index.ets
+0
-18
MaterialManagement.ets
features/MaterialManagement/src/main/ets/pages/MaterialManagement.ets
+0
-17
module.json5
features/MaterialManagement/src/main/module.json5
+3
-6
color.json
features/MaterialManagement/src/main/resources/base/element/color.json
+0
-9
string.json
features/MaterialManagement/src/main/resources/base/element/string.json
+3
-12
ic_back.png
features/MaterialManagement/src/main/resources/base/media/ic_back.png
+0
-0
icon.png
features/MaterialManagement/src/main/resources/base/media/icon.png
+0
-0
main_pages.json
features/MaterialManagement/src/main/resources/base/profile/main_pages.json
+0
-5
string.json
features/MaterialManagement/src/main/resources/en_US/element/string.json
+3
-12
string.json
features/MaterialManagement/src/main/resources/zh_CN/element/string.json
+3
-12
Ability.test.ets
features/MaterialManagement/src/ohosTest/ets/test/Ability.test.ets
+0
-36
List.test.ets
features/MaterialManagement/src/ohosTest/ets/test/List.test.ets
+0
-6
TestAbility.ets
features/MaterialManagement/src/ohosTest/ets/testability/TestAbility.ets
+0
-49
Index.ets
features/MaterialManagement/src/ohosTest/ets/testability/pages/Index.ets
+0
-35
OpenHarmonyTestRunner.ts
features/MaterialManagement/src/ohosTest/ets/testrunner/OpenHarmonyTestRunner.ts
+0
-50
module.json5
features/MaterialManagement/src/ohosTest/module.json5
+0
-37
color.json
features/MaterialManagement/src/ohosTest/resources/base/element/color.json
+0
-9
string.json
features/MaterialManagement/src/ohosTest/resources/base/element/string.json
+0
-17
icon.png
features/MaterialManagement/src/ohosTest/resources/base/media/icon.png
+0
-0
test_pages.json
features/MaterialManagement/src/ohosTest/resources/base/profile/test_pages.json
+0
-5
build-profile.json5
features/PageManagement/build-profile.json5
+2
-9
hvigorfile.ts
features/PageManagement/hvigorfile.ts
+2
-1
index.ets
features/PageManagement/index.ets
+1
-1
oh-package.json5
features/PageManagement/oh-package.json5
+2
-3
PageManagement.ets
features/PageManagement/src/main/ets/components/PageManagement.ets
+0
-0
module.json5
features/PageManagement/src/main/module.json5
+3
-6
color.json
features/PageManagement/src/main/resources/base/element/color.json
+0
-9
string.json
features/PageManagement/src/main/resources/base/element/string.json
+3
-12
icon.png
features/PageManagement/src/main/resources/base/media/icon.png
+0
-0
main_pages.json
features/PageManagement/src/main/resources/base/profile/main_pages.json
+0
-5
string.json
features/PageManagement/src/main/resources/en_US/element/string.json
+3
-12
string.json
features/PageManagement/src/main/resources/zh_CN/element/string.json
+3
-12
Ability.test.ets
features/PageManagement/src/ohosTest/ets/test/Ability.test.ets
+0
-36
List.test.ets
features/PageManagement/src/ohosTest/ets/test/List.test.ets
+0
-6
TestAbility.ets
features/PageManagement/src/ohosTest/ets/testability/TestAbility.ets
+0
-49
Index.ets
features/PageManagement/src/ohosTest/ets/testability/pages/Index.ets
+0
-35
OpenHarmonyTestRunner.ts
features/PageManagement/src/ohosTest/ets/testrunner/OpenHarmonyTestRunner.ts
+0
-50
module.json5
features/PageManagement/src/ohosTest/module.json5
+0
-37
color.json
features/PageManagement/src/ohosTest/resources/base/element/color.json
+0
-9
string.json
features/PageManagement/src/ohosTest/resources/base/element/string.json
+0
-17
icon.png
features/PageManagement/src/ohosTest/resources/base/media/icon.png
+0
-0
test_pages.json
features/PageManagement/src/ohosTest/resources/base/profile/test_pages.json
+0
-5
build-profile.json5
features/SystemMaintenance/build-profile.json5
+2
-9
hvigorfile.ts
features/SystemMaintenance/hvigorfile.ts
+2
-1
index.ets
features/SystemMaintenance/index.ets
+1
-1
oh-package.json5
features/SystemMaintenance/oh-package.json5
+2
-3
SystemMaintenance.ets
features/SystemMaintenance/src/main/ets/components/SystemMaintenance.ets
+0
-0
module.json5
features/SystemMaintenance/src/main/module.json5
+3
-6
color.json
features/SystemMaintenance/src/main/resources/base/element/color.json
+0
-9
string.json
features/SystemMaintenance/src/main/resources/base/element/string.json
+3
-12
icon.png
features/SystemMaintenance/src/main/resources/base/media/icon.png
+0
-0
main_pages.json
features/SystemMaintenance/src/main/resources/base/profile/main_pages.json
+0
-5
string.json
features/SystemMaintenance/src/main/resources/en_US/element/string.json
+3
-12
string.json
features/SystemMaintenance/src/main/resources/zh_CN/element/string.json
+3
-12
Ability.test.ets
features/SystemMaintenance/src/ohosTest/ets/test/Ability.test.ets
+0
-36
List.test.ets
features/SystemMaintenance/src/ohosTest/ets/test/List.test.ets
+0
-6
TestAbility.ets
features/SystemMaintenance/src/ohosTest/ets/testability/TestAbility.ets
+0
-49
Index.ets
features/SystemMaintenance/src/ohosTest/ets/testability/pages/Index.ets
+0
-35
OpenHarmonyTestRunner.ts
features/SystemMaintenance/src/ohosTest/ets/testrunner/OpenHarmonyTestRunner.ts
+0
-50
module.json5
features/SystemMaintenance/src/ohosTest/module.json5
+0
-37
color.json
features/SystemMaintenance/src/ohosTest/resources/base/element/color.json
+0
-9
string.json
features/SystemMaintenance/src/ohosTest/resources/base/element/string.json
+0
-17
icon.png
features/SystemMaintenance/src/ohosTest/resources/base/media/icon.png
+0
-0
test_pages.json
features/SystemMaintenance/src/ohosTest/resources/base/profile/test_pages.json
+0
-5
没有找到文件。
build-profile.json5
View file @
8c8df1ea
...
@@ -25,63 +25,23 @@
...
@@ -25,63 +25,23 @@
},
},
{
{
"name": "common",
"name": "common",
"srcPath": "./common",
"srcPath": "./common"
"targets": [
{
"name": "default",
"applyToProducts": [
"default"
]
}
]
},
},
{
{
"name": "DirectConnect",
"name": "DirectConnect",
"srcPath": "./features/DirectConnect",
"srcPath": "./features/DirectConnect"
"targets": [
{
"name": "default",
"applyToProducts": [
"default"
]
}
]
},
},
{
{
"name": "MaterialManagement",
"name": "MaterialManagement",
"srcPath": "./features/MaterialManagement",
"srcPath": "./features/MaterialManagement"
"targets": [
{
"name": "default",
"applyToProducts": [
"default"
]
}
]
},
},
{
{
"name": "PageManagement",
"name": "PageManagement",
"srcPath": "./features/PageManagement",
"srcPath": "./features/PageManagement"
"targets": [
{
"name": "default",
"applyToProducts": [
"default"
]
}
]
},
},
{
{
"name": "SystemMaintenance",
"name": "SystemMaintenance",
"srcPath": "./features/SystemMaintenance",
"srcPath": "./features/SystemMaintenance"
"targets": [
{
"name": "default",
"applyToProducts": [
"default"
]
}
]
}
}
]
]
}
}
\ No newline at end of file
common/build-profile.json5
View file @
8c8df1ea
{
{
"apiType":
'stageMode'
,
"apiType":
"stageMode"
,
"buildOption": {
"buildOption": {
},
},
"entryModules": [
"entry"
],
"targets": [
"targets": [
{
{
"name": "default",
"name": "default",
"runtimeOS": "HarmonyOS"
"runtimeOS": "HarmonyOS"
},
{
"name": "ohosTest",
}
}
]
]
}
}
\ No newline at end of file
common/hvigorfile.ts
View file @
8c8df1ea
// Script for compiling build behavior. It is built in the build plug-in and cannot be modified currently.
// Script for compiling build behavior. It is built in the build plug-in and cannot be modified currently.
export
{
ha
p
Tasks
}
from
'@ohos/hvigor-ohos-plugin'
;
export
{
ha
r
Tasks
}
from
'@ohos/hvigor-ohos-plugin'
;
\ No newline at end of file
common/index.ets
View file @
8c8df1ea
export { BreakpointSystem, BreakPointType } from './src/main/ets/utils/BreakpointSystem';
export { BreakpointSystem, BreakPointType } from './src/main/ets/utils/BreakpointSystem';
export { Logger } from './src/main/ets/utils/Logger';
export { BreakpointConstants } from './src/main/ets/constants/BreakpointConstants';
export { BreakpointConstants } from './src/main/ets/constants/BreakpointConstants';
export { GridConstants } from './src/main/ets/constants/GridConstants';
export { GridConstants } from './src/main/ets/constants/GridConstants';
export { StyleConstants } from './src/main/ets/constants/StyleConstants';
export { StyleConstants } from './src/main/ets/constants/StyleConstants';
export { CommonDataSource } from './src/main/ets/utils/CommonDataSource';
export { CommonDataSource } from './src/main/ets/utils/CommonDataSource';
\ No newline at end of file
export { Logger } from './src/main/ets/utils/Logger';
common/oh-package.json5
View file @
8c8df1ea
...
@@ -3,8 +3,8 @@
...
@@ -3,8 +3,8 @@
"version": "1.0.0",
"version": "1.0.0",
"description": "Please describe the basic information.",
"description": "Please describe the basic information.",
"main": "index.ets",
"main": "index.ets",
"name": "@ohos/common",
"author": "",
"author": "",
"license": "",
"license": "
Apache-2.0
",
"dependencies": {}
"dependencies": {}
}
}
common/src/main/module.json5
View file @
8c8df1ea
{
{
"module": {
"module": {
"name": "common",
"name": "common",
"type": "feature",
"type": "har",
"description": "$string:module_desc",
"mainElement": "common",
"deviceTypes": [
"deviceTypes": [
"
phone
",
"
default
",
"tablet"
"tablet"
]
]
}
}
}
}
\ No newline at end of file
common/src/main/resources/base/element/color.json
deleted
100644 → 0
View file @
7b02a1bb
{
"color"
:
[
{
"name"
:
"start_window_background"
,
"value"
:
"#FFFFFF"
},
{
"name"
:
"page_background"
,
"value"
:
"#f1f3f5"
},
{
"name"
:
"focus_color"
,
"value"
:
"#e92f4f"
},
{
"name"
:
"three_alpha_black"
,
"value"
:
"#08000000"
},
{
"name"
:
"five_alpha_black"
,
"value"
:
"#0d000000"
},
{
"name"
:
"ten_alpha_black"
,
"value"
:
"#1A000000"
},
{
"name"
:
"twenty_alpha_black"
,
"value"
:
"#33000000"
},
{
"name"
:
"forty_alpha_black"
,
"value"
:
"#66000000"
},
{
"name"
:
"sixty_alpha_black"
,
"value"
:
"#99000000"
},
{
"name"
:
"eighty_alpha_black"
,
"value"
:
"#cc000000"
},
{
"name"
:
"zero_alpha_black"
,
"value"
:
"#00000000"
},
{
"name"
:
"sixty_alpha_white"
,
"value"
:
"#99FFFFFF"
},
{
"name"
:
"eighty_alpha_white"
,
"value"
:
"#CCFFFFFF"
}
]
}
\ No newline at end of file
common/src/main/resources/base/element/float.json
deleted
100644 → 0
View file @
7b02a1bb
{
"float"
:
[
{
"name"
:
"micro_font_size"
,
"value"
:
"10fp"
},
{
"name"
:
"smaller_font_size"
,
"value"
:
"12fp"
},
{
"name"
:
"small_font_size"
,
"value"
:
"14fp"
},
{
"name"
:
"middle_font_size"
,
"value"
:
"16fp"
},
{
"name"
:
"big_font_size"
,
"value"
:
"18fp"
},
{
"name"
:
"bigger_font_size"
,
"value"
:
"20fp"
},
{
"name"
:
"huge_font_size"
,
"value"
:
"24fp"
},
{
"name"
:
"vp_one"
,
"value"
:
"1vp"
},
{
"name"
:
"vp_two"
,
"value"
:
"2vp"
},
{
"name"
:
"vp_four"
,
"value"
:
"4vp"
},
{
"name"
:
"vp_six"
,
"value"
:
"6vp"
},
{
"name"
:
"vp_eight"
,
"value"
:
"8vp"
},
{
"name"
:
"vp_ten"
,
"value"
:
"10vp"
},
{
"name"
:
"vp_twelve"
,
"value"
:
"12vp"
},
{
"name"
:
"vp_fourteen"
,
"value"
:
"14vp"
},
{
"name"
:
"vp_sixteen"
,
"value"
:
"16vp"
},
{
"name"
:
"vp_eighteen"
,
"value"
:
"18vp"
},
{
"name"
:
"vp_twenty"
,
"value"
:
"20vp"
},
{
"name"
:
"vp_twenty_four"
,
"value"
:
"24vp"
},
{
"name"
:
"vp_fifty_six"
,
"value"
:
"56vp"
},
{
"name"
:
"commodity_item_height"
,
"value"
:
"263vp"
},
{
"name"
:
"commodity_list_margin"
,
"value"
:
"-6vp"
},
{
"name"
:
"commodity_desc_height"
,
"value"
:
"20vp"
},
{
"name"
:
"commodity_item_image_size"
,
"value"
:
"132vp"
},
{
"name"
:
"count_text_width"
,
"value"
:
"32vp"
},
{
"name"
:
"count_width"
,
"value"
:
"78vp"
},
{
"name"
:
"empty_image_size"
,
"value"
:
"60vp"
},
{
"name"
:
"capsule_height"
,
"value"
:
"40vp"
}
]
}
\ No newline at end of file
common/src/main/resources/base/element/string.json
View file @
8c8df1ea
{
{
"string"
:
[
"string"
:
[
{
{
"name"
:
"module_desc"
,
"name"
:
"page_show"
,
"value"
:
"module description"
"value"
:
"page from npm package"
},
{
"name"
:
"common_desc"
,
"value"
:
"description"
},
{
"name"
:
"common_label"
,
"value"
:
"label"
}
}
]
]
}
}
\ No newline at end of file
common/src/main/resources/base/media/icon.png
deleted
100644 → 0
View file @
7b02a1bb
6.63 KB
common/src/main/resources/en_US/element/string.json
View file @
8c8df1ea
{
{
"string"
:
[
"string"
:
[
{
{
"name"
:
"module_desc"
,
"name"
:
"page_show"
,
"value"
:
"module description"
"value"
:
"page from npm package"
},
{
"name"
:
"common_desc"
,
"value"
:
"description"
},
{
"name"
:
"common_label"
,
"value"
:
"label"
}
}
]
]
}
}
\ No newline at end of file
common/src/main/resources/zh_CN/element/string.json
View file @
8c8df1ea
{
{
"string"
:
[
"string"
:
[
{
{
"name"
:
"module_desc"
,
"name"
:
"page_show"
,
"value"
:
"模块描述"
"value"
:
"page from npm package"
},
{
"name"
:
"common_desc"
,
"value"
:
"description"
},
{
"name"
:
"common_label"
,
"value"
:
"label"
}
}
]
]
}
}
\ No newline at end of file
common/src/ohosTest/ets/test/Ability.test.ets
deleted
100644 → 0
View file @
7b02a1bb
import hilog from '@ohos.hilog';
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'
export default function abilityTest() {
describe('ActsAbilityTest', function () {
// Defines a test suite. Two parameters are supported: test suite name and test suite function.
beforeAll(function () {
// Presets an action, which is performed only once before all test cases of the test suite start.
// This API supports only one parameter: preset action function.
})
beforeEach(function () {
// Presets an action, which is performed before each unit test case starts.
// The number of execution times is the same as the number of test cases defined by **it**.
// This API supports only one parameter: preset action function.
})
afterEach(function () {
// Presets a clear action, which is performed after each unit test case ends.
// The number of execution times is the same as the number of test cases defined by **it**.
// This API supports only one parameter: clear action function.
})
afterAll(function () {
// Presets a clear action, which is performed after all test cases of the test suite end.
// This API supports only one parameter: clear action function.
})
it('assertContain',0, function () {
// Defines a test case. This API supports three parameters: test case name, filter parameter, and test case function.
hilog.info(0x0000, 'testTag', '%{public}s', 'it begin');
let a = 'abc'
let b = 'b'
// Defines a variety of assertion methods, which are used to declare expected boolean conditions.
expect(a).assertContain(b)
expect(a).assertEqual(a)
})
})
}
\ No newline at end of file
common/src/ohosTest/ets/test/List.test.ets
deleted
100644 → 0
View file @
7b02a1bb
import abilityTest from './Ability.test'
export default function testsuite() {
abilityTest()
}
\ No newline at end of file
common/src/ohosTest/ets/testability/TestAbility.ets
deleted
100644 → 0
View file @
7b02a1bb
import UIAbility from '@ohos.app.ability.UIAbility';
import AbilityDelegatorRegistry from '@ohos.app.ability.abilityDelegatorRegistry';
import hilog from '@ohos.hilog';
import { Hypium } from '@ohos/hypium';
import testsuite from '../test/List.test';
import window from '@ohos.window';
export default class TestAbility extends UIAbility {
onCreate(want, launchParam) {
hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onCreate');
hilog.info(0x0000, 'testTag', '%{public}s', 'want param:' + JSON.stringify(want) ?? '');
hilog.info(0x0000, 'testTag', '%{public}s', 'launchParam:'+ JSON.stringify(launchParam) ?? '');
var abilityDelegator: any
abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator()
var abilityDelegatorArguments: any
abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments()
hilog.info(0x0000, 'testTag', '%{public}s', 'start run testcase!!!');
Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite)
}
onDestroy() {
hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onDestroy');
}
onWindowStageCreate(windowStage: window.WindowStage) {
hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onWindowStageCreate');
windowStage.loadContent('testability/pages/Index', (err, data) => {
if (err.code) {
hilog.error(0x0000, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err) ?? '');
return;
}
hilog.info(0x0000, 'testTag', 'Succeeded in loading the content. Data: %{public}s',
JSON.stringify(data) ?? '');
});
}
onWindowStageDestroy() {
hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onWindowStageDestroy');
}
onForeground() {
hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onForeground');
}
onBackground() {
hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onBackground');
}
}
\ No newline at end of file
common/src/ohosTest/ets/testability/pages/Index.ets
deleted
100644 → 0
View file @
7b02a1bb
import hilog from '@ohos.hilog';
@Entry
@Component
struct Index {
aboutToAppear() {
hilog.info(0x0000, 'testTag', '%{public}s', '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
common/src/ohosTest/ets/testrunner/OpenHarmonyTestRunner.ts
deleted
100644 → 0
View file @
7b02a1bb
import
hilog
from
'@ohos.hilog'
;
import
TestRunner
from
'@ohos.application.testRunner'
;
import
AbilityDelegatorRegistry
from
'@ohos.app.ability.abilityDelegatorRegistry'
;
var
abilityDelegator
=
undefined
var
abilityDelegatorArguments
=
undefined
async
function
onAbilityCreateCallback
()
{
hilog
.
info
(
0x0000
,
'testTag'
,
'%{public}s'
,
'onAbilityCreateCallback'
);
}
async
function
addAbilityMonitorCallback
(
err
:
any
)
{
hilog
.
info
(
0x0000
,
'testTag'
,
'addAbilityMonitorCallback : %{public}s'
,
JSON
.
stringify
(
err
)
??
''
);
}
export
default
class
OpenHarmonyTestRunner
implements
TestRunner
{
constructor
()
{
}
onPrepare
()
{
hilog
.
info
(
0x0000
,
'testTag'
,
'%{public}s'
,
'OpenHarmonyTestRunner OnPrepare '
);
}
async
onRun
()
{
hilog
.
info
(
0x0000
,
'testTag'
,
'%{public}s'
,
'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
var
debug
=
abilityDelegatorArguments
.
parameters
[
'-D'
]
if
(
debug
==
'true'
)
{
cmd
+=
' -D'
}
hilog
.
info
(
0x0000
,
'testTag'
,
'cmd : %{public}s'
,
cmd
);
abilityDelegator
.
executeShellCommand
(
cmd
,
(
err
:
any
,
d
:
any
)
=>
{
hilog
.
info
(
0x0000
,
'testTag'
,
'executeShellCommand : err : %{public}s'
,
JSON
.
stringify
(
err
)
??
''
);
hilog
.
info
(
0x0000
,
'testTag'
,
'executeShellCommand : data : %{public}s'
,
d
.
stdResult
??
''
);
hilog
.
info
(
0x0000
,
'testTag'
,
'executeShellCommand : data : %{public}s'
,
d
.
exitCode
??
''
);
})
hilog
.
info
(
0x0000
,
'testTag'
,
'%{public}s'
,
'OpenHarmonyTestRunner onRun end'
);
}
}
\ No newline at end of file
common/src/ohosTest/module.json5
deleted
100644 → 0
View file @
7b02a1bb
{
"module": {
"name": "common_test",
"type": "feature",
"description": "$string:module_test_desc",
"mainElement": "TestAbility",
"deviceTypes": [
"phone",
"tablet"
],
"deliveryWithInstall": true,
"installationFree": false,
"pages": "$profile:test_pages",
"abilities": [
{
"name": "TestAbility",
"srcEntry": "./ets/testability/TestAbility.ets",
"description": "$string:TestAbility_desc",
"icon": "$media:icon",
"label": "$string:TestAbility_label",
"exported": true,
"startWindowIcon": "$media:icon",
"startWindowBackground": "$color:start_window_background",
"skills": [
{
"actions": [
"action.system.home"
],
"entities": [
"entity.system.home"
]
}
]
}
]
}
}
common/src/ohosTest/resources/base/element/color.json
deleted
100644 → 0
View file @
7b02a1bb
{
"color"
:
[
{
"name"
:
"start_window_background"
,
"value"
:
"#FFFFFF"
}
]
}
\ No newline at end of file
common/src/ohosTest/resources/base/element/string.json
deleted
100644 → 0
View file @
7b02a1bb
{
"string"
:
[
{
"name"
:
"module_test_desc"
,
"value"
:
"test ability description"
},
{
"name"
:
"TestAbility_desc"
,
"value"
:
"the test ability"
},
{
"name"
:
"TestAbility_label"
,
"value"
:
"test label"
}
]
}
\ No newline at end of file
common/src/ohosTest/resources/base/media/icon.png
deleted
100644 → 0
View file @
7b02a1bb
6.63 KB
common/src/ohosTest/resources/base/profile/test_pages.json
deleted
100644 → 0
View file @
7b02a1bb
{
"src"
:
[
"testability/pages/Index"
]
}
entry/oh-package.json5
View file @
8c8df1ea
...
@@ -8,9 +8,9 @@
...
@@ -8,9 +8,9 @@
"author": "",
"author": "",
"license": "entry",
"license": "entry",
"dependencies": {
"dependencies": {
"@ohos/common": "file:../common",
"@ohos/direct": "file:../features/DirectConnect",
"@ohos/direct": "file:../features/DirectConnect",
"@ohos/material": "file:../features/MaterialManagement",
"@ohos/material": "file:../features/MaterialManagement",
"@ohos/common": "file:../common",
"@ohos/pagemanagement": "file:../features/PageManagement",
"@ohos/pagemanagement": "file:../features/PageManagement",
"@ohos/system": "file:../features/SystemMaintenance"
"@ohos/system": "file:../features/SystemMaintenance"
}
}
...
...
features/DirectConnect/build-profile.json5
View file @
8c8df1ea
{
{
"apiType":
'stageMode'
,
"apiType":
"stageMode"
,
"buildOption": {
"buildOption": {
},
},
"entryModules": [
"entry"
],
"targets": [
"targets": [
{
{
"name": "default",
"name": "default",
"runtimeOS": "HarmonyOS"
"runtimeOS": "HarmonyOS"
},
{
"name": "ohosTest",
}
}
]
]
}
}
\ No newline at end of file
features/DirectConnect/hvigorfile.ts
View file @
8c8df1ea
// Script for compiling build behavior. It is built in the build plug-in and cannot be modified currently.
// Script for compiling build behavior. It is built in the build plug-in and cannot be modified currently.
export
{
ha
p
Tasks
}
from
'@ohos/hvigor-ohos-plugin'
;
export
{
ha
r
Tasks
}
from
'@ohos/hvigor-ohos-plugin'
;
\ No newline at end of file
features/DirectConnect/index.ets
View file @
8c8df1ea
export { DirectConnect } from './src/main/ets/
pages/DirectConnect';
export { DirectConnect } from './src/main/ets/
components/DirectConnect'
features/DirectConnect/oh-package.json5
View file @
8c8df1ea
{
{
"name": "directconnect",
"name": "directconnect",
"version": "1.0.0",
"version": "1.0.0",
"name": "@ohos/direct",
"description": "Please describe the basic information.",
"description": "Please describe the basic information.",
"main": "index.ets",
"main": "index.ets",
"name": "@ohos/direct",
"author": "",
"author": "",
"license": "",
"license": "
Apache-2.0
",
"dependencies": {}
"dependencies": {}
}
}
features/DirectConnect/src/main/ets/
page
s/DirectConnect.ets
→
features/DirectConnect/src/main/ets/
component
s/DirectConnect.ets
View file @
8c8df1ea
@Component
@Component
export struct DirectConnect {
export struct DirectConnect {
@State message: string = 'DirectConnect'
@State message: string = 'DirectConnect'
build() {
build() {
Row() {
Row() {
Column() {
Column() {
...
...
features/DirectConnect/src/main/ets/pages/Index.ets
deleted
100644 → 0
View file @
7b02a1bb
@Entry
@Component
struct Index {
@State message: string = 'Hello World'
build() {
Row() {
Column() {
Text(this.message)
.fontSize(50)
.fontWeight(FontWeight.Bold)
}
.width('100%')
}
.height('100%')
}
}
\ No newline at end of file
features/DirectConnect/src/main/module.json5
View file @
8c8df1ea
{
{
"module": {
"module": {
"name": "DirectConnect",
"name": "DirectConnect",
"type": "feature",
"type": "har",
"description": "$string:module_desc",
"mainElement": "DirectConnect",
"deviceTypes": [
"deviceTypes": [
"
phone
",
"
default
",
"tablet"
"tablet"
]
]
}
}
}
}
\ No newline at end of file
features/DirectConnect/src/main/resources/base/element/color.json
deleted
100644 → 0
View file @
7b02a1bb
{
"color"
:
[
{
"name"
:
"start_window_background"
,
"value"
:
"#FFFFFF"
}
]
}
\ No newline at end of file
features/DirectConnect/src/main/resources/base/element/string.json
View file @
8c8df1ea
{
{
"string"
:
[
"string"
:
[
{
{
"name"
:
"module_desc"
,
"name"
:
"page_show"
,
"value"
:
"module description"
"value"
:
"page from npm package"
},
{
"name"
:
"DirectConnect_desc"
,
"value"
:
"description"
},
{
"name"
:
"DirectConnect_label"
,
"value"
:
"label"
}
}
]
]
}
}
\ No newline at end of file
features/DirectConnect/src/main/resources/base/media/icon.png
deleted
100644 → 0
View file @
7b02a1bb
6.63 KB
features/DirectConnect/src/main/resources/base/profile/main_pages.json
deleted
100644 → 0
View file @
7b02a1bb
{
"src"
:
[
"pages/Index"
]
}
features/DirectConnect/src/main/resources/en_US/element/string.json
View file @
8c8df1ea
{
{
"string"
:
[
"string"
:
[
{
{
"name"
:
"module_desc"
,
"name"
:
"page_show"
,
"value"
:
"module description"
"value"
:
"page from npm package"
},
{
"name"
:
"DirectConnect_desc"
,
"value"
:
"description"
},
{
"name"
:
"DirectConnect_label"
,
"value"
:
"label"
}
}
]
]
}
}
\ No newline at end of file
features/DirectConnect/src/main/resources/zh_CN/element/string.json
View file @
8c8df1ea
{
{
"string"
:
[
"string"
:
[
{
{
"name"
:
"module_desc"
,
"name"
:
"page_show"
,
"value"
:
"模块描述"
"value"
:
"page from npm package"
},
{
"name"
:
"DirectConnect_desc"
,
"value"
:
"description"
},
{
"name"
:
"DirectConnect_label"
,
"value"
:
"label"
}
}
]
]
}
}
\ No newline at end of file
features/DirectConnect/src/ohosTest/ets/test/Ability.test.ets
deleted
100644 → 0
View file @
7b02a1bb
import hilog from '@ohos.hilog';
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'
export default function abilityTest() {
describe('ActsAbilityTest', function () {
// Defines a test suite. Two parameters are supported: test suite name and test suite function.
beforeAll(function () {
// Presets an action, which is performed only once before all test cases of the test suite start.
// This API supports only one parameter: preset action function.
})
beforeEach(function () {
// Presets an action, which is performed before each unit test case starts.
// The number of execution times is the same as the number of test cases defined by **it**.
// This API supports only one parameter: preset action function.
})
afterEach(function () {
// Presets a clear action, which is performed after each unit test case ends.
// The number of execution times is the same as the number of test cases defined by **it**.
// This API supports only one parameter: clear action function.
})
afterAll(function () {
// Presets a clear action, which is performed after all test cases of the test suite end.
// This API supports only one parameter: clear action function.
})
it('assertContain',0, function () {
// Defines a test case. This API supports three parameters: test case name, filter parameter, and test case function.
hilog.info(0x0000, 'testTag', '%{public}s', 'it begin');
let a = 'abc'
let b = 'b'
// Defines a variety of assertion methods, which are used to declare expected boolean conditions.
expect(a).assertContain(b)
expect(a).assertEqual(a)
})
})
}
\ No newline at end of file
features/DirectConnect/src/ohosTest/ets/test/List.test.ets
deleted
100644 → 0
View file @
7b02a1bb
import abilityTest from './Ability.test'
export default function testsuite() {
abilityTest()
}
\ No newline at end of file
features/DirectConnect/src/ohosTest/ets/testability/TestAbility.ets
deleted
100644 → 0
View file @
7b02a1bb
import UIAbility from '@ohos.app.ability.UIAbility';
import AbilityDelegatorRegistry from '@ohos.app.ability.abilityDelegatorRegistry';
import hilog from '@ohos.hilog';
import { Hypium } from '@ohos/hypium';
import testsuite from '../test/List.test';
import window from '@ohos.window';
export default class TestAbility extends UIAbility {
onCreate(want, launchParam) {
hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onCreate');
hilog.info(0x0000, 'testTag', '%{public}s', 'want param:' + JSON.stringify(want) ?? '');
hilog.info(0x0000, 'testTag', '%{public}s', 'launchParam:'+ JSON.stringify(launchParam) ?? '');
var abilityDelegator: any
abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator()
var abilityDelegatorArguments: any
abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments()
hilog.info(0x0000, 'testTag', '%{public}s', 'start run testcase!!!');
Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite)
}
onDestroy() {
hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onDestroy');
}
onWindowStageCreate(windowStage: window.WindowStage) {
hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onWindowStageCreate');
windowStage.loadContent('testability/pages/Index', (err, data) => {
if (err.code) {
hilog.error(0x0000, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err) ?? '');
return;
}
hilog.info(0x0000, 'testTag', 'Succeeded in loading the content. Data: %{public}s',
JSON.stringify(data) ?? '');
});
}
onWindowStageDestroy() {
hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onWindowStageDestroy');
}
onForeground() {
hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onForeground');
}
onBackground() {
hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onBackground');
}
}
\ No newline at end of file
features/DirectConnect/src/ohosTest/ets/testability/pages/Index.ets
deleted
100644 → 0
View file @
7b02a1bb
import hilog from '@ohos.hilog';
@Entry
@Component
struct Index {
aboutToAppear() {
hilog.info(0x0000, 'testTag', '%{public}s', '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
features/DirectConnect/src/ohosTest/ets/testrunner/OpenHarmonyTestRunner.ts
deleted
100644 → 0
View file @
7b02a1bb
import
hilog
from
'@ohos.hilog'
;
import
TestRunner
from
'@ohos.application.testRunner'
;
import
AbilityDelegatorRegistry
from
'@ohos.app.ability.abilityDelegatorRegistry'
;
var
abilityDelegator
=
undefined
var
abilityDelegatorArguments
=
undefined
async
function
onAbilityCreateCallback
()
{
hilog
.
info
(
0x0000
,
'testTag'
,
'%{public}s'
,
'onAbilityCreateCallback'
);
}
async
function
addAbilityMonitorCallback
(
err
:
any
)
{
hilog
.
info
(
0x0000
,
'testTag'
,
'addAbilityMonitorCallback : %{public}s'
,
JSON
.
stringify
(
err
)
??
''
);
}
export
default
class
OpenHarmonyTestRunner
implements
TestRunner
{
constructor
()
{
}
onPrepare
()
{
hilog
.
info
(
0x0000
,
'testTag'
,
'%{public}s'
,
'OpenHarmonyTestRunner OnPrepare '
);
}
async
onRun
()
{
hilog
.
info
(
0x0000
,
'testTag'
,
'%{public}s'
,
'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
var
debug
=
abilityDelegatorArguments
.
parameters
[
'-D'
]
if
(
debug
==
'true'
)
{
cmd
+=
' -D'
}
hilog
.
info
(
0x0000
,
'testTag'
,
'cmd : %{public}s'
,
cmd
);
abilityDelegator
.
executeShellCommand
(
cmd
,
(
err
:
any
,
d
:
any
)
=>
{
hilog
.
info
(
0x0000
,
'testTag'
,
'executeShellCommand : err : %{public}s'
,
JSON
.
stringify
(
err
)
??
''
);
hilog
.
info
(
0x0000
,
'testTag'
,
'executeShellCommand : data : %{public}s'
,
d
.
stdResult
??
''
);
hilog
.
info
(
0x0000
,
'testTag'
,
'executeShellCommand : data : %{public}s'
,
d
.
exitCode
??
''
);
})
hilog
.
info
(
0x0000
,
'testTag'
,
'%{public}s'
,
'OpenHarmonyTestRunner onRun end'
);
}
}
\ No newline at end of file
features/DirectConnect/src/ohosTest/module.json5
deleted
100644 → 0
View file @
7b02a1bb
{
"module": {
"name": "DirectConnect_test",
"type": "feature",
"description": "$string:module_test_desc",
"mainElement": "TestAbility",
"deviceTypes": [
"phone",
"tablet"
],
"deliveryWithInstall": true,
"installationFree": false,
"pages": "$profile:test_pages",
"abilities": [
{
"name": "TestAbility",
"srcEntry": "./ets/testability/TestAbility.ets",
"description": "$string:TestAbility_desc",
"icon": "$media:icon",
"label": "$string:TestAbility_label",
"exported": true,
"startWindowIcon": "$media:icon",
"startWindowBackground": "$color:start_window_background",
"skills": [
{
"actions": [
"action.system.home"
],
"entities": [
"entity.system.home"
]
}
]
}
]
}
}
features/DirectConnect/src/ohosTest/resources/base/element/color.json
deleted
100644 → 0
View file @
7b02a1bb
{
"color"
:
[
{
"name"
:
"start_window_background"
,
"value"
:
"#FFFFFF"
}
]
}
\ No newline at end of file
features/DirectConnect/src/ohosTest/resources/base/element/string.json
deleted
100644 → 0
View file @
7b02a1bb
{
"string"
:
[
{
"name"
:
"module_test_desc"
,
"value"
:
"test ability description"
},
{
"name"
:
"TestAbility_desc"
,
"value"
:
"the test ability"
},
{
"name"
:
"TestAbility_label"
,
"value"
:
"test label"
}
]
}
\ No newline at end of file
features/DirectConnect/src/ohosTest/resources/base/media/icon.png
deleted
100644 → 0
View file @
7b02a1bb
6.63 KB
features/DirectConnect/src/ohosTest/resources/base/profile/test_pages.json
deleted
100644 → 0
View file @
7b02a1bb
{
"src"
:
[
"testability/pages/Index"
]
}
features/MaterialManagement/build-profile.json5
View file @
8c8df1ea
{
{
"apiType":
'stageMode'
,
"apiType":
"stageMode"
,
"buildOption": {
"buildOption": {
},
},
"entryModules": [
"entry"
],
"targets": [
"targets": [
{
{
"name": "default",
"name": "default",
"runtimeOS": "HarmonyOS"
"runtimeOS": "HarmonyOS"
},
{
"name": "ohosTest",
}
}
]
]
}
}
\ No newline at end of file
features/MaterialManagement/hvigorfile.ts
View file @
8c8df1ea
// Script for compiling build behavior. It is built in the build plug-in and cannot be modified currently.
// Script for compiling build behavior. It is built in the build plug-in and cannot be modified currently.
export
{
ha
p
Tasks
}
from
'@ohos/hvigor-ohos-plugin'
;
export
{
ha
r
Tasks
}
from
'@ohos/hvigor-ohos-plugin'
;
\ No newline at end of file
features/MaterialManagement/index.ets
View file @
8c8df1ea
export { MaterialManagement } from './src/main/ets/
pages/MaterialManagement';
export { MaterialManagement } from './src/main/ets/
components/MaterialManagement'
features/MaterialManagement/oh-package.json5
View file @
8c8df1ea
{
{
"name": "materialmanagement",
"name": "materialmanagement",
"version": "1.0.0",
"version": "1.0.0",
"name": "@ohos/material",
"description": "Please describe the basic information.",
"description": "Please describe the basic information.",
"main": "index.ets",
"main": "index.ets",
"name": "@ohos/material",
"author": "",
"author": "",
"license": "",
"license": "
Apache-2.0
",
"dependencies": {}
"dependencies": {}
}
}
features/MaterialManagement/src/main/ets/components/MaterialManagement.ets
0 → 100644
View file @
8c8df1ea
import router from '@ohos.router';
@Component
export struct MaterialManagement {
build(){
Column() {
Flex({ direction: FlexDirection.Column }) {
Column() {
Row() {
Flex({ justifyContent: FlexAlign.SpaceBetween, alignItems: ItemAlign.Center }) {
Text("物资管理")
.fontSize(21)
.fontColor('#0fa983')
Image($r("app.media.ic_back")).size({ width: 55, height: 55 }).padding(15)
.onClick(()=>{
router.pushUrl({
url: 'pages/setup/SetUpPage',
})
})
}.margin(15)
}.margin({ top: 15 })
}
}
}
}
}
\ No newline at end of file
features/MaterialManagement/src/main/ets/pages/Index.ets
deleted
100644 → 0
View file @
7b02a1bb
@Entry
@Component
struct Index {
@State message: string = 'Hello World'
build() {
Row() {
Column() {
Text(this.message)
.fontSize(50)
.fontWeight(FontWeight.Bold)
}
.width('100%')
}
.height('100%')
}
}
\ No newline at end of file
features/MaterialManagement/src/main/ets/pages/MaterialManagement.ets
deleted
100644 → 0
View file @
7b02a1bb
@Component
export struct MaterialManagement {
@State message: string = 'MaterialManagement'
build() {
Row() {
Column() {
Text(this.message)
.fontSize(50)
.fontWeight(FontWeight.Bold)
}
.width('100%')
}
.height('100%')
}
}
\ No newline at end of file
features/MaterialManagement/src/main/module.json5
View file @
8c8df1ea
{
{
"module": {
"module": {
"name": "MaterialManagement",
"name": "MaterialManagement",
"type": "feature",
"type": "har",
"description": "$string:module_desc",
"mainElement": "MaterialManagement",
"deviceTypes": [
"deviceTypes": [
"
phone
",
"
default
",
"tablet"
"tablet"
]
]
}
}
}
}
\ No newline at end of file
features/MaterialManagement/src/main/resources/base/element/color.json
deleted
100644 → 0
View file @
7b02a1bb
{
"color"
:
[
{
"name"
:
"start_window_background"
,
"value"
:
"#FFFFFF"
}
]
}
\ No newline at end of file
features/MaterialManagement/src/main/resources/base/element/string.json
View file @
8c8df1ea
{
{
"string"
:
[
"string"
:
[
{
{
"name"
:
"module_desc"
,
"name"
:
"page_show"
,
"value"
:
"module description"
"value"
:
"page from npm package"
},
{
"name"
:
"MaterialManagement_desc"
,
"value"
:
"description"
},
{
"name"
:
"MaterialManagement_label"
,
"value"
:
"label"
}
}
]
]
}
}
\ No newline at end of file
features/MaterialManagement/src/main/resources/base/media/ic_back.png
0 → 100644
View file @
8c8df1ea
3.33 KB
features/MaterialManagement/src/main/resources/base/media/icon.png
deleted
100644 → 0
View file @
7b02a1bb
6.63 KB
features/MaterialManagement/src/main/resources/base/profile/main_pages.json
deleted
100644 → 0
View file @
7b02a1bb
{
"src"
:
[
"pages/Index"
]
}
features/MaterialManagement/src/main/resources/en_US/element/string.json
View file @
8c8df1ea
{
{
"string"
:
[
"string"
:
[
{
{
"name"
:
"module_desc"
,
"name"
:
"page_show"
,
"value"
:
"module description"
"value"
:
"page from npm package"
},
{
"name"
:
"MaterialManagement_desc"
,
"value"
:
"description"
},
{
"name"
:
"MaterialManagement_label"
,
"value"
:
"label"
}
}
]
]
}
}
\ No newline at end of file
features/MaterialManagement/src/main/resources/zh_CN/element/string.json
View file @
8c8df1ea
{
{
"string"
:
[
"string"
:
[
{
{
"name"
:
"module_desc"
,
"name"
:
"page_show"
,
"value"
:
"模块描述"
"value"
:
"page from npm package"
},
{
"name"
:
"MaterialManagement_desc"
,
"value"
:
"description"
},
{
"name"
:
"MaterialManagement_label"
,
"value"
:
"label"
}
}
]
]
}
}
\ No newline at end of file
features/MaterialManagement/src/ohosTest/ets/test/Ability.test.ets
deleted
100644 → 0
View file @
7b02a1bb
import hilog from '@ohos.hilog';
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'
export default function abilityTest() {
describe('ActsAbilityTest', function () {
// Defines a test suite. Two parameters are supported: test suite name and test suite function.
beforeAll(function () {
// Presets an action, which is performed only once before all test cases of the test suite start.
// This API supports only one parameter: preset action function.
})
beforeEach(function () {
// Presets an action, which is performed before each unit test case starts.
// The number of execution times is the same as the number of test cases defined by **it**.
// This API supports only one parameter: preset action function.
})
afterEach(function () {
// Presets a clear action, which is performed after each unit test case ends.
// The number of execution times is the same as the number of test cases defined by **it**.
// This API supports only one parameter: clear action function.
})
afterAll(function () {
// Presets a clear action, which is performed after all test cases of the test suite end.
// This API supports only one parameter: clear action function.
})
it('assertContain',0, function () {
// Defines a test case. This API supports three parameters: test case name, filter parameter, and test case function.
hilog.info(0x0000, 'testTag', '%{public}s', 'it begin');
let a = 'abc'
let b = 'b'
// Defines a variety of assertion methods, which are used to declare expected boolean conditions.
expect(a).assertContain(b)
expect(a).assertEqual(a)
})
})
}
\ No newline at end of file
features/MaterialManagement/src/ohosTest/ets/test/List.test.ets
deleted
100644 → 0
View file @
7b02a1bb
import abilityTest from './Ability.test'
export default function testsuite() {
abilityTest()
}
\ No newline at end of file
features/MaterialManagement/src/ohosTest/ets/testability/TestAbility.ets
deleted
100644 → 0
View file @
7b02a1bb
import UIAbility from '@ohos.app.ability.UIAbility';
import AbilityDelegatorRegistry from '@ohos.app.ability.abilityDelegatorRegistry';
import hilog from '@ohos.hilog';
import { Hypium } from '@ohos/hypium';
import testsuite from '../test/List.test';
import window from '@ohos.window';
export default class TestAbility extends UIAbility {
onCreate(want, launchParam) {
hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onCreate');
hilog.info(0x0000, 'testTag', '%{public}s', 'want param:' + JSON.stringify(want) ?? '');
hilog.info(0x0000, 'testTag', '%{public}s', 'launchParam:'+ JSON.stringify(launchParam) ?? '');
var abilityDelegator: any
abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator()
var abilityDelegatorArguments: any
abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments()
hilog.info(0x0000, 'testTag', '%{public}s', 'start run testcase!!!');
Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite)
}
onDestroy() {
hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onDestroy');
}
onWindowStageCreate(windowStage: window.WindowStage) {
hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onWindowStageCreate');
windowStage.loadContent('testability/pages/Index', (err, data) => {
if (err.code) {
hilog.error(0x0000, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err) ?? '');
return;
}
hilog.info(0x0000, 'testTag', 'Succeeded in loading the content. Data: %{public}s',
JSON.stringify(data) ?? '');
});
}
onWindowStageDestroy() {
hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onWindowStageDestroy');
}
onForeground() {
hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onForeground');
}
onBackground() {
hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onBackground');
}
}
\ No newline at end of file
features/MaterialManagement/src/ohosTest/ets/testability/pages/Index.ets
deleted
100644 → 0
View file @
7b02a1bb
import hilog from '@ohos.hilog';
@Entry
@Component
struct Index {
aboutToAppear() {
hilog.info(0x0000, 'testTag', '%{public}s', '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
features/MaterialManagement/src/ohosTest/ets/testrunner/OpenHarmonyTestRunner.ts
deleted
100644 → 0
View file @
7b02a1bb
import
hilog
from
'@ohos.hilog'
;
import
TestRunner
from
'@ohos.application.testRunner'
;
import
AbilityDelegatorRegistry
from
'@ohos.app.ability.abilityDelegatorRegistry'
;
var
abilityDelegator
=
undefined
var
abilityDelegatorArguments
=
undefined
async
function
onAbilityCreateCallback
()
{
hilog
.
info
(
0x0000
,
'testTag'
,
'%{public}s'
,
'onAbilityCreateCallback'
);
}
async
function
addAbilityMonitorCallback
(
err
:
any
)
{
hilog
.
info
(
0x0000
,
'testTag'
,
'addAbilityMonitorCallback : %{public}s'
,
JSON
.
stringify
(
err
)
??
''
);
}
export
default
class
OpenHarmonyTestRunner
implements
TestRunner
{
constructor
()
{
}
onPrepare
()
{
hilog
.
info
(
0x0000
,
'testTag'
,
'%{public}s'
,
'OpenHarmonyTestRunner OnPrepare '
);
}
async
onRun
()
{
hilog
.
info
(
0x0000
,
'testTag'
,
'%{public}s'
,
'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
var
debug
=
abilityDelegatorArguments
.
parameters
[
'-D'
]
if
(
debug
==
'true'
)
{
cmd
+=
' -D'
}
hilog
.
info
(
0x0000
,
'testTag'
,
'cmd : %{public}s'
,
cmd
);
abilityDelegator
.
executeShellCommand
(
cmd
,
(
err
:
any
,
d
:
any
)
=>
{
hilog
.
info
(
0x0000
,
'testTag'
,
'executeShellCommand : err : %{public}s'
,
JSON
.
stringify
(
err
)
??
''
);
hilog
.
info
(
0x0000
,
'testTag'
,
'executeShellCommand : data : %{public}s'
,
d
.
stdResult
??
''
);
hilog
.
info
(
0x0000
,
'testTag'
,
'executeShellCommand : data : %{public}s'
,
d
.
exitCode
??
''
);
})
hilog
.
info
(
0x0000
,
'testTag'
,
'%{public}s'
,
'OpenHarmonyTestRunner onRun end'
);
}
}
\ No newline at end of file
features/MaterialManagement/src/ohosTest/module.json5
deleted
100644 → 0
View file @
7b02a1bb
{
"module": {
"name": "MaterialManagement_test",
"type": "feature",
"description": "$string:module_test_desc",
"mainElement": "TestAbility",
"deviceTypes": [
"phone",
"tablet"
],
"deliveryWithInstall": true,
"installationFree": false,
"pages": "$profile:test_pages",
"abilities": [
{
"name": "TestAbility",
"srcEntry": "./ets/testability/TestAbility.ets",
"description": "$string:TestAbility_desc",
"icon": "$media:icon",
"label": "$string:TestAbility_label",
"exported": true,
"startWindowIcon": "$media:icon",
"startWindowBackground": "$color:start_window_background",
"skills": [
{
"actions": [
"action.system.home"
],
"entities": [
"entity.system.home"
]
}
]
}
]
}
}
features/MaterialManagement/src/ohosTest/resources/base/element/color.json
deleted
100644 → 0
View file @
7b02a1bb
{
"color"
:
[
{
"name"
:
"start_window_background"
,
"value"
:
"#FFFFFF"
}
]
}
\ No newline at end of file
features/MaterialManagement/src/ohosTest/resources/base/element/string.json
deleted
100644 → 0
View file @
7b02a1bb
{
"string"
:
[
{
"name"
:
"module_test_desc"
,
"value"
:
"test ability description"
},
{
"name"
:
"TestAbility_desc"
,
"value"
:
"the test ability"
},
{
"name"
:
"TestAbility_label"
,
"value"
:
"test label"
}
]
}
\ No newline at end of file
features/MaterialManagement/src/ohosTest/resources/base/media/icon.png
deleted
100644 → 0
View file @
7b02a1bb
6.63 KB
features/MaterialManagement/src/ohosTest/resources/base/profile/test_pages.json
deleted
100644 → 0
View file @
7b02a1bb
{
"src"
:
[
"testability/pages/Index"
]
}
features/PageManagement/build-profile.json5
View file @
8c8df1ea
{
{
"apiType":
'stageMode'
,
"apiType":
"stageMode"
,
"buildOption": {
"buildOption": {
},
},
"entryModules": [
"entry"
],
"targets": [
"targets": [
{
{
"name": "default",
"name": "default",
"runtimeOS": "HarmonyOS"
"runtimeOS": "HarmonyOS"
},
{
"name": "ohosTest",
}
}
]
]
}
}
\ No newline at end of file
features/PageManagement/hvigorfile.ts
View file @
8c8df1ea
// Script for compiling build behavior. It is built in the build plug-in and cannot be modified currently.
// Script for compiling build behavior. It is built in the build plug-in and cannot be modified currently.
export
{
ha
p
Tasks
}
from
'@ohos/hvigor-ohos-plugin'
;
export
{
ha
r
Tasks
}
from
'@ohos/hvigor-ohos-plugin'
;
\ No newline at end of file
features/PageManagement/index.ets
View file @
8c8df1ea
export { PageManagement } from './src/main/ets/
pages/PageManagement';
export { PageManagement } from './src/main/ets/
components/PageManagement'
features/PageManagement/oh-package.json5
View file @
8c8df1ea
{
{
"name": "pagemanagement",
"name": "pagemanagement",
"version": "1.0.0",
"version": "1.0.0",
"name": "@ohos/pagemanagement",
"description": "Please describe the basic information.",
"description": "Please describe the basic information.",
"main": "index.ets",
"main": "index.ets",
"name": "@ohos/pagemanagement",
"author": "",
"author": "",
"license": "",
"license": "
Apache-2.0
",
"dependencies": {}
"dependencies": {}
}
}
features/PageManagement/src/main/ets/
page
s/PageManagement.ets
→
features/PageManagement/src/main/ets/
component
s/PageManagement.ets
View file @
8c8df1ea
File moved
features/PageManagement/src/main/module.json5
View file @
8c8df1ea
{
{
"module": {
"module": {
"name": "PageManagement",
"name": "PageManagement",
"type": "feature",
"type": "har",
"description": "$string:module_desc",
"mainElement": "PageManagement",
"deviceTypes": [
"deviceTypes": [
"
phone
",
"
default
",
"tablet"
"tablet"
]
]
}
}
}
}
\ No newline at end of file
features/PageManagement/src/main/resources/base/element/color.json
deleted
100644 → 0
View file @
7b02a1bb
{
"color"
:
[
{
"name"
:
"start_window_background"
,
"value"
:
"#FFFFFF"
}
]
}
\ No newline at end of file
features/PageManagement/src/main/resources/base/element/string.json
View file @
8c8df1ea
{
{
"string"
:
[
"string"
:
[
{
{
"name"
:
"module_desc"
,
"name"
:
"page_show"
,
"value"
:
"module description"
"value"
:
"page from npm package"
},
{
"name"
:
"PageManagement_desc"
,
"value"
:
"description"
},
{
"name"
:
"PageManagement_label"
,
"value"
:
"label"
}
}
]
]
}
}
\ No newline at end of file
features/PageManagement/src/main/resources/base/media/icon.png
deleted
100644 → 0
View file @
7b02a1bb
6.63 KB
features/PageManagement/src/main/resources/base/profile/main_pages.json
deleted
100644 → 0
View file @
7b02a1bb
{
"src"
:
[
"pages/PageManagement"
]
}
features/PageManagement/src/main/resources/en_US/element/string.json
View file @
8c8df1ea
{
{
"string"
:
[
"string"
:
[
{
{
"name"
:
"module_desc"
,
"name"
:
"page_show"
,
"value"
:
"module description"
"value"
:
"page from npm package"
},
{
"name"
:
"PageManagement_desc"
,
"value"
:
"description"
},
{
"name"
:
"PageManagement_label"
,
"value"
:
"label"
}
}
]
]
}
}
\ No newline at end of file
features/PageManagement/src/main/resources/zh_CN/element/string.json
View file @
8c8df1ea
{
{
"string"
:
[
"string"
:
[
{
{
"name"
:
"module_desc"
,
"name"
:
"page_show"
,
"value"
:
"模块描述"
"value"
:
"page from npm package"
},
{
"name"
:
"PageManagement_desc"
,
"value"
:
"description"
},
{
"name"
:
"PageManagement_label"
,
"value"
:
"label"
}
}
]
]
}
}
\ No newline at end of file
features/PageManagement/src/ohosTest/ets/test/Ability.test.ets
deleted
100644 → 0
View file @
7b02a1bb
import hilog from '@ohos.hilog';
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'
export default function abilityTest() {
describe('ActsAbilityTest', function () {
// Defines a test suite. Two parameters are supported: test suite name and test suite function.
beforeAll(function () {
// Presets an action, which is performed only once before all test cases of the test suite start.
// This API supports only one parameter: preset action function.
})
beforeEach(function () {
// Presets an action, which is performed before each unit test case starts.
// The number of execution times is the same as the number of test cases defined by **it**.
// This API supports only one parameter: preset action function.
})
afterEach(function () {
// Presets a clear action, which is performed after each unit test case ends.
// The number of execution times is the same as the number of test cases defined by **it**.
// This API supports only one parameter: clear action function.
})
afterAll(function () {
// Presets a clear action, which is performed after all test cases of the test suite end.
// This API supports only one parameter: clear action function.
})
it('assertContain',0, function () {
// Defines a test case. This API supports three parameters: test case name, filter parameter, and test case function.
hilog.info(0x0000, 'testTag', '%{public}s', 'it begin');
let a = 'abc'
let b = 'b'
// Defines a variety of assertion methods, which are used to declare expected boolean conditions.
expect(a).assertContain(b)
expect(a).assertEqual(a)
})
})
}
\ No newline at end of file
features/PageManagement/src/ohosTest/ets/test/List.test.ets
deleted
100644 → 0
View file @
7b02a1bb
import abilityTest from './Ability.test'
export default function testsuite() {
abilityTest()
}
\ No newline at end of file
features/PageManagement/src/ohosTest/ets/testability/TestAbility.ets
deleted
100644 → 0
View file @
7b02a1bb
import UIAbility from '@ohos.app.ability.UIAbility';
import AbilityDelegatorRegistry from '@ohos.app.ability.abilityDelegatorRegistry';
import hilog from '@ohos.hilog';
import { Hypium } from '@ohos/hypium';
import testsuite from '../test/List.test';
import window from '@ohos.window';
export default class TestAbility extends UIAbility {
onCreate(want, launchParam) {
hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onCreate');
hilog.info(0x0000, 'testTag', '%{public}s', 'want param:' + JSON.stringify(want) ?? '');
hilog.info(0x0000, 'testTag', '%{public}s', 'launchParam:'+ JSON.stringify(launchParam) ?? '');
var abilityDelegator: any
abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator()
var abilityDelegatorArguments: any
abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments()
hilog.info(0x0000, 'testTag', '%{public}s', 'start run testcase!!!');
Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite)
}
onDestroy() {
hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onDestroy');
}
onWindowStageCreate(windowStage: window.WindowStage) {
hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onWindowStageCreate');
windowStage.loadContent('testability/pages/Index', (err, data) => {
if (err.code) {
hilog.error(0x0000, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err) ?? '');
return;
}
hilog.info(0x0000, 'testTag', 'Succeeded in loading the content. Data: %{public}s',
JSON.stringify(data) ?? '');
});
}
onWindowStageDestroy() {
hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onWindowStageDestroy');
}
onForeground() {
hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onForeground');
}
onBackground() {
hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onBackground');
}
}
\ No newline at end of file
features/PageManagement/src/ohosTest/ets/testability/pages/Index.ets
deleted
100644 → 0
View file @
7b02a1bb
import hilog from '@ohos.hilog';
@Entry
@Component
struct Index {
aboutToAppear() {
hilog.info(0x0000, 'testTag', '%{public}s', '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
features/PageManagement/src/ohosTest/ets/testrunner/OpenHarmonyTestRunner.ts
deleted
100644 → 0
View file @
7b02a1bb
import
hilog
from
'@ohos.hilog'
;
import
TestRunner
from
'@ohos.application.testRunner'
;
import
AbilityDelegatorRegistry
from
'@ohos.app.ability.abilityDelegatorRegistry'
;
var
abilityDelegator
=
undefined
var
abilityDelegatorArguments
=
undefined
async
function
onAbilityCreateCallback
()
{
hilog
.
info
(
0x0000
,
'testTag'
,
'%{public}s'
,
'onAbilityCreateCallback'
);
}
async
function
addAbilityMonitorCallback
(
err
:
any
)
{
hilog
.
info
(
0x0000
,
'testTag'
,
'addAbilityMonitorCallback : %{public}s'
,
JSON
.
stringify
(
err
)
??
''
);
}
export
default
class
OpenHarmonyTestRunner
implements
TestRunner
{
constructor
()
{
}
onPrepare
()
{
hilog
.
info
(
0x0000
,
'testTag'
,
'%{public}s'
,
'OpenHarmonyTestRunner OnPrepare '
);
}
async
onRun
()
{
hilog
.
info
(
0x0000
,
'testTag'
,
'%{public}s'
,
'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
var
debug
=
abilityDelegatorArguments
.
parameters
[
'-D'
]
if
(
debug
==
'true'
)
{
cmd
+=
' -D'
}
hilog
.
info
(
0x0000
,
'testTag'
,
'cmd : %{public}s'
,
cmd
);
abilityDelegator
.
executeShellCommand
(
cmd
,
(
err
:
any
,
d
:
any
)
=>
{
hilog
.
info
(
0x0000
,
'testTag'
,
'executeShellCommand : err : %{public}s'
,
JSON
.
stringify
(
err
)
??
''
);
hilog
.
info
(
0x0000
,
'testTag'
,
'executeShellCommand : data : %{public}s'
,
d
.
stdResult
??
''
);
hilog
.
info
(
0x0000
,
'testTag'
,
'executeShellCommand : data : %{public}s'
,
d
.
exitCode
??
''
);
})
hilog
.
info
(
0x0000
,
'testTag'
,
'%{public}s'
,
'OpenHarmonyTestRunner onRun end'
);
}
}
\ No newline at end of file
features/PageManagement/src/ohosTest/module.json5
deleted
100644 → 0
View file @
7b02a1bb
{
"module": {
"name": "PageManagement_test",
"type": "feature",
"description": "$string:module_test_desc",
"mainElement": "TestAbility",
"deviceTypes": [
"phone",
"tablet"
],
"deliveryWithInstall": true,
"installationFree": false,
"pages": "$profile:test_pages",
"abilities": [
{
"name": "TestAbility",
"srcEntry": "./ets/testability/TestAbility.ets",
"description": "$string:TestAbility_desc",
"icon": "$media:icon",
"label": "$string:TestAbility_label",
"exported": true,
"startWindowIcon": "$media:icon",
"startWindowBackground": "$color:start_window_background",
"skills": [
{
"actions": [
"action.system.home"
],
"entities": [
"entity.system.home"
]
}
]
}
]
}
}
features/PageManagement/src/ohosTest/resources/base/element/color.json
deleted
100644 → 0
View file @
7b02a1bb
{
"color"
:
[
{
"name"
:
"start_window_background"
,
"value"
:
"#FFFFFF"
}
]
}
\ No newline at end of file
features/PageManagement/src/ohosTest/resources/base/element/string.json
deleted
100644 → 0
View file @
7b02a1bb
{
"string"
:
[
{
"name"
:
"module_test_desc"
,
"value"
:
"test ability description"
},
{
"name"
:
"TestAbility_desc"
,
"value"
:
"the test ability"
},
{
"name"
:
"TestAbility_label"
,
"value"
:
"test label"
}
]
}
\ No newline at end of file
features/PageManagement/src/ohosTest/resources/base/media/icon.png
deleted
100644 → 0
View file @
7b02a1bb
6.63 KB
features/PageManagement/src/ohosTest/resources/base/profile/test_pages.json
deleted
100644 → 0
View file @
7b02a1bb
{
"src"
:
[
"testability/pages/Index"
]
}
features/SystemMaintenance/build-profile.json5
View file @
8c8df1ea
{
{
"apiType":
'stageMode'
,
"apiType":
"stageMode"
,
"buildOption": {
"buildOption": {
},
},
"entryModules": [
"entry"
],
"targets": [
"targets": [
{
{
"name": "default",
"name": "default",
"runtimeOS": "HarmonyOS"
"runtimeOS": "HarmonyOS"
},
{
"name": "ohosTest",
}
}
]
]
}
}
\ No newline at end of file
features/SystemMaintenance/hvigorfile.ts
View file @
8c8df1ea
// Script for compiling build behavior. It is built in the build plug-in and cannot be modified currently.
// Script for compiling build behavior. It is built in the build plug-in and cannot be modified currently.
export
{
ha
p
Tasks
}
from
'@ohos/hvigor-ohos-plugin'
;
export
{
ha
r
Tasks
}
from
'@ohos/hvigor-ohos-plugin'
;
\ No newline at end of file
features/SystemMaintenance/index.ets
View file @
8c8df1ea
export { SystemMaintenance } from './src/main/ets/
pages/SystemMaintenance';
export { SystemMaintenance } from './src/main/ets/
components/SystemMaintenance'
features/SystemMaintenance/oh-package.json5
View file @
8c8df1ea
{
{
"name": "systemmaintenance",
"name": "systemmaintenance",
"version": "1.0.0",
"version": "1.0.0",
"name": "@ohos/system",
"description": "Please describe the basic information.",
"description": "Please describe the basic information.",
"main": "index.ets",
"main": "index.ets",
"name": "@ohos/system",
"author": "",
"author": "",
"license": "",
"license": "
Apache-2.0
",
"dependencies": {}
"dependencies": {}
}
}
features/SystemMaintenance/src/main/ets/
page
s/SystemMaintenance.ets
→
features/SystemMaintenance/src/main/ets/
component
s/SystemMaintenance.ets
View file @
8c8df1ea
File moved
features/SystemMaintenance/src/main/module.json5
View file @
8c8df1ea
{
{
"module": {
"module": {
"name": "SystemMaintenance",
"name": "SystemMaintenance",
"type": "feature",
"type": "har",
"description": "$string:module_desc",
"mainElement": "SystemMaintenance",
"deviceTypes": [
"deviceTypes": [
"
phone
",
"
default
",
"tablet"
"tablet"
]
]
}
}
}
}
\ No newline at end of file
features/SystemMaintenance/src/main/resources/base/element/color.json
deleted
100644 → 0
View file @
7b02a1bb
{
"color"
:
[
{
"name"
:
"start_window_background"
,
"value"
:
"#FFFFFF"
}
]
}
\ No newline at end of file
features/SystemMaintenance/src/main/resources/base/element/string.json
View file @
8c8df1ea
{
{
"string"
:
[
"string"
:
[
{
{
"name"
:
"module_desc"
,
"name"
:
"page_show"
,
"value"
:
"module description"
"value"
:
"page from npm package"
},
{
"name"
:
"SystemMaintenance_desc"
,
"value"
:
"description"
},
{
"name"
:
"SystemMaintenance_label"
,
"value"
:
"label"
}
}
]
]
}
}
\ No newline at end of file
features/SystemMaintenance/src/main/resources/base/media/icon.png
deleted
100644 → 0
View file @
7b02a1bb
6.63 KB
features/SystemMaintenance/src/main/resources/base/profile/main_pages.json
deleted
100644 → 0
View file @
7b02a1bb
{
"src"
:
[
"pages/SystemMaintenance"
]
}
features/SystemMaintenance/src/main/resources/en_US/element/string.json
View file @
8c8df1ea
{
{
"string"
:
[
"string"
:
[
{
{
"name"
:
"module_desc"
,
"name"
:
"page_show"
,
"value"
:
"module description"
"value"
:
"page from npm package"
},
{
"name"
:
"SystemMaintenance_desc"
,
"value"
:
"description"
},
{
"name"
:
"SystemMaintenance_label"
,
"value"
:
"label"
}
}
]
]
}
}
\ No newline at end of file
features/SystemMaintenance/src/main/resources/zh_CN/element/string.json
View file @
8c8df1ea
{
{
"string"
:
[
"string"
:
[
{
{
"name"
:
"module_desc"
,
"name"
:
"page_show"
,
"value"
:
"模块描述"
"value"
:
"page from npm package"
},
{
"name"
:
"SystemMaintenance_desc"
,
"value"
:
"description"
},
{
"name"
:
"SystemMaintenance_label"
,
"value"
:
"label"
}
}
]
]
}
}
\ No newline at end of file
features/SystemMaintenance/src/ohosTest/ets/test/Ability.test.ets
deleted
100644 → 0
View file @
7b02a1bb
import hilog from '@ohos.hilog';
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'
export default function abilityTest() {
describe('ActsAbilityTest', function () {
// Defines a test suite. Two parameters are supported: test suite name and test suite function.
beforeAll(function () {
// Presets an action, which is performed only once before all test cases of the test suite start.
// This API supports only one parameter: preset action function.
})
beforeEach(function () {
// Presets an action, which is performed before each unit test case starts.
// The number of execution times is the same as the number of test cases defined by **it**.
// This API supports only one parameter: preset action function.
})
afterEach(function () {
// Presets a clear action, which is performed after each unit test case ends.
// The number of execution times is the same as the number of test cases defined by **it**.
// This API supports only one parameter: clear action function.
})
afterAll(function () {
// Presets a clear action, which is performed after all test cases of the test suite end.
// This API supports only one parameter: clear action function.
})
it('assertContain',0, function () {
// Defines a test case. This API supports three parameters: test case name, filter parameter, and test case function.
hilog.info(0x0000, 'testTag', '%{public}s', 'it begin');
let a = 'abc'
let b = 'b'
// Defines a variety of assertion methods, which are used to declare expected boolean conditions.
expect(a).assertContain(b)
expect(a).assertEqual(a)
})
})
}
\ No newline at end of file
features/SystemMaintenance/src/ohosTest/ets/test/List.test.ets
deleted
100644 → 0
View file @
7b02a1bb
import abilityTest from './Ability.test'
export default function testsuite() {
abilityTest()
}
\ No newline at end of file
features/SystemMaintenance/src/ohosTest/ets/testability/TestAbility.ets
deleted
100644 → 0
View file @
7b02a1bb
import UIAbility from '@ohos.app.ability.UIAbility';
import AbilityDelegatorRegistry from '@ohos.app.ability.abilityDelegatorRegistry';
import hilog from '@ohos.hilog';
import { Hypium } from '@ohos/hypium';
import testsuite from '../test/List.test';
import window from '@ohos.window';
export default class TestAbility extends UIAbility {
onCreate(want, launchParam) {
hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onCreate');
hilog.info(0x0000, 'testTag', '%{public}s', 'want param:' + JSON.stringify(want) ?? '');
hilog.info(0x0000, 'testTag', '%{public}s', 'launchParam:'+ JSON.stringify(launchParam) ?? '');
var abilityDelegator: any
abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator()
var abilityDelegatorArguments: any
abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments()
hilog.info(0x0000, 'testTag', '%{public}s', 'start run testcase!!!');
Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite)
}
onDestroy() {
hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onDestroy');
}
onWindowStageCreate(windowStage: window.WindowStage) {
hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onWindowStageCreate');
windowStage.loadContent('testability/pages/Index', (err, data) => {
if (err.code) {
hilog.error(0x0000, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err) ?? '');
return;
}
hilog.info(0x0000, 'testTag', 'Succeeded in loading the content. Data: %{public}s',
JSON.stringify(data) ?? '');
});
}
onWindowStageDestroy() {
hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onWindowStageDestroy');
}
onForeground() {
hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onForeground');
}
onBackground() {
hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onBackground');
}
}
\ No newline at end of file
features/SystemMaintenance/src/ohosTest/ets/testability/pages/Index.ets
deleted
100644 → 0
View file @
7b02a1bb
import hilog from '@ohos.hilog';
@Entry
@Component
struct Index {
aboutToAppear() {
hilog.info(0x0000, 'testTag', '%{public}s', '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
features/SystemMaintenance/src/ohosTest/ets/testrunner/OpenHarmonyTestRunner.ts
deleted
100644 → 0
View file @
7b02a1bb
import
hilog
from
'@ohos.hilog'
;
import
TestRunner
from
'@ohos.application.testRunner'
;
import
AbilityDelegatorRegistry
from
'@ohos.app.ability.abilityDelegatorRegistry'
;
var
abilityDelegator
=
undefined
var
abilityDelegatorArguments
=
undefined
async
function
onAbilityCreateCallback
()
{
hilog
.
info
(
0x0000
,
'testTag'
,
'%{public}s'
,
'onAbilityCreateCallback'
);
}
async
function
addAbilityMonitorCallback
(
err
:
any
)
{
hilog
.
info
(
0x0000
,
'testTag'
,
'addAbilityMonitorCallback : %{public}s'
,
JSON
.
stringify
(
err
)
??
''
);
}
export
default
class
OpenHarmonyTestRunner
implements
TestRunner
{
constructor
()
{
}
onPrepare
()
{
hilog
.
info
(
0x0000
,
'testTag'
,
'%{public}s'
,
'OpenHarmonyTestRunner OnPrepare '
);
}
async
onRun
()
{
hilog
.
info
(
0x0000
,
'testTag'
,
'%{public}s'
,
'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
var
debug
=
abilityDelegatorArguments
.
parameters
[
'-D'
]
if
(
debug
==
'true'
)
{
cmd
+=
' -D'
}
hilog
.
info
(
0x0000
,
'testTag'
,
'cmd : %{public}s'
,
cmd
);
abilityDelegator
.
executeShellCommand
(
cmd
,
(
err
:
any
,
d
:
any
)
=>
{
hilog
.
info
(
0x0000
,
'testTag'
,
'executeShellCommand : err : %{public}s'
,
JSON
.
stringify
(
err
)
??
''
);
hilog
.
info
(
0x0000
,
'testTag'
,
'executeShellCommand : data : %{public}s'
,
d
.
stdResult
??
''
);
hilog
.
info
(
0x0000
,
'testTag'
,
'executeShellCommand : data : %{public}s'
,
d
.
exitCode
??
''
);
})
hilog
.
info
(
0x0000
,
'testTag'
,
'%{public}s'
,
'OpenHarmonyTestRunner onRun end'
);
}
}
\ No newline at end of file
features/SystemMaintenance/src/ohosTest/module.json5
deleted
100644 → 0
View file @
7b02a1bb
{
"module": {
"name": "SystemMaintenance_test",
"type": "feature",
"description": "$string:module_test_desc",
"mainElement": "TestAbility",
"deviceTypes": [
"phone",
"tablet"
],
"deliveryWithInstall": true,
"installationFree": false,
"pages": "$profile:test_pages",
"abilities": [
{
"name": "TestAbility",
"srcEntry": "./ets/testability/TestAbility.ets",
"description": "$string:TestAbility_desc",
"icon": "$media:icon",
"label": "$string:TestAbility_label",
"exported": true,
"startWindowIcon": "$media:icon",
"startWindowBackground": "$color:start_window_background",
"skills": [
{
"actions": [
"action.system.home"
],
"entities": [
"entity.system.home"
]
}
]
}
]
}
}
features/SystemMaintenance/src/ohosTest/resources/base/element/color.json
deleted
100644 → 0
View file @
7b02a1bb
{
"color"
:
[
{
"name"
:
"start_window_background"
,
"value"
:
"#FFFFFF"
}
]
}
\ No newline at end of file
features/SystemMaintenance/src/ohosTest/resources/base/element/string.json
deleted
100644 → 0
View file @
7b02a1bb
{
"string"
:
[
{
"name"
:
"module_test_desc"
,
"value"
:
"test ability description"
},
{
"name"
:
"TestAbility_desc"
,
"value"
:
"the test ability"
},
{
"name"
:
"TestAbility_label"
,
"value"
:
"test label"
}
]
}
\ No newline at end of file
features/SystemMaintenance/src/ohosTest/resources/base/media/icon.png
deleted
100644 → 0
View file @
7b02a1bb
6.63 KB
features/SystemMaintenance/src/ohosTest/resources/base/profile/test_pages.json
deleted
100644 → 0
View file @
7b02a1bb
{
"src"
:
[
"testability/pages/Index"
]
}
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论