Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
5371fdba
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看板
提交
5371fdba
编写于
4月 24, 2023
作者:
H
hekun
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
change to stage model
Signed-off-by:
N
hekun
<
hekun18@huawei.com
>
上级
7aea3c5e
变更
109
显示空白变更内容
内联
并排
Showing
109 changed file
with
1773 addition
and
1056 deletion
+1773
-1056
arkui/ace_ets_component_five/AppScope/app.json
arkui/ace_ets_component_five/AppScope/app.json
+21
-0
arkui/ace_ets_component_five/AppScope/resources/base/element/string.json
...omponent_five/AppScope/resources/base/element/string.json
+8
-0
arkui/ace_ets_component_five/AppScope/resources/base/media/app_icon.png
...component_five/AppScope/resources/base/media/app_icon.png
+0
-0
arkui/ace_ets_component_five/BUILD.gn
arkui/ace_ets_component_five/BUILD.gn
+14
-6
arkui/ace_ets_component_five/Test.json
arkui/ace_ets_component_five/Test.json
+5
-4
arkui/ace_ets_component_five/entry/src/main/config.json
arkui/ace_ets_component_five/entry/src/main/config.json
+0
-118
arkui/ace_ets_component_five/entry/src/main/ets/Application/AbilityStage.ts
...onent_five/entry/src/main/ets/Application/AbilityStage.ts
+9
-0
arkui/ace_ets_component_five/entry/src/main/ets/MainAbility/MainAbility.ts
...ponent_five/entry/src/main/ets/MainAbility/MainAbility.ts
+37
-0
arkui/ace_ets_component_five/entry/src/main/ets/MainAbility/pages/checkbox.ets
...nt_five/entry/src/main/ets/MainAbility/pages/checkbox.ets
+2
-1
arkui/ace_ets_component_five/entry/src/main/ets/MainAbility/pages/index/index.ets
...five/entry/src/main/ets/MainAbility/pages/index/index.ets
+56
-0
arkui/ace_ets_component_five/entry/src/main/ets/MainAbility/pages/positionSetting.ets
.../entry/src/main/ets/MainAbility/pages/positionSetting.ets
+15
-15
arkui/ace_ets_component_five/entry/src/main/ets/MainAbility/pages/second/second.ets
...ve/entry/src/main/ets/MainAbility/pages/second/second.ets
+43
-0
arkui/ace_ets_component_five/entry/src/main/ets/TestAbility/TestAbility.ts
...ponent_five/entry/src/main/ets/TestAbility/TestAbility.ts
+50
-0
arkui/ace_ets_component_five/entry/src/main/ets/TestAbility/pages/index.ets
...onent_five/entry/src/main/ets/TestAbility/pages/index.ets
+3
-5
arkui/ace_ets_component_five/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts
...ve/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts
+16
-16
arkui/ace_ets_component_five/entry/src/main/ets/test/BackgroundAndSizeSettingJsunit.test.ets
...src/main/ets/test/BackgroundAndSizeSettingJsunit.test.ets
+2
-2
arkui/ace_ets_component_five/entry/src/main/ets/test/BorderJsunit.test.ets
...ponent_five/entry/src/main/ets/test/BorderJsunit.test.ets
+2
-2
arkui/ace_ets_component_five/entry/src/main/ets/test/CheckboxGroupJsunit.test.ets
...five/entry/src/main/ets/test/CheckboxGroupJsunit.test.ets
+4
-3
arkui/ace_ets_component_five/entry/src/main/ets/test/CheckboxJsunit.test.ets
...nent_five/entry/src/main/ets/test/CheckboxJsunit.test.ets
+5
-4
arkui/ace_ets_component_five/entry/src/main/ets/test/ColorGradientJsunit.test.ets
...five/entry/src/main/ets/test/ColorGradientJsunit.test.ets
+2
-2
arkui/ace_ets_component_five/entry/src/main/ets/test/EdgeEffectJsunit.test.ets
...nt_five/entry/src/main/ets/test/EdgeEffectJsunit.test.ets
+2
-2
arkui/ace_ets_component_five/entry/src/main/ets/test/EnmusFlexAlignJsunit.test.ets
...ive/entry/src/main/ets/test/EnmusFlexAlignJsunit.test.ets
+2
-2
arkui/ace_ets_component_five/entry/src/main/ets/test/EnmusHorizontalAlignJsunit.test.ets
...try/src/main/ets/test/EnmusHorizontalAlignJsunit.test.ets
+2
-2
arkui/ace_ets_component_five/entry/src/main/ets/test/EnmusImageJsunit.test.ets
...nt_five/entry/src/main/ets/test/EnmusImageJsunit.test.ets
+2
-2
arkui/ace_ets_component_five/entry/src/main/ets/test/EnmusVerticalAlignJsunit.test.ets
...entry/src/main/ets/test/EnmusVerticalAlignJsunit.test.ets
+2
-2
arkui/ace_ets_component_five/entry/src/main/ets/test/FillModeJsunit.test.ets
...nent_five/entry/src/main/ets/test/FillModeJsunit.test.ets
+2
-2
arkui/ace_ets_component_five/entry/src/main/ets/test/OhosMatrix4Jsunit.test.ets
...t_five/entry/src/main/ets/test/OhosMatrix4Jsunit.test.ets
+2
-2
arkui/ace_ets_component_five/entry/src/main/ets/test/PositionSettingJsunit.test.ets
...ve/entry/src/main/ets/test/PositionSettingJsunit.test.ets
+5
-5
arkui/ace_ets_component_five/entry/src/main/ets/test/SelectJsunit.test.ets
...ponent_five/entry/src/main/ets/test/SelectJsunit.test.ets
+2
-2
arkui/ace_ets_component_five/entry/src/main/ets/test/ShapeClippingJsunit.test.ets
...five/entry/src/main/ets/test/ShapeClippingJsunit.test.ets
+2
-2
arkui/ace_ets_component_five/entry/src/main/ets/test/SliderJsunit.test.ets
...ponent_five/entry/src/main/ets/test/SliderJsunit.test.ets
+2
-2
arkui/ace_ets_component_five/entry/src/main/ets/test/TransFormJsunit.test.ets
...ent_five/entry/src/main/ets/test/TransFormJsunit.test.ets
+2
-2
arkui/ace_ets_component_five/entry/src/main/ets/test/VisibilityJsunit.test.ets
...nt_five/entry/src/main/ets/test/VisibilityJsunit.test.ets
+2
-2
arkui/ace_ets_component_five/entry/src/main/module.json
arkui/ace_ets_component_five/entry/src/main/module.json
+35
-0
arkui/ace_ets_component_five/entry/src/main/resources/base/element/string.json
...nt_five/entry/src/main/resources/base/element/string.json
+29
-0
arkui/ace_ets_component_five/entry/src/main/resources/base/profile/main_pages.json
...ive/entry/src/main/resources/base/profile/main_pages.json
+24
-0
arkui/ace_ets_component_three/AppScope/app.json
arkui/ace_ets_component_three/AppScope/app.json
+21
-0
arkui/ace_ets_component_three/AppScope/resources/base/element/string.json
...mponent_three/AppScope/resources/base/element/string.json
+8
-0
arkui/ace_ets_component_three/AppScope/resources/base/media/app_icon.png
...omponent_three/AppScope/resources/base/media/app_icon.png
+0
-0
arkui/ace_ets_component_three/BUILD.gn
arkui/ace_ets_component_three/BUILD.gn
+14
-10
arkui/ace_ets_component_three/Test.json
arkui/ace_ets_component_three/Test.json
+4
-3
arkui/ace_ets_component_three/entry/src/main/config.json
arkui/ace_ets_component_three/entry/src/main/config.json
+0
-131
arkui/ace_ets_component_three/entry/src/main/ets/Application/AbilityStage.ts
...nent_three/entry/src/main/ets/Application/AbilityStage.ts
+9
-0
arkui/ace_ets_component_three/entry/src/main/ets/MainAbility/MainAbility.ts
...onent_three/entry/src/main/ets/MainAbility/MainAbility.ts
+37
-0
arkui/ace_ets_component_three/entry/src/main/ets/MainAbility/images/test.png
...nent_three/entry/src/main/ets/MainAbility/images/test.png
+0
-0
arkui/ace_ets_component_three/entry/src/main/ets/MainAbility/pages/animate.ets
...nt_three/entry/src/main/ets/MainAbility/pages/animate.ets
+179
-97
arkui/ace_ets_component_three/entry/src/main/ets/MainAbility/pages/badge.ets
...nent_three/entry/src/main/ets/MainAbility/pages/badge.ets
+0
-1
arkui/ace_ets_component_three/entry/src/main/ets/MainAbility/pages/index/index.ets
...hree/entry/src/main/ets/MainAbility/pages/index/index.ets
+56
-0
arkui/ace_ets_component_three/entry/src/main/ets/MainAbility/pages/second/second.ets
...ee/entry/src/main/ets/MainAbility/pages/second/second.ets
+43
-0
arkui/ace_ets_component_three/entry/src/main/ets/MainAbility/pages/text.ets
...onent_three/entry/src/main/ets/MainAbility/pages/text.ets
+0
-1
arkui/ace_ets_component_three/entry/src/main/ets/MainAbility/utils/Common.ets
...ent_three/entry/src/main/ets/MainAbility/utils/Common.ets
+51
-0
arkui/ace_ets_component_three/entry/src/main/ets/MainAbility/utils/MessageManager.ets
...e/entry/src/main/ets/MainAbility/utils/MessageManager.ets
+54
-0
arkui/ace_ets_component_three/entry/src/main/ets/TestAbility/TestAbility.ts
...onent_three/entry/src/main/ets/TestAbility/TestAbility.ts
+50
-0
arkui/ace_ets_component_three/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts
...ee/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts
+16
-16
arkui/ace_ets_component_three/entry/src/main/ets/test/AboutToDisappearJsunit.test.ets
...e/entry/src/main/ets/test/AboutToDisappearJsunit.test.ets
+2
-2
arkui/ace_ets_component_three/entry/src/main/ets/test/AnimateJsunit.test.ets
...nent_three/entry/src/main/ets/test/AnimateJsunit.test.ets
+149
-266
arkui/ace_ets_component_three/entry/src/main/ets/test/BackgroundJsunit.test.ets
...t_three/entry/src/main/ets/test/BackgroundJsunit.test.ets
+2
-2
arkui/ace_ets_component_three/entry/src/main/ets/test/BadgeJsunit.test.ets
...ponent_three/entry/src/main/ets/test/BadgeJsunit.test.ets
+18
-17
arkui/ace_ets_component_three/entry/src/main/ets/test/BlankJsunit.test.ets
...ponent_three/entry/src/main/ets/test/BlankJsunit.test.ets
+2
-2
arkui/ace_ets_component_three/entry/src/main/ets/test/ButtonJsunit.test.ets
...onent_three/entry/src/main/ets/test/ButtonJsunit.test.ets
+11
-6
arkui/ace_ets_component_three/entry/src/main/ets/test/Canvas2Jsunit.test.ets
...nent_three/entry/src/main/ets/test/Canvas2Jsunit.test.ets
+2
-2
arkui/ace_ets_component_three/entry/src/main/ets/test/CanvasJsunit.test.ets
...onent_three/entry/src/main/ets/test/CanvasJsunit.test.ets
+2
-2
arkui/ace_ets_component_three/entry/src/main/ets/test/CircleJsunit.test.ets
...onent_three/entry/src/main/ets/test/CircleJsunit.test.ets
+2
-2
arkui/ace_ets_component_three/entry/src/main/ets/test/CommonJsunit.test.ets
...onent_three/entry/src/main/ets/test/CommonJsunit.test.ets
+1
-1
arkui/ace_ets_component_three/entry/src/main/ets/test/GridJsunit.test.ets
...mponent_three/entry/src/main/ets/test/GridJsunit.test.ets
+2
-2
arkui/ace_ets_component_three/entry/src/main/ets/test/LineJsunit.test.ets
...mponent_three/entry/src/main/ets/test/LineJsunit.test.ets
+2
-2
arkui/ace_ets_component_three/entry/src/main/ets/test/List.test.ets
...ets_component_three/entry/src/main/ets/test/List.test.ets
+1
-1
arkui/ace_ets_component_three/entry/src/main/ets/test/LongPressGesture.test.ets
...t_three/entry/src/main/ets/test/LongPressGesture.test.ets
+2
-2
arkui/ace_ets_component_three/entry/src/main/ets/test/MotionPathJsunit.test.ets
...t_three/entry/src/main/ets/test/MotionPathJsunit.test.ets
+2
-2
arkui/ace_ets_component_three/entry/src/main/ets/test/PanGestureJsunit.test.ets
...t_three/entry/src/main/ets/test/PanGestureJsunit.test.ets
+2
-2
arkui/ace_ets_component_three/entry/src/main/ets/test/ParallelGestureJsunit.test.ets
...ee/entry/src/main/ets/test/ParallelGestureJsunit.test.ets
+2
-2
arkui/ace_ets_component_three/entry/src/main/ets/test/PriorityGestureJsunit.test.ets
...ee/entry/src/main/ets/test/PriorityGestureJsunit.test.ets
+2
-2
arkui/ace_ets_component_three/entry/src/main/ets/test/ProgressJsunit.test.ets
...ent_three/entry/src/main/ets/test/ProgressJsunit.test.ets
+2
-2
arkui/ace_ets_component_three/entry/src/main/ets/test/QrCodeJsunit.test.ets
...onent_three/entry/src/main/ets/test/QrCodeJsunit.test.ets
+2
-2
arkui/ace_ets_component_three/entry/src/main/ets/test/RatingJsunit.test.ets
...onent_three/entry/src/main/ets/test/RatingJsunit.test.ets
+2
-2
arkui/ace_ets_component_three/entry/src/main/ets/test/ResponseRegionJsunit.test.ets
...ree/entry/src/main/ets/test/ResponseRegionJsunit.test.ets
+2
-2
arkui/ace_ets_component_three/entry/src/main/ets/test/ScrollCodeJsunit.test.ets
...t_three/entry/src/main/ets/test/ScrollCodeJsunit.test.ets
+2
-2
arkui/ace_ets_component_three/entry/src/main/ets/test/ShapeJsunit.test.ets
...ponent_three/entry/src/main/ets/test/ShapeJsunit.test.ets
+31
-30
arkui/ace_ets_component_three/entry/src/main/ets/test/SharedTransitionJsunit.test.ets
...e/entry/src/main/ets/test/SharedTransitionJsunit.test.ets
+11
-6
arkui/ace_ets_component_three/entry/src/main/ets/test/SpanJsunit.test.ets
...mponent_three/entry/src/main/ets/test/SpanJsunit.test.ets
+5
-5
arkui/ace_ets_component_three/entry/src/main/ets/test/TabsJsunit.test.ets
...mponent_three/entry/src/main/ets/test/TabsJsunit.test.ets
+2
-2
arkui/ace_ets_component_three/entry/src/main/ets/test/TapGesture.test.ets
...mponent_three/entry/src/main/ets/test/TapGesture.test.ets
+2
-2
arkui/ace_ets_component_three/entry/src/main/ets/test/TextJsunit.test.ets
...mponent_three/entry/src/main/ets/test/TextJsunit.test.ets
+5
-11
arkui/ace_ets_component_three/entry/src/main/ets/test/TimeStampJsunit.test.ets
...nt_three/entry/src/main/ets/test/TimeStampJsunit.test.ets
+2
-2
arkui/ace_ets_component_three/entry/src/main/ets/test/ToggleJsunit.test.ets
...onent_three/entry/src/main/ets/test/ToggleJsunit.test.ets
+2
-2
arkui/ace_ets_component_three/entry/src/main/ets/test/TransitionJsunit.test.ets
...t_three/entry/src/main/ets/test/TransitionJsunit.test.ets
+2
-2
arkui/ace_ets_component_three/entry/src/main/module.json
arkui/ace_ets_component_three/entry/src/main/module.json
+35
-0
arkui/ace_ets_component_three/entry/src/main/resources/base/element/string.json
...t_three/entry/src/main/resources/base/element/string.json
+29
-1
arkui/ace_ets_component_three/entry/src/main/resources/base/profile/main_pages.json
...ree/entry/src/main/resources/base/profile/main_pages.json
+38
-0
arkui/ace_ets_dev/AppScope/app.json
arkui/ace_ets_dev/AppScope/app.json
+21
-0
arkui/ace_ets_dev/AppScope/resources/base/element/string.json
...i/ace_ets_dev/AppScope/resources/base/element/string.json
+8
-0
arkui/ace_ets_dev/AppScope/resources/base/media/app_icon.png
arkui/ace_ets_dev/AppScope/resources/base/media/app_icon.png
+0
-0
arkui/ace_ets_dev/BUILD.gn
arkui/ace_ets_dev/BUILD.gn
+18
-11
arkui/ace_ets_dev/Test.json
arkui/ace_ets_dev/Test.json
+2
-2
arkui/ace_ets_dev/entry/src/main/config.json
arkui/ace_ets_dev/entry/src/main/config.json
+0
-101
arkui/ace_ets_dev/entry/src/main/ets/Application/AbilityStage.ts
...ce_ets_dev/entry/src/main/ets/Application/AbilityStage.ts
+9
-0
arkui/ace_ets_dev/entry/src/main/ets/MainAbility/MainAbility.ts
...ace_ets_dev/entry/src/main/ets/MainAbility/MainAbility.ts
+37
-0
arkui/ace_ets_dev/entry/src/main/ets/MainAbility/app.ets
arkui/ace_ets_dev/entry/src/main/ets/MainAbility/app.ets
+0
-33
arkui/ace_ets_dev/entry/src/main/ets/MainAbility/pages/index/index.ets
..._dev/entry/src/main/ets/MainAbility/pages/index/index.ets
+56
-0
arkui/ace_ets_dev/entry/src/main/ets/MainAbility/pages/second/second.ets
...ev/entry/src/main/ets/MainAbility/pages/second/second.ets
+43
-0
arkui/ace_ets_dev/entry/src/main/ets/MainAbility/utils/Common.ets
...e_ets_dev/entry/src/main/ets/MainAbility/utils/Common.ets
+51
-0
arkui/ace_ets_dev/entry/src/main/ets/MainAbility/utils/MessageManager.ets
...v/entry/src/main/ets/MainAbility/utils/MessageManager.ets
+54
-0
arkui/ace_ets_dev/entry/src/main/ets/TestAbility/TestAbility.ts
...ace_ets_dev/entry/src/main/ets/TestAbility/TestAbility.ts
+50
-0
arkui/ace_ets_dev/entry/src/main/ets/TestAbility/app.ets
arkui/ace_ets_dev/entry/src/main/ets/TestAbility/app.ets
+0
-33
arkui/ace_ets_dev/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts
...ev/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts
+17
-17
arkui/ace_ets_dev/entry/src/main/ets/test/CurveJsunit.test.ets
.../ace_ets_dev/entry/src/main/ets/test/CurveJsunit.test.ets
+3
-3
arkui/ace_ets_dev/entry/src/main/module.json
arkui/ace_ets_dev/entry/src/main/module.json
+35
-0
arkui/ace_ets_dev/entry/src/main/resources/base/element/string.json
...ets_dev/entry/src/main/resources/base/element/string.json
+28
-0
arkui/ace_ets_dev/entry/src/main/resources/base/profile/main_pages.json
...dev/entry/src/main/resources/base/profile/main_pages.json
+8
-0
未找到文件。
arkui/ace_ets_component_five/AppScope/app.json
0 → 100644
浏览文件 @
5371fdba
{
"app"
:
{
"bundleName"
:
"com.open.harmony.acetestfive"
,
"vendor"
:
"huawei"
,
"versionCode"
:
1000000
,
"versionName"
:
"1.0.0"
,
"debug"
:
false
,
"icon"
:
"$media:icon"
,
"label"
:
"$string:app_name"
,
"description"
:
"$string:description_application"
,
"distributedNotificationEnabled"
:
true
,
"keepAlive"
:
true
,
"singleUser"
:
true
,
"minAPIVersion"
:
10
,
"targetAPIVersion"
:
10
,
"car"
:
{
"apiCompatibleVersion"
:
10
,
"singleUser"
:
false
}
}
}
\ No newline at end of file
arkui/ace_ets_component_five/AppScope/resources/base/element/string.json
0 → 100644
浏览文件 @
5371fdba
{
"string"
:[
{
"name"
:
"app_name"
,
"value"
:
"ohosProject"
}
]
}
\ No newline at end of file
arkui/ace_ets_component_five/AppScope/resources/base/media/app_icon.png
0 → 100644
浏览文件 @
5371fdba
15.1 KB
arkui/ace_ets_component_five/BUILD.gn
浏览文件 @
5371fdba
...
...
@@ -14,25 +14,33 @@
import("//test/xts/tools/build/suite.gni")
ohos_js_hap_suite("ActsAceEtsComponentFiveTest") {
hap_profile = "./entry/src/main/config.json"
hap_profile = "entry/src/main/module.json"
js_build_mode = "debug"
deps = [
":ace_ets_component_assets",
":ace_ets_component_resources",
":ace_ets_component_test_assets",
]
ets2abc = true
certificate_profile = "
./
signature/openharmony_sx.p7b"
certificate_profile = "signature/openharmony_sx.p7b"
hap_name = "ActsAceEtsComponentFiveTest"
subsystem_name = "arkui"
part_name = "ace_engine"
}
ohos_app_scope("ace_ets_component_app_profile") {
app_profile = "AppScope/app.json"
sources = [ "AppScope/resources" ]
}
ohos_js_assets("ace_ets_component_assets") {
source_dir = "./entry/src/main/ets/MainAbility"
}
ohos_js_assets("ace_ets_component_test_assets") {
source_dir = "
./entry/src/main/ets/TestAbility
"
source_dir = "
entry/src/main/ets
"
}
ohos_resources("ace_ets_component_resources") {
sources = [ "./entry/src/main/resources" ]
hap_profile = "./entry/src/main/config.json"
sources = [ "entry/src/main/resources" ]
deps = [ ":ace_ets_component_app_profile" ]
hap_profile = "entry/src/main/module.json"
}
arkui/ace_ets_component_five/Test.json
浏览文件 @
5371fdba
{
"description"
:
"Configuration for
aceceshi
Tests"
,
"description"
:
"Configuration for
hjunit demo
Tests"
,
"driver"
:
{
"type"
:
"OHJSUnitTest"
,
"test-timeout"
:
"700000"
,
"bundle-name"
:
"com.open.harmony.acetestfive"
,
"package-name"
:
"com.open.harmony.acetestfive"
,
"shell-timeout"
:
"700000"
"module-name"
:
"phone"
,
"shell-timeout"
:
"700000"
,
"testcase-timeout"
:
"180000"
},
"kits"
:
[
{
...
...
arkui/ace_ets_component_five/entry/src/main/config.json
已删除
100644 → 0
浏览文件 @
7aea3c5e
{
"app"
:
{
"bundleName"
:
"com.open.harmony.acetestfive"
,
"vendor"
:
"open"
,
"version"
:
{
"code"
:
1000000
,
"name"
:
"1.0.0"
},
"apiVersion"
:
{
"compatible"
:
7
,
"releaseType"
:
"Release"
,
"target"
:
8
}
},
"deviceConfig"
:
{},
"module"
:
{
"package"
:
"com.open.harmony.acetestfive"
,
"name"
:
".MyApplication"
,
"mainAbility"
:
"com.open.harmony.acetestfive.MainAbility"
,
"deviceType"
:
[
"tablet"
,
"default"
,
"phone"
],
"distro"
:
{
"deliveryWithInstall"
:
true
,
"moduleName"
:
"entry"
,
"moduleType"
:
"entry"
,
"installationFree"
:
false
},
"abilities"
:
[
{
"skills"
:
[
{
"entities"
:
[
"entity.system.home"
],
"actions"
:
[
"action.system.home"
]
}
],
"orientation"
:
"unspecified"
,
"visible"
:
true
,
"srcPath"
:
"MainAbility"
,
"name"
:
".MainAbility"
,
"srcLanguage"
:
"ets"
,
"icon"
:
"$media:icon"
,
"description"
:
"$string:description_mainability"
,
"formsEnabled"
:
false
,
"label"
:
"$string:entry_MainAbility"
,
"type"
:
"page"
,
"launchType"
:
"standard"
},
{
"orientation"
:
"unspecified"
,
"visible"
:
true
,
"srcPath"
:
"TestAbility"
,
"name"
:
".TestAbility"
,
"srcLanguage"
:
"ets"
,
"icon"
:
"$media:icon"
,
"description"
:
"$string:TestAbility_desc"
,
"formsEnabled"
:
false
,
"label"
:
"$string:TestAbility_label"
,
"type"
:
"page"
,
"launchType"
:
"standard"
}
],
"js"
:
[
{
"mode"
:
{
"syntax"
:
"ets"
,
"type"
:
"pageAbility"
},
"pages"
:
[
"pages/index"
,
"pages/checkbox"
,
"pages/enumsImage"
,
"pages/fillMode"
,
"pages/ohosMatrix4"
,
"pages/select"
,
"pages/colorGradient"
,
"pages/checkboxGroup"
,
"pages/edgeEffect"
,
"pages/slider"
,
"pages/backgroundAndSizeSetting"
,
"pages/border"
,
"pages/positionSetting"
,
"pages/shapeClipping"
,
"pages/transForm"
,
"pages/visibility"
,
"pages/enumsFlexAlign"
,
"pages/enumsVerticalAlign"
,
"pages/enumsHorizontalAlign"
],
"name"
:
".MainAbility"
,
"window"
:
{
"designWidth"
:
720
,
"autoDesignWidth"
:
false
}
},
{
"mode"
:
{
"syntax"
:
"ets"
,
"type"
:
"pageAbility"
},
"pages"
:
[
"pages/index"
],
"name"
:
".TestAbility"
,
"window"
:
{
"designWidth"
:
720
,
"autoDesignWidth"
:
false
}
}
]
}
}
arkui/ace_ets_component_five/entry/src/main/ets/Application/AbilityStage.ts
0 → 100644
浏览文件 @
5371fdba
import
AbilityStage
from
"
@ohos.app.ability.AbilityStage
"
export
default
class
MyAbilityStage
extends
AbilityStage
{
onCreate
()
{
console
.
log
(
"
[Demo] MyAbilityStage onCreate
"
)
globalThis
.
stageOnCreateRun
=
1
;
globalThis
.
stageContext
=
this
.
context
;
}
}
arkui/ace_ets_component_five/entry/src/main/ets/MainAbility/MainAbility.ts
0 → 100644
浏览文件 @
5371fdba
import
Ability
from
'
@ohos.app.ability.UIAbility
'
export
default
class
MainAbility
extends
Ability
{
onCreate
(
want
,
launchParam
){
// Ability is creating, initialize resources for this ability
console
.
log
(
"
[Demo] MainAbility onCreate
"
)
globalThis
.
abilityWant
=
want
;
}
onDestroy
()
{
// Ability is destroying, release resources for this ability
console
.
log
(
"
[Demo] MainAbility onDestroy
"
)
}
onWindowStageCreate
(
windowStage
)
{
// Main window is created, set main page for this ability
console
.
log
(
"
[Demo] MainAbility onWindowStageCreate windowStage=
"
+
windowStage
)
globalThis
.
windowStage
=
windowStage
globalThis
.
abilityContext
=
this
.
context
windowStage
.
setUIContent
(
this
.
context
,
"
MainAbility/pages/index/index
"
,
null
)
}
onWindowStageDestroy
()
{
//Main window is destroyed, release UI related resources
console
.
log
(
"
[Demo] MainAbility onWindowStageDestroy
"
)
}
onForeground
()
{
// Ability has brought to foreground
console
.
log
(
"
[Demo] MainAbility onForeground
"
)
}
onBackground
()
{
// Ability has back to background
console
.
log
(
"
[Demo] MainAbility onBackground
"
)
}
};
\ No newline at end of file
arkui/ace_ets_component_five/entry/src/main/ets/MainAbility/pages/checkbox.ets
浏览文件 @
5371fdba
// @ts-nocheck
/**
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
...
...
@@ -44,6 +44,7 @@ struct CheckboxExample {
Checkbox({name: 'checkbox1', group: 'checkboxGroup'})
.select(true)
.key('Checkbox1')
.selectedColor(0xed6f21)
.onChange((value: boolean) => {
console.info('Checkbox1 change is'+ value)
...
...
arkui/ace_ets_component_five/entry/src/main/ets/MainAbility/pages/index/index.ets
0 → 100644
浏览文件 @
5371fdba
/*
* Copyright (c) 2021 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';
import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'
import { Hypium } from '@ohos/hypium'
import testsuite from '../../../test/List.test'
@Entry
@Component
struct Index {
aboutToAppear(){
console.info("start run testcase!!!!")
var abilityDelegator: any
abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator()
var abilityDelegatorArguments: any
abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments()
console.info('start run testcase!!!')
Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite)
}
build() {
Flex({ direction:FlexDirection.Column, alignItems:ItemAlign.Center, justifyContent: FlexAlign.Center }) {
Text('Hello World')
.fontSize(50)
.fontWeight(FontWeight.Bold)
Button() {
Text('next page')
.fontSize(25)
.fontWeight(FontWeight.Bold)
}.type(ButtonType.Capsule)
.margin({
top: 20
})
.backgroundColor('#0D9FFB')
.onClick(() => {
})
}
.width('100%')
.height('100%')
}
}
\ No newline at end of file
arkui/ace_ets_component_five/entry/src/main/ets/MainAbility/pages/positionSetting.ets
浏览文件 @
5371fdba
// @ts-nocheck
/**
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
...
...
@@ -18,20 +18,20 @@ import events_emitter from '@ohos.events.emitter';
@Entry
@Component
struct PositionSetting {
@State align: Alignment = Alignment.TopStart;
@State direction: Direction = Direction.Rtl;
@State position1: {x:
string, y: string
} = {x: 25, y: 15};
@State align
T
: Alignment = Alignment.TopStart;
@State direction
T
: Direction = Direction.Rtl;
@State position1: {x:
number, y: number
} = {x: 25, y: 15};
@State position2: {x: string, y: string} = {x: '50%', y: '70%'};
@State anchor: {x:
string, y: string
} = {x: 25, y: 25};
@State offset
: {x: string, y: string
} = {x: 10, y: 15};
@State opacityValue:
string
= 1;
@State anchor: {x:
number, y: number
} = {x: 25, y: 25};
@State offset
T: {x: number, y: number
} = {x: 10, y: 15};
@State opacityValue:
number
= 1;
build() {
Column() {
Column({space: 10}) {
Text('opacity(1)').fontSize(20).fontColor(Color.Black).width('90%').opacity(
`${this.opacityValue}`
).key("opacity")
Text('opacity(1)').fontSize(20).fontColor(Color.Black).width('90%').opacity(
this.opacityValue
).key("opacity")
Text('top start')
.align(this.align)
.align(this.align
T
)
.height(50)
.width('90%')
.fontSize(20)
...
...
@@ -46,7 +46,7 @@ struct PositionSetting {
Text('4').height(50).width('25%').fontSize(20).backgroundColor(0xD2B48C)
}
.width('90%')
.direction(this.direction)
.direction(this.direction
T
)
.key('rowDirection')
Text('position').fontSize(20).fontColor(Color.Black).width('90%')
...
...
@@ -92,10 +92,10 @@ struct PositionSetting {
Text('offset').fontSize(20).fontColor(Color.Black).width('90%')
Row() {
Text('1').size({ width: '15%', height: '100' }).backgroundColor(0xdeb887).border({ width: 1 }).fontSize(20)
Text(`2\noffset(${this.offset
.x}, ${this.offset
.y})`)
Text(`2\noffset(${this.offset
T.x}, ${this.offsetT
.y})`)
.size({ width: 170, height: '50' }).backgroundColor(0xbbb2cb).border({ width: 1 })
.fontSize(20).align(Alignment.Start)
.offset({ x: this.offset
.x, y: this.offset
.y })
.offset({ x: this.offset
T.x, y: this.offsetT
.y })
.key('offset')
Text('3').size({ width: '15%', height: '50' }).backgroundColor(0xdeb887).border({ width: 1 }).fontSize(20)
Text('4\noffset(-10%, 20%)')
...
...
@@ -141,16 +141,16 @@ struct PositionSetting {
console.info("position page stateChangCallBack" + JSON.stringify(eventData));
if (eventData) {
if (eventData.data.textAlign) {
this.align = Alignment.BottomEnd;
this.align
T
= Alignment.BottomEnd;
} else if (eventData.data.direction) {
this.direction = eventData.data.direction;
this.direction
T
= eventData.data.direction;
} else if (eventData.data.position1) {
this.position1 = JSON.parse(eventData.data.position1);
this.position2 = JSON.parse(eventData.data.position2);
} else if (eventData.data.markAnchor) {
this.anchor = JSON.parse(eventData.data.markAnchor);
} else if (eventData.data.offset) {
this.offset = JSON.parse(eventData.data.offset);
this.offset
T
= JSON.parse(eventData.data.offset);
} else if (eventData.data.opacityValue) {
this.opacityValue = eventData.data.opacityValue;
}
...
...
arkui/ace_ets_component_
three/entry/src/main/ets/TestAbility/app
.ets
→
arkui/ace_ets_component_
five/entry/src/main/ets/MainAbility/pages/second/second
.ets
浏览文件 @
5371fdba
// @ts-nocheck
/**
/*
* Copyright (c) 2021 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.
...
...
@@ -13,21 +12,32 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'
import { Hypium } from 'hypium/index'
import testsuite from '../test/List.test'
import router from '@system.router';
export default {
onCreate() {
console.info('Application 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.info('Application onDestroy')
},
@Entry
@Component
struct Second {
private content: string = "Second Page"
build() {
Flex({ direction: FlexDirection.Column,alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) {
Text(`${this.content}`)
.fontSize(50)
.fontWeight(FontWeight.Bold)
Button() {
Text('back to index')
.fontSize(20)
.fontWeight(FontWeight.Bold)
}.type(ButtonType.Capsule)
.margin({
top: 20
})
.backgroundColor('#0D9FFB')
.onClick(() => {
router.back()
})
}
.width('100%')
.height('100%')
}
}
\ No newline at end of file
arkui/ace_ets_component_five/entry/src/main/ets/TestAbility/TestAbility.ts
0 → 100644
浏览文件 @
5371fdba
/*
* 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.app.ability.UIAbility
'
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
.
loadContent
(
"
TestAbility/pages/index
"
,
(
err
,
data
)
=>
{
if
(
err
.
code
)
{
console
.
error
(
'
Failed to load the content. Cause:
'
+
JSON
.
stringify
(
err
));
return
;
}
console
.
info
(
'
Succeeded in loading the content. Data:
'
+
JSON
.
stringify
(
data
))
});
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
arkui/ace_ets_component_five/entry/src/main/ets/TestAbility/pages/index.ets
浏览文件 @
5371fdba
// @ts-nocheck
/**
* Copyright (c) 2021 Huawei Device Co., Ltd.
/*
* 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
...
...
@@ -13,7 +12,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import router from '@
system
.router';
import router from '@
ohos
.router';
@Entry
@Component
...
...
@@ -21,7 +20,6 @@ struct Index {
aboutToAppear() {
console.info('TestAbility index aboutToAppear')
}
@State message: string = 'Hello World'
build() {
Row() {
...
...
arkui/ace_ets_component_five/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts
浏览文件 @
5371fdba
// @ts-nocheck
/**
* Copyright (c) 2021 Huawei Device Co., Ltd.
/*
* 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
...
...
@@ -21,25 +20,25 @@ var abilityDelegatorArguments = undefined
function
translateParamsToString
(
parameters
)
{
const
keySet
=
new
Set
([
'
-s class
'
,
'
-s notClass
'
,
'
-s suite
'
,
'
-s it
Name
'
,
'
-s class
'
,
'
-s notClass
'
,
'
-s suite
'
,
'
-s it
'
,
'
-s level
'
,
'
-s testType
'
,
'
-s size
'
,
'
-s timeout
'
,
'
-s
package
'
'
-s
dryRun
'
])
let
targetParams
=
''
;
for
(
const
key
in
parameters
)
{
if
(
keySet
.
has
(
key
))
{
targetParams
+=
'
'
+
key
+
'
'
+
parameters
[
key
]
targetParams
=
`
${
targetParams
}
${
key
}
${
parameters
[
key
]}
`
}
}
return
targetParams
.
trim
()
}
async
function
onAbilityCreateCallback
()
{
console
.
log
(
'
onAbilityCreateCallback
'
);
console
.
log
(
"
onAbilityCreateCallback
"
);
}
async
function
addAbilityMonitorCallback
(
err
:
any
)
{
console
.
info
(
'
addAbilityMonitorCallback :
'
+
JSON
.
stringify
(
err
))
console
.
info
(
"
addAbilityMonitorCallback :
"
+
JSON
.
stringify
(
err
))
}
export
default
class
OpenHarmonyTestRunner
implements
TestRunner
{
...
...
@@ -47,22 +46,26 @@ export default class OpenHarmonyTestRunner implements TestRunner {
}
onPrepare
()
{
console
.
info
(
'
OpenHarmonyTestRunner OnPrepare
'
)
console
.
info
(
"
OpenHarmonyTestRunner OnPrepare
"
)
}
onRun
()
{
async
onRun
()
{
console
.
log
(
'
OpenHarmonyTestRunner onRun run
'
)
abilityDelegatorArguments
=
AbilityDelegatorRegistry
.
getArguments
()
abilityDelegator
=
AbilityDelegatorRegistry
.
getAbilityDelegator
()
var
testAbilityName
=
abilityDelegatorArguments
.
bundleName
+
'
.MainAbility
'
let
lMonitor
=
{
abilityName
:
testAbilityName
,
onAbilityCreate
:
onAbilityCreateCallback
,
};
var
testAbilityName
=
abilityDelegatorArguments
.
parameters
[
'
-p
'
]
+
'
.MainAbility
'
abilityDelegator
.
addAbilityMonitor
(
lMonitor
,
addAbilityMonitorCallback
)
var
cmd
=
'
aa start -d 0 -a
'
+
testAbilityName
+
'
-b
'
+
abilityDelegatorArguments
.
bundleName
var
cmd
=
'
aa start -d 0 -a
com.open.harmony.acetestfive.MainAbility
'
+
'
-b
'
+
abilityDelegatorArguments
.
bundleName
cmd
+=
'
'
+
translateParamsToString
(
abilityDelegatorArguments
.
parameters
)
var
debug
=
abilityDelegatorArguments
.
parameters
[
"
-D
"
]
if
(
debug
==
'
true
'
)
{
cmd
+=
'
-D
'
}
console
.
info
(
'
cmd :
'
+
cmd
)
abilityDelegator
.
executeShellCommand
(
cmd
,
(
err
:
any
,
d
:
any
)
=>
{
...
...
@@ -70,9 +73,6 @@ export default class OpenHarmonyTestRunner implements TestRunner {
console
.
info
(
'
executeShellCommand : data :
'
+
d
.
stdResult
);
console
.
info
(
'
executeShellCommand : data :
'
+
d
.
exitCode
);
})
console
.
info
(
'
OpenHarmonyTestRunner onRun call abilityDelegator.getAppContext
'
)
var
context
=
abilityDelegator
.
getAppContext
()
console
.
info
(
'
getAppContext :
'
+
JSON
.
stringify
(
context
))
console
.
info
(
'
OpenHarmonyTestRunner onRun end
'
)
}
};
\ No newline at end of file
arkui/ace_ets_component_five/entry/src/main/ets/test/BackgroundAndSizeSettingJsunit.test.ets
浏览文件 @
5371fdba
...
...
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "
hypium/index
"
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "
@ohos/hypium
"
import router from '@system.router';
import events_emitter from '@ohos.events.emitter'
import Utils from './Utils.ets';
...
...
@@ -23,7 +23,7 @@ export default function backgroundAndSizeSettingJsunit() {
beforeEach(async function (done) {
console.info("backgroundAndSizeSetting beforeEach start");
let options = {
uri: 'pages/backgroundAndSizeSetting',
uri: '
MainAbility/
pages/backgroundAndSizeSetting',
}
try {
router.clear();
...
...
arkui/ace_ets_component_five/entry/src/main/ets/test/BorderJsunit.test.ets
浏览文件 @
5371fdba
...
...
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "
hypium/index
"
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "
@ohos/hypium
"
import router from '@system.router';
import events_emitter from '@ohos.events.emitter'
import Utils from './Utils.ets';
...
...
@@ -23,7 +23,7 @@ export default function borderJsunit() {
beforeEach(async function (done) {
console.info("border beforeEach start");
let options = {
uri: 'pages/border',
uri: '
MainAbility/
pages/border',
}
try {
router.clear();
...
...
arkui/ace_ets_component_five/entry/src/main/ets/test/CheckboxGroupJsunit.test.ets
浏览文件 @
5371fdba
...
...
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "
hypium/index
";
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "
@ohos/hypium
";
import router from '@system.router';
import Utils from './Utils';
...
...
@@ -21,7 +21,7 @@ export default function checkboxGroupJsunit() {
describe('checkboxGroupTest', function () {
beforeEach(async function (done) {
let options = {
uri: 'pages/checkboxGroup',
uri: '
MainAbility/
pages/checkboxGroup',
}
try {
router.clear();
...
...
@@ -83,7 +83,8 @@ export default function checkboxGroupJsunit() {
let strJson = getInspectorByKey('CheckboxGroup');
let obj = JSON.parse(strJson);
console.info("testCheckboxGroup_400 component obj is: " + JSON.stringify(obj));
expect(obj.$attrs.borderRadius).assertEqual("0.0vp");
let assertObjet = obj.$attrs.borderRadius;
expect(assertObjet instanceof Object).assertTrue();
console.info('testCheckboxGroup_400 END');
done();
});
...
...
arkui/ace_ets_component_five/entry/src/main/ets/test/CheckboxJsunit.test.ets
浏览文件 @
5371fdba
...
...
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "
hypium/index
"
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "
@ohos/hypium
"
import router from '@system.router';
import Utils from './Utils';
...
...
@@ -21,7 +21,7 @@ export default function checkboxJsunit() {
describe('checkboxTest', function () {
beforeEach(async function (done) {
let options = {
uri: 'pages/checkbox',
uri: '
MainAbility/
pages/checkbox',
}
try {
router.clear();
...
...
@@ -71,8 +71,9 @@ export default function checkboxJsunit() {
await Utils.sleep(1000);
let strJson = getInspectorByKey('Checkbox1');
let obj = JSON.parse(strJson);
console.info("testCheckbox_300 component obj is: " + JSON.stringify(obj));
expect(obj.$attrs.borderRadius).assertEqual("0.0vp");
console.info("testCheckbox_300 component obj is: " + JSON.stringify(obj.$attrs.borderRadius));
let assertObjet = obj.$attrs.borderRadius;
expect(assertObjet instanceof Object).assertTrue();
console.info('testCheckbox_300 END');
done();
});
...
...
arkui/ace_ets_component_five/entry/src/main/ets/test/ColorGradientJsunit.test.ets
浏览文件 @
5371fdba
...
...
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "
hypium/index
"
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "
@ohos/hypium
"
import router from '@system.router';
import events_emitter from '@ohos.events.emitter';
import Utils from './Utils.ets';
...
...
@@ -23,7 +23,7 @@ export default function colorGradientJsunit() {
beforeEach(async function (done) {
console.info("colorGradient beforeEach start");
let options = {
uri: 'pages/colorGradient',
uri: '
MainAbility/
pages/colorGradient',
}
try {
router.clear();
...
...
arkui/ace_ets_component_five/entry/src/main/ets/test/EdgeEffectJsunit.test.ets
浏览文件 @
5371fdba
...
...
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "
hypium/index
"
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "
@ohos/hypium
"
import router from '@system.router';
import Utils from './Utils';
import events_emitter from '@ohos.events.emitter';
...
...
@@ -22,7 +22,7 @@ export default function edgeEffectJsunit(){
describe('edgeEffectTest', function (){
beforeEach(async function (done) {
let options = {
uri: 'pages/edgeEffect',
uri: '
MainAbility/
pages/edgeEffect',
}
try {
router.clear();
...
...
arkui/ace_ets_component_five/entry/src/main/ets/test/EnmusFlexAlignJsunit.test.ets
浏览文件 @
5371fdba
...
...
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "
hypium/index
"
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "
@ohos/hypium
"
import router from '@system.router';
import Utils from './Utils';
...
...
@@ -22,7 +22,7 @@ export default function enumsFlexItemJsunit() {
beforeEach(async function (done) {
console.info('beforeEach ===================enumsFlexItem test beforeEach called===================');
let options = {
uri: 'pages/enumsFlexAlign',
uri: '
MainAbility/
pages/enumsFlexAlign',
}
try {
router.clear();
...
...
arkui/ace_ets_component_five/entry/src/main/ets/test/EnmusHorizontalAlignJsunit.test.ets
浏览文件 @
5371fdba
...
...
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "
hypium/index
"
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "
@ohos/hypium
"
import router from '@system.router';
import Utils from './Utils';
...
...
@@ -22,7 +22,7 @@ export default function enumsVerticalAlignJsunit() {
beforeEach(async function (done) {
console.info('beforeEach ===================enumsHorizontalAlign test beforeEach called===================');
let options = {
uri: 'pages/enumsHorizontalAlign',
uri: '
MainAbility/
pages/enumsHorizontalAlign',
}
try {
router.clear();
...
...
arkui/ace_ets_component_five/entry/src/main/ets/test/EnmusImageJsunit.test.ets
浏览文件 @
5371fdba
...
...
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "
hypium/index
"
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "
@ohos/hypium
"
import router from '@system.router';
import Utils from './Utils';
...
...
@@ -22,7 +22,7 @@ export default function enumsImageJsunit() {
beforeEach(async function (done) {
console.info('beforeEach ===================enumsImage test beforeEach called===================');
let options = {
uri: 'pages/enumsImage',
uri: '
MainAbility/
pages/enumsImage',
}
try {
router.clear();
...
...
arkui/ace_ets_component_five/entry/src/main/ets/test/EnmusVerticalAlignJsunit.test.ets
浏览文件 @
5371fdba
...
...
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "
hypium/index
"
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "
@ohos/hypium
"
import router from '@system.router';
import Utils from './Utils';
...
...
@@ -22,7 +22,7 @@ export default function enumsVerticalAlignJsunit() {
beforeEach(async function (done) {
console.info('beforeEach ===================enumsFlexItem test beforeEach called===================');
let options = {
uri: 'pages/enumsVerticalAlign',
uri: '
MainAbility/
pages/enumsVerticalAlign',
}
try {
router.clear();
...
...
arkui/ace_ets_component_five/entry/src/main/ets/test/FillModeJsunit.test.ets
浏览文件 @
5371fdba
...
...
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "
hypium/index
"
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "
@ohos/hypium
"
import router from '@system.router';
import events_emitter from '@ohos.events.emitter';
import Utils from './Utils';
...
...
@@ -23,7 +23,7 @@ export default function fillModeJsunit(){
beforeEach(async function (done) {
console.info('fillModeTest beforeEach called');
let options = {
uri: 'pages/fillMode',
uri: '
MainAbility/
pages/fillMode',
}
try {
router.clear();
...
...
arkui/ace_ets_component_five/entry/src/main/ets/test/OhosMatrix4Jsunit.test.ets
浏览文件 @
5371fdba
...
...
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "
hypium/index
"
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "
@ohos/hypium
"
import router from '@system.router';
import events_emitter from '@ohos.events.emitter';
import Utils from './Utils';
...
...
@@ -23,7 +23,7 @@ export default function ohosMatrix4Jsunit() {
beforeEach(async function (done) {
console.info("ohosMatrix4 beforeEach start");
let options = {
uri: 'pages/ohosMatrix4',
uri: '
MainAbility/
pages/ohosMatrix4',
}
try {
router.clear();
...
...
arkui/ace_ets_component_five/entry/src/main/ets/test/PositionSettingJsunit.test.ets
浏览文件 @
5371fdba
...
...
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "
hypium/index
"
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "
@ohos/hypium
"
import router from '@system.router';
import events_emitter from '@ohos.events.emitter';
import Utils from './Utils.ets';
...
...
@@ -23,7 +23,7 @@ export default function positionSettingJsunit() {
beforeEach(async function (done) {
console.info("positionSetting beforeEach start");
let options = {
uri: 'pages/positionSetting',
uri: '
MainAbility/
pages/positionSetting',
}
try {
router.clear();
...
...
@@ -52,8 +52,8 @@ export default function positionSettingJsunit() {
let strJson = getInspectorByKey('textAlign');
console.info("[testPositionSetting001] component strJson:" + strJson);
let obj = JSON.parse(strJson);
console.info("[testPositionSetting001] textAlign: " + obj.$attrs.textAlign);
expect(obj.$attrs.textAlign).assertEqual('TextAlign.
Lef
t');
console.info("[testPositionSetting001] textAlign: " + obj.$attrs.textAlign
+ "_" + obj.$attrs.align
);
expect(obj.$attrs.textAlign).assertEqual('TextAlign.
Star
t');
console.info('[testPositionSetting001] END');
done();
});
...
...
@@ -92,7 +92,7 @@ export default function positionSettingJsunit() {
console.info("[testPositionSetting003] component strJson:" + strJson);
let obj = JSON.parse(strJson);
console.info("[testPositionSetting003] textAlign: " + obj.$attrs.textAlign);
expect(obj.$attrs.textAlign).assertEqual("TextAlign.
Righ
t");
expect(obj.$attrs.textAlign).assertEqual("TextAlign.
Star
t");
console.info('[testPositionSetting003] END');
done();
});
...
...
arkui/ace_ets_component_five/entry/src/main/ets/test/SelectJsunit.test.ets
浏览文件 @
5371fdba
...
...
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "
hypium/index
"
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "
@ohos/hypium
"
import router from '@system.router';
import events_emitter from '@ohos.events.emitter';
import Utils from './Utils';
...
...
@@ -22,7 +22,7 @@ export default function selectJsunit() {
describe('appInfoTest_five_2', function () {
beforeEach(async function (done) {
let options = {
uri: 'pages/select',
uri: '
MainAbility/
pages/select',
}
try {
router.clear();
...
...
arkui/ace_ets_component_five/entry/src/main/ets/test/ShapeClippingJsunit.test.ets
浏览文件 @
5371fdba
...
...
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "
hypium/index
"
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "
@ohos/hypium
"
import router from '@system.router';
import events_emitter from '@ohos.events.emitter';
import Utils from './Utils.ets';
...
...
@@ -23,7 +23,7 @@ export default function shapeClippingJsunit() {
beforeEach(async function (done) {
console.info("shapeClipping beforeEach start");
let options = {
uri: 'pages/shapeClipping',
uri: '
MainAbility/
pages/shapeClipping',
}
try {
router.clear();
...
...
arkui/ace_ets_component_five/entry/src/main/ets/test/SliderJsunit.test.ets
浏览文件 @
5371fdba
...
...
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "
hypium/index
"
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "
@ohos/hypium
"
import router from '@system.router';
import events_emitter from '@ohos.events.emitter';
import Utils from './Utils';
...
...
@@ -22,7 +22,7 @@ export default function sliderJsunit() {
describe('appInfoTest_five_3', function () {
beforeEach(async function (done) {
let options = {
uri: 'pages/slider',
uri: '
MainAbility/
pages/slider',
}
try {
router.clear();
...
...
arkui/ace_ets_component_five/entry/src/main/ets/test/TransFormJsunit.test.ets
浏览文件 @
5371fdba
...
...
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "
hypium/index
"
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "
@ohos/hypium
"
import router from '@system.router';
import events_emitter from '@ohos.events.emitter';
import Utils from './Utils';
...
...
@@ -22,7 +22,7 @@ export default function transFormJsunit() {
beforeEach(async function (done) {
console.info("transForm beforeEach start");
let options = {
uri: 'pages/transForm',
uri: '
MainAbility/
pages/transForm',
}
try {
router.clear();
...
...
arkui/ace_ets_component_five/entry/src/main/ets/test/VisibilityJsunit.test.ets
浏览文件 @
5371fdba
...
...
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "
hypium/index
";
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "
@ohos/hypium
";
import router from '@system.router';
import events_emitter from '@ohos.events.emitter';
import Utils from './Utils';
...
...
@@ -22,7 +22,7 @@ export default function visibilityJsunit() {
beforeEach(async function (done) {
console.info("visibility beforeEach start");
let options = {
uri: 'pages/visibility',
uri: '
MainAbility/
pages/visibility',
}
try {
router.clear();
...
...
arkui/ace_ets_component_five/entry/src/main/module.json
0 → 100644
浏览文件 @
5371fdba
{
"module"
:
{
"name"
:
"phone"
,
"type"
:
"entry"
,
"srcEntrance"
:
"./ets/Application/AbilityStage.ts"
,
"description"
:
"$string:phone_entry_dsc"
,
"mainElement"
:
"MainAbility"
,
"deviceTypes"
:
[
"tablet"
,
"default"
,
"phone"
],
"deliveryWithInstall"
:
true
,
"installationFree"
:
false
,
"uiSyntax"
:
"ets"
,
"pages"
:
"$profile:main_pages"
,
"abilities"
:
[{
"name"
:
"com.open.harmony.acetestfive.MainAbility"
,
"srcEntrance"
:
"./ets/MainAbility/MainAbility.ts"
,
"description"
:
"$string:phone_entry_main"
,
"icon"
:
"$media:icon"
,
"label"
:
"$string:entry_label"
,
"visible"
:
true
,
"orientation"
:
"portrait"
,
"skills"
:
[{
"actions"
:
[
"action.system.home"
],
"entities"
:
[
"entity.system.home"
]
}]
}]
}
}
\ No newline at end of file
arkui/ace_ets_component_five/entry/src/main/resources/base/element/string.json
浏览文件 @
5371fdba
...
...
@@ -28,5 +28,34 @@
"name"
:
"message_arrive"
,
"value"
:
"We will arrive at %s."
}
,
{
"name"
:
"phone_entry_dsc"
,
"value"
:
"i am an entry for phone"
},
{
"name"
:
"phone_entry_main"
,
"value"
:
"the phone entry ability"
},
{
"name"
:
"entry_label"
,
"value"
:
"ActsContextTest"
},
{
"name"
:
"form_description"
,
"value"
:
"my form"
},
{
"name"
:
"serviceability_description"
,
"value"
:
"my whether"
},
{
"name"
:
"description_application"
,
"value"
:
"demo for test"
},
{
"name"
:
"app_name"
,
"value"
:
"Demo"
}
]
}
\ No newline at end of file
arkui/ace_ets_component_five/entry/src/main/resources/base/profile/main_pages.json
0 → 100644
浏览文件 @
5371fdba
{
"src"
:
[
"MainAbility/pages/index"
,
"MainAbility/pages/checkbox"
,
"MainAbility/pages/enumsImage"
,
"MainAbility/pages/fillMode"
,
"MainAbility/pages/index/index"
,
"MainAbility/pages/ohosMatrix4"
,
"MainAbility/pages/select"
,
"MainAbility/pages/colorGradient"
,
"MainAbility/pages/checkboxGroup"
,
"MainAbility/pages/edgeEffect"
,
"MainAbility/pages/slider"
,
"MainAbility/pages/backgroundAndSizeSetting"
,
"MainAbility/pages/border"
,
"MainAbility/pages/positionSetting"
,
"MainAbility/pages/shapeClipping"
,
"MainAbility/pages/transForm"
,
"MainAbility/pages/visibility"
,
"MainAbility/pages/enumsFlexAlign"
,
"MainAbility/pages/enumsVerticalAlign"
,
"MainAbility/pages/enumsHorizontalAlign"
]
}
\ No newline at end of file
arkui/ace_ets_component_three/AppScope/app.json
0 → 100644
浏览文件 @
5371fdba
{
"app"
:
{
"bundleName"
:
"com.open.harmony.acetestthree"
,
"vendor"
:
"huawei"
,
"versionCode"
:
1000000
,
"versionName"
:
"1.0.0"
,
"debug"
:
false
,
"icon"
:
"$media:icon"
,
"label"
:
"$string:app_name"
,
"description"
:
"$string:description_application"
,
"distributedNotificationEnabled"
:
true
,
"keepAlive"
:
true
,
"singleUser"
:
true
,
"minAPIVersion"
:
10
,
"targetAPIVersion"
:
10
,
"car"
:
{
"apiCompatibleVersion"
:
10
,
"singleUser"
:
false
}
}
}
\ No newline at end of file
arkui/ace_ets_component_three/AppScope/resources/base/element/string.json
0 → 100644
浏览文件 @
5371fdba
{
"string"
:[
{
"name"
:
"app_name"
,
"value"
:
"ohosProject"
}
]
}
\ No newline at end of file
arkui/ace_ets_component_three/AppScope/resources/base/media/app_icon.png
0 → 100644
浏览文件 @
5371fdba
15.1 KB
arkui/ace_ets_component_three/BUILD.gn
浏览文件 @
5371fdba
# Copyright (c) 202
1
Huawei Device Co., Ltd.
# Copyright (c) 202
2
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
...
...
@@ -14,25 +14,29 @@
import("//test/xts/tools/build/suite.gni")
ohos_js_hap_suite("ActsAceEtsComponentThreeTest") {
hap_profile = "./entry/src/main/config.json"
hap_profile = "entry/src/main/module.json"
js_build_mode = "debug"
deps = [
":ace_ets_component_assets",
":ace_ets_component_resources",
":ace_ets_component_test_assets",
]
ets2abc = true
certificate_profile = "
./
signature/openharmony_sx.p7b"
certificate_profile = "signature/openharmony_sx.p7b"
hap_name = "ActsAceEtsComponentThreeTest"
subsystem_name = "arkui"
part_name = "ace_engine"
}
ohos_js_assets("ace_ets_component_assets") {
source_dir = "./entry/src/main/ets/MainAbility"
ohos_app_scope("ace_ets_component_app_profile") {
app_profile = "AppScope/app.json"
sources = [ "AppScope/resources" ]
}
ohos_js_assets("ace_ets_component_test_assets") {
source_dir = "./entry/src/main/ets/TestAbility"
ohos_js_assets("ace_ets_component_assets") {
source_dir = "entry/src/main/ets"
}
ohos_resources("ace_ets_component_resources") {
sources = [ "./entry/src/main/resources" ]
hap_profile = "./entry/src/main/config.json"
sources = [ "entry/src/main/resources" ]
deps = [ ":ace_ets_component_app_profile" ]
hap_profile = "entry/src/main/module.json"
}
arkui/ace_ets_component_three/Test.json
浏览文件 @
5371fdba
{
"description"
:
"Configuration for
aceceshi
Tests"
,
"description"
:
"Configuration for
hjunit demo
Tests"
,
"driver"
:
{
"type"
:
"OHJSUnitTest"
,
"test-timeout"
:
"1200000"
,
"bundle-name"
:
"com.open.harmony.acetestthree"
,
"package-name"
:
"com.open.harmony.acetestthree"
,
"module-name"
:
"phone"
,
"shell-timeout"
:
"1200000"
},
"kits"
:
[
...
...
arkui/ace_ets_component_three/entry/src/main/config.json
已删除
100644 → 0
浏览文件 @
7aea3c5e
{
"app"
:
{
"bundleName"
:
"com.open.harmony.acetestthree"
,
"vendor"
:
"open"
,
"version"
:
{
"code"
:
1000000
,
"name"
:
"1.0.0"
},
"apiVersion"
:
{
"compatible"
:
7
,
"releaseType"
:
"Release"
,
"target"
:
8
}
},
"deviceConfig"
:
{},
"module"
:
{
"package"
:
"com.open.harmony.acetestthree"
,
"name"
:
".MyApplication"
,
"mainAbility"
:
"com.open.harmony.acetestthree.MainAbility"
,
"deviceType"
:
[
"tablet"
,
"default"
,
"phone"
],
"distro"
:
{
"deliveryWithInstall"
:
true
,
"moduleName"
:
"entry"
,
"moduleType"
:
"entry"
,
"installationFree"
:
false
},
"abilities"
:
[
{
"skills"
:
[
{
"entities"
:
[
"entity.system.home"
],
"actions"
:
[
"action.system.home"
]
}
],
"orientation"
:
"unspecified"
,
"visible"
:
true
,
"srcPath"
:
"MainAbility"
,
"name"
:
".MainAbility"
,
"srcLanguage"
:
"ets"
,
"icon"
:
"$media:icon"
,
"description"
:
"$string:description_mainability"
,
"formsEnabled"
:
false
,
"label"
:
"$string:entry_MainAbility"
,
"type"
:
"page"
,
"launchType"
:
"standard"
},
{
"orientation"
:
"unspecified"
,
"visible"
:
true
,
"srcPath"
:
"TestAbility"
,
"name"
:
".TestAbility"
,
"srcLanguage"
:
"ets"
,
"icon"
:
"$media:icon"
,
"description"
:
"$string:TestAbility_desc"
,
"formsEnabled"
:
false
,
"label"
:
"$string:TestAbility_label"
,
"type"
:
"page"
,
"launchType"
:
"standard"
}
],
"js"
:
[
{
"mode"
:
{
"syntax"
:
"ets"
,
"type"
:
"pageAbility"
},
"pages"
:
[
"pages/index"
,
"pages/toggle"
,
"pages/gridPage"
,
"pages/span"
,
"pages/text"
,
"pages/badge"
,
"pages/canvas"
,
"pages/longPressGesture"
,
"pages/button"
,
"pages/ResponseRegion"
,
"pages/PanGesture"
,
"pages/background"
,
"pages/QrCode"
,
"pages/tabs"
,
"pages/tapGesture"
,
"pages/progress"
,
"pages/animate"
,
"pages/rating"
,
"pages/canvas2"
,
"pages/shape"
,
"pages/motionPath"
,
"pages/scrollCode"
,
"pages/transition"
,
"pages/priorityGesture"
,
"pages/parallelGesture"
,
"pages/blank"
,
"pages/sharedTransition"
,
"pages/sharedTransition2"
,
"pages/line"
,
"pages/circle"
,
"pages/aboutToDisappear"
,
"pages/timeStamp"
],
"name"
:
".MainAbility"
,
"window"
:
{
"designWidth"
:
720
,
"autoDesignWidth"
:
false
}
},
{
"mode"
:
{
"syntax"
:
"ets"
,
"type"
:
"pageAbility"
},
"pages"
:
[
"pages/index"
],
"name"
:
".TestAbility"
,
"window"
:
{
"designWidth"
:
720
,
"autoDesignWidth"
:
false
}
}
]
}
}
arkui/ace_ets_component_three/entry/src/main/ets/Application/AbilityStage.ts
0 → 100644
浏览文件 @
5371fdba
import
AbilityStage
from
"
@ohos.app.ability.AbilityStage
"
export
default
class
MyAbilityStage
extends
AbilityStage
{
onCreate
()
{
console
.
log
(
"
[Demo] MyAbilityStage onCreate
"
)
globalThis
.
stageOnCreateRun
=
1
;
globalThis
.
stageContext
=
this
.
context
;
}
}
arkui/ace_ets_component_three/entry/src/main/ets/MainAbility/MainAbility.ts
0 → 100644
浏览文件 @
5371fdba
import
Ability
from
'
@ohos.app.ability.UIAbility
'
export
default
class
MainAbility
extends
Ability
{
onCreate
(
want
,
launchParam
){
// Ability is creating, initialize resources for this ability
console
.
log
(
"
[Demo] MainAbility onCreate
"
)
globalThis
.
abilityWant
=
want
;
}
onDestroy
()
{
// Ability is destroying, release resources for this ability
console
.
log
(
"
[Demo] MainAbility onDestroy
"
)
}
onWindowStageCreate
(
windowStage
)
{
// Main window is created, set main page for this ability
console
.
log
(
"
[Demo] MainAbility onWindowStageCreate windowStage=
"
+
windowStage
)
globalThis
.
windowStage
=
windowStage
globalThis
.
abilityContext
=
this
.
context
windowStage
.
setUIContent
(
this
.
context
,
"
MainAbility/pages/index/index
"
,
null
)
}
onWindowStageDestroy
()
{
//Main window is destroyed, release UI related resources
console
.
log
(
"
[Demo] MainAbility onWindowStageDestroy
"
)
}
onForeground
()
{
// Ability has brought to foreground
console
.
log
(
"
[Demo] MainAbility onForeground
"
)
}
onBackground
()
{
// Ability has back to background
console
.
log
(
"
[Demo] MainAbility onBackground
"
)
}
};
\ No newline at end of file
arkui/ace_ets_component_three/entry/src/main/ets/MainAbility/images/test.png
0 → 100644
浏览文件 @
5371fdba
102.4 KB
arkui/ace_ets_component_three/entry/src/main/ets/MainAbility/pages/animate.ets
浏览文件 @
5371fdba
// @ts-nocheck
/**
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
...
...
@@ -14,10 +13,12 @@
* limitations under the License.
*/
import events_emitter from '@ohos.events.emitter'
import {MessageManager,Callback} from '../utils/MessageManager';
@Entry
@Component
struct AnimationExample {
@State show:string = "btShow"
@State btn1: boolean = false
@State duration: number = 100
@State curve: string = 'Ease'
...
...
@@ -25,113 +26,110 @@ struct AnimationExample {
@State tempo: number= 1000
@State playmode: PlayMode = PlayMode.Normal
messageManager:MessageManager = new MessageManager()
onPageShow() {
console.info('animate page show called');
var stateChangeEvent = {
eventId: 50,
priority: events_emitter.EventPriority.LOW
globalThis.value = {
name:'messageManager',message:this.messageManager
}
events_emitter.on(stateChangeEvent, this.stateChangCallBack)
var stateChangeEventa = {
eventId: 1011,
priority: events_emitter.EventPriority.LOW
let callback:Callback = (message:any) => {
console.error('message = ' + message.name + "--" + message.value)
if (message.name == 'duration') {
this.duration = message.value
}
events_emitter.on(stateChangeEventa, this.stateChangCallBack)
var stateChangeEventb = {
eventId: 1012,
priority: events_emitter.EventPriority.LOW
if (message.name == 'curve') {
this.curve = message.value
}
events_emitter.on(stateChangeEventb, this.stateChangCallBack)
var stateChangeEventc = {
eventId: 1013,
priority: events_emitter.EventPriority.LOW
if (message.name == 'iteration') {
this.iteration = message.value
}
events_emitter.on(stateChangeEventc, this.stateChangCallBack)
var stateChangeEventd = {
eventId: 1014,
priority: events_emitter.EventPriority.LOW
if (message.name == 'tempo') {
this.tempo = message.value
}
events_emitter.on(stateChangeEventd, this.stateChangCallBack)
var stateChangeEvente = {
eventId: 1015,
priority: events_emitter.EventPriority.LOW
if (message.name == 'playmode') {
this.playmode = message.value
}
events_emitter.on(stateChangeEvente, this.stateChangCallBack)
var stateChangeEventf = {
eventId: 1016,
priority: events_emitter.EventPriority.LOW
}
events_emitter.on(stateChangeEventf, this.stateChangCallBack)
var stateChangeEventg = {
eventId: 1017,
priority: events_emitter.EventPriority.LOW
this.messageManager.registerCallback(callback)
}
events_emitter.on(stateChangeEventg, this.stateChangCallBack)
var stateChangeEventh = {
eventId: 1018,
priority: events_emitter.EventPriority.LOW
}
events_emitter.on(stateChangeEventh, this.stateChangCallBack)
var stateChangeEventi = {
eventId: 1019,
priority: events_emitter.EventPriority.LOW
}
events_emitter.on(stateChangeEventi, this.stateChangCallBack)
var stateChangeEventj = {
eventId: 1020,
priority: events_emitter.EventPriority.LOW
}
events_emitter.on(stateChangeEventj, this.stateChangCallBack)
build() {
Column(){
Button(this.show)
.backgroundColor(0x317aff)
.width(80)
.height(30)
.backgroundColor(0x317aff)
.margin({ bottom: 20 })
.key('button1')
.onClick(() => {
try {
var backData = {
data: {
"duration": this.duration,
}
private stateChangCallBack = (eventData) => {
if (eventData != null) {
console.info("animate page state change called:" + JSON.stringify(eventData));
if (eventData.data.duration != null) {
this.duration = parseInt(eventData.data.duration);
}
if (eventData.data.curve != null) {
this.curve = eventData.data.curve;
var backEvent = {
eventId: 51,
priority: events_emitter.EventPriority.LOW
}
if (eventData.data.tempo != null) {
this.tempo = parseInt(eventData.data.tempo);
console.info("button1 start to emit action state")
events_emitter.emit(backEvent, backData)
} catch (err) {
console.info("button1 emit action state err: " + JSON.stringify(err.message))
}
if (eventData.data.iteration != null) {
this.iteration = parseInt(eventData.data.iteration);
console.info("button1 animateTo START")
console.info("button1 duration value is : " + this.duration)
animateTo({ duration: this.duration }, () => {
console.info("button1 duration test animateTo START")
})
})
Button(this.show)
.backgroundColor(0x317aff)
.width(80)
.height(30)
.backgroundColor(0x317aff)
.margin({ bottom: 20 })
.key('button11')
.onClick(() => {
try {
var backData = {
data: {
"duration": this.duration,
}
if (eventData.data.playmode != null) {
this.playmode = eventData.data.playmode;
}
var backEvent = {
eventId: 151,
priority: events_emitter.EventPriority.LOW
}
console.info("button1 start to emit action state")
events_emitter.emit(backEvent, backData)
} catch (err) {
console.info("button1 emit action state err: " + JSON.stringify(err.message))
}
build() {
Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, }) {
console.info("button1 animateTo START")
console.info("button1 duration value is : " + this.duration)
animateTo({ duration: this.duration }, () => {
console.info("button1 duration test animateTo START")
})
})
Button(this.show)
.backgroundColor(0x317aff)
.width(80)
.height(30)
.backgroundColor(0x317aff)
.margin({ bottom: 20 })
.key('button1')
.key('button1
2
')
.onClick(() => {
try {
var backData = {
data: {
"
duration": this.duration
,
"
curve": this.curve
,
}
}
var backEvent = {
eventId:
51
,
eventId:
152
,
priority: events_emitter.EventPriority.LOW
}
console.info("button1 start to emit action state")
...
...
@@ -201,6 +199,34 @@ struct AnimationExample {
console.info("button3 iterations test animateTo START")
})
})
Button(this.show)
.width(80)
.height(30)
.backgroundColor(0x317aff)
.margin({ bottom: 20 })
.key('button13')
.onClick(() => {
try {
var backDataTwo = {
data: {
"iterations": this.iteration,
}
}
var backEventTwo = {
eventId: 153,
priority: events_emitter.EventPriority.LOW
}
console.info("button3 start to emit action state")
events_emitter.emit(backEventTwo, backDataTwo)
} catch (err) {
console.info("button3 emit action state err: " + JSON.stringify(err.message))
}
console.info("button3 animateTo START")
console.info("button3 iteration value is : " + this.iteration)
animateTo({ iterations: this.iteration }, () => {
console.info("button3 iterations test animateTo START")
})
})
Button(this.show)
.width(80)
.height(30)
...
...
@@ -229,6 +255,34 @@ struct AnimationExample {
console.info("button4 tempo test animateTo START")
})
})
Button(this.show)
.width(80)
.height(30)
.backgroundColor(0x317aff)
.margin({ bottom: 20 })
.key('button14')
.onClick(() => {
try {
var backDataThree = {
data: {
"tempo": this.tempo
}
}
var backEventThree = {
eventId: 154,
priority: events_emitter.EventPriority.LOW
}
console.info("button4 start to emit action state")
events_emitter.emit(backEventThree, backDataThree)
} catch (err) {
console.info("button4 emit action state err: " + JSON.stringify(err.message))
}
console.info("button4 animateTo START")
console.info("button4 tempo value is : " + this.duration)
animateTo({ tempo: this.tempo }, () => {
console.info("button4 tempo test animateTo START")
})
})
Button(this.show)
.width(80)
.height(30)
...
...
@@ -253,7 +307,35 @@ struct AnimationExample {
}
console.info("button5 animateTo START")
console.info("button5 playmode value is : " + this.playmode)
animateTo({ PlayMode: this.playmode }, () => {
animateTo({playMode:PlayMode.Normal}, () => {
console.info("button5 playMode test animateTo START")
})
})
Button(this.show)
.width(80)
.height(30)
.backgroundColor(0x317aff)
.margin({ bottom: 20 })
.key('button15')
.onClick(() => {
try {
var backDataFour = {
data: {
"playmode": this.playmode,
}
}
var backEventFour = {
eventId: 155,
priority: events_emitter.EventPriority.LOW
}
console.info("button5 start to emit action state")
events_emitter.emit(backEventFour, backDataFour)
} catch (err) {
console.info("button5 emit action state err: " + JSON.stringify(err.message))
}
console.info("button5 animateTo START")
console.info("button5 playmode value is : " + this.playmode)
animateTo({playMode:PlayMode.Normal}, () => {
console.info("button5 playMode test animateTo START")
})
})
...
...
@@ -323,7 +405,7 @@ struct AnimationExample {
try {
var backData = {
data: {
"
duration": this.duration
,
"
curve": this.curve
,
}
}
var backEvent = {
...
...
@@ -351,7 +433,7 @@ struct AnimationExample {
try {
var backData = {
data: {
"
duration": this.duration
,
"
curve": this.curve
,
}
}
var backEvent = {
...
...
@@ -379,7 +461,7 @@ struct AnimationExample {
try {
var backData = {
data: {
"
duration": this.du
ration,
"
iteration": this.ite
ration,
}
}
var backEvent = {
...
...
@@ -402,12 +484,12 @@ struct AnimationExample {
.height(30)
.backgroundColor(0x317aff)
.margin({ bottom: 20 })
.key('button11')
.key('button11
1
')
.onClick(() => {
try {
var backData = {
data: {
"
duration": this.du
ration,
"
iteration": this.ite
ration,
}
}
var backEvent = {
...
...
@@ -430,12 +512,12 @@ struct AnimationExample {
.height(30)
.backgroundColor(0x317aff)
.margin({ bottom: 20 })
.key('button12')
.key('button12
1
')
.onClick(() => {
try {
var backData = {
data: {
"
duration": this.duration
,
"
tempo": this.tempo
,
}
}
var backEvent = {
...
...
@@ -458,12 +540,12 @@ struct AnimationExample {
.height(30)
.backgroundColor(0x317aff)
.margin({ bottom: 20 })
.key('button13')
.key('button13
1
')
.onClick(() => {
try {
var backData = {
data: {
"
duration": this.duration
,
"
tempo": this.tempo
,
}
}
var backEvent = {
...
...
@@ -486,12 +568,12 @@ struct AnimationExample {
.height(30)
.backgroundColor(0x317aff)
.margin({ bottom: 20 })
.key('button14')
.key('button14
1
')
.onClick(() => {
try {
var backData = {
data: {
"
duration": this.duration
,
"
playmode": this.playmode
,
}
}
var backEvent = {
...
...
@@ -514,12 +596,12 @@ struct AnimationExample {
.height(30)
.backgroundColor(0x317aff)
.margin({ bottom: 20 })
.key('button15')
.key('button15
1
')
.onClick(() => {
try {
var backData = {
data: {
"
duration": this.duration
,
"
playmode": this.playmode
,
}
}
var backEvent = {
...
...
@@ -537,6 +619,6 @@ struct AnimationExample {
console.info("button15 duration test animateTo START")
})
})
}.height(
400).width("100%").padding({ top: 100 }
)
}.height(
"%100").width("100%"
)
}
}
\ No newline at end of file
arkui/ace_ets_component_three/entry/src/main/ets/MainAbility/pages/badge.ets
浏览文件 @
5371fdba
// @ts-nocheck
/**
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
...
...
arkui/ace_ets_component_three/entry/src/main/ets/MainAbility/pages/index/index.ets
0 → 100644
浏览文件 @
5371fdba
/*
* Copyright (c) 2021 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';
import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'
import { Hypium } from '@ohos/hypium'
import testsuite from '../../../test/List.test'
@Entry
@Component
struct Index {
aboutToAppear(){
console.info("start run testcase!!!!")
var abilityDelegator: any
abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator()
var abilityDelegatorArguments: any
abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments()
console.info('start run testcase!!!')
Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite)
}
build() {
Flex({ direction:FlexDirection.Column, alignItems:ItemAlign.Center, justifyContent: FlexAlign.Center }) {
Text('Hello World')
.fontSize(50)
.fontWeight(FontWeight.Bold)
Button() {
Text('next page')
.fontSize(25)
.fontWeight(FontWeight.Bold)
}.type(ButtonType.Capsule)
.margin({
top: 20
})
.backgroundColor('#0D9FFB')
.onClick(() => {
})
}
.width('100%')
.height('100%')
}
}
\ No newline at end of file
arkui/ace_ets_component_
five/entry/src/main/ets/MainAbility/app
.ets
→
arkui/ace_ets_component_
three/entry/src/main/ets/MainAbility/pages/second/second
.ets
浏览文件 @
5371fdba
// @ts-nocheck
/**
/*
* Copyright (c) 2021 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.
...
...
@@ -13,21 +12,32 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'
import { Hypium } from 'hypium/index'
import testsuite from '../test/List.test'
import router from '@system.router';
export default {
onCreate() {
console.info('Application 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.info('Application onDestroy')
},
@Entry
@Component
struct Second {
private content: string = "Second Page"
build() {
Flex({ direction: FlexDirection.Column,alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) {
Text(`${this.content}`)
.fontSize(50)
.fontWeight(FontWeight.Bold)
Button() {
Text('back to index')
.fontSize(20)
.fontWeight(FontWeight.Bold)
}.type(ButtonType.Capsule)
.margin({
top: 20
})
.backgroundColor('#0D9FFB')
.onClick(() => {
router.back()
})
}
.width('100%')
.height('100%')
}
}
\ No newline at end of file
arkui/ace_ets_component_three/entry/src/main/ets/MainAbility/pages/text.ets
浏览文件 @
5371fdba
// @ts-nocheck
/**
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
...
...
arkui/ace_ets_component_three/entry/src/main/ets/MainAbility/utils/Common.ets
0 → 100644
浏览文件 @
5371fdba
/**
* 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.
*/
export default class CommonFunc {
static rect_left;
static rect_top;
static rect_right;
static rect_bottom;
static rect_value;
static sleep(time){
return new Promise((resolve,reject)=>{
setTimeout(()=>{
resolve("ok")
},time)
}).then(()=>{
console.info(`sleep ${time} over...`)
})
}
static getComponentRect(key) {
let strJson = getInspectorByKey(key);
let obj = JSON.parse(strJson);
console.info("[getInspectorByKey] current component obj is: " + JSON.stringify(obj));
let rectInfo = JSON.parse('[' + obj.$rect + ']')
console.info("[getInspectorByKey] rectInfo is: " + rectInfo);
this.rect_left = JSON.parse('[' + rectInfo[0] + ']')[0]
this.rect_top = JSON.parse('[' + rectInfo[0] + ']')[1]
this.rect_right = JSON.parse('[' + rectInfo[1] + ']')[0]
this.rect_bottom = JSON.parse('[' + rectInfo[1] + ']')[1]
return this.rect_value = {
"left": this.rect_left, "top": this.rect_top, "right": this.rect_right, "bottom": this.rect_bottom
}
}
}
arkui/ace_ets_component_three/entry/src/main/ets/MainAbility/
app
.ets
→
arkui/ace_ets_component_three/entry/src/main/ets/MainAbility/
utils/MessageManager
.ets
浏览文件 @
5371fdba
// @ts-nocheck
/**
* Copyright (c) 202
1 Huawei Device Co., Ltd.
* Copyright (c) 202
2 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
...
...
@@ -13,21 +12,43 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'
import { Hypium } from 'hypium/index'
import testsuite from '../test/List.test'
export interface Callback {
(message:any):void
}
export class MessageManager {
callback:Callback
callbacks:Map<string,Callback> = new Map()
constructor() {
}
registerCallback(callback:Callback , type?:string) {
if (type == undefined) {
console.error('registerCallback callback set')
this.callback = callback
return
}
this.callbacks.set(type,callback)
}
notify(message:any, type?:string) {
if (type == undefined) {
this.callback(message)
return
}
let tmpCallback:Callback = this.callbacks.get(type)
if (tmpCallback === undefined) {
console.error('callbacks has no callback for type ' + type)
return
}
tmpCallback(message)
}
export default {
onCreate() {
console.info('Application 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.info('Application onDestroy')
},
clear() {
this.callbacks.clear()
this.callback = null
}
}
\ No newline at end of file
arkui/ace_ets_component_three/entry/src/main/ets/TestAbility/TestAbility.ts
0 → 100644
浏览文件 @
5371fdba
/*
* 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.app.ability.UIAbility
'
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
.
loadContent
(
"
TestAbility/pages/index
"
,
(
err
,
data
)
=>
{
if
(
err
.
code
)
{
console
.
error
(
'
Failed to load the content. Cause:
'
+
JSON
.
stringify
(
err
));
return
;
}
console
.
info
(
'
Succeeded in loading the content. Data:
'
+
JSON
.
stringify
(
data
))
});
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
arkui/ace_ets_component_three/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts
浏览文件 @
5371fdba
// @ts-nocheck
/**
* Copyright (c) 2021 Huawei Device Co., Ltd.
/*
* 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
...
...
@@ -21,25 +20,25 @@ var abilityDelegatorArguments = undefined
function
translateParamsToString
(
parameters
)
{
const
keySet
=
new
Set
([
'
-s class
'
,
'
-s notClass
'
,
'
-s suite
'
,
'
-s it
Name
'
,
'
-s class
'
,
'
-s notClass
'
,
'
-s suite
'
,
'
-s it
'
,
'
-s level
'
,
'
-s testType
'
,
'
-s size
'
,
'
-s timeout
'
,
'
-s
package
'
'
-s
dryRun
'
])
let
targetParams
=
''
;
for
(
const
key
in
parameters
)
{
if
(
keySet
.
has
(
key
))
{
targetParams
+=
'
'
+
key
+
'
'
+
parameters
[
key
]
targetParams
=
`
${
targetParams
}
${
key
}
${
parameters
[
key
]}
`
}
}
return
targetParams
.
trim
()
}
async
function
onAbilityCreateCallback
()
{
console
.
log
(
'
onAbilityCreateCallback
'
);
console
.
log
(
"
onAbilityCreateCallback
"
);
}
async
function
addAbilityMonitorCallback
(
err
:
any
)
{
console
.
info
(
'
addAbilityMonitorCallback :
'
+
JSON
.
stringify
(
err
))
console
.
info
(
"
addAbilityMonitorCallback :
"
+
JSON
.
stringify
(
err
))
}
export
default
class
OpenHarmonyTestRunner
implements
TestRunner
{
...
...
@@ -47,22 +46,26 @@ export default class OpenHarmonyTestRunner implements TestRunner {
}
onPrepare
()
{
console
.
info
(
'
OpenHarmonyTestRunner OnPrepare
'
)
console
.
info
(
"
OpenHarmonyTestRunner OnPrepare
"
)
}
onRun
()
{
async
onRun
()
{
console
.
log
(
'
OpenHarmonyTestRunner onRun run
'
)
abilityDelegatorArguments
=
AbilityDelegatorRegistry
.
getArguments
()
abilityDelegator
=
AbilityDelegatorRegistry
.
getAbilityDelegator
()
var
testAbilityName
=
abilityDelegatorArguments
.
bundleName
+
'
.MainAbility
'
let
lMonitor
=
{
abilityName
:
testAbilityName
,
onAbilityCreate
:
onAbilityCreateCallback
,
};
var
testAbilityName
=
abilityDelegatorArguments
.
parameters
[
'
-p
'
]
+
'
.MainAbility
'
abilityDelegator
.
addAbilityMonitor
(
lMonitor
,
addAbilityMonitorCallback
)
var
cmd
=
'
aa start -d 0 -a
'
+
testAbilityName
+
'
-b
'
+
abilityDelegatorArguments
.
bundleName
var
cmd
=
'
aa start -d 0 -a
com.open.harmony.acetestthree.MainAbility
'
+
'
-b
'
+
abilityDelegatorArguments
.
bundleName
cmd
+=
'
'
+
translateParamsToString
(
abilityDelegatorArguments
.
parameters
)
var
debug
=
abilityDelegatorArguments
.
parameters
[
"
-D
"
]
if
(
debug
==
'
true
'
)
{
cmd
+=
'
-D
'
}
console
.
info
(
'
cmd :
'
+
cmd
)
abilityDelegator
.
executeShellCommand
(
cmd
,
(
err
:
any
,
d
:
any
)
=>
{
...
...
@@ -70,9 +73,6 @@ export default class OpenHarmonyTestRunner implements TestRunner {
console
.
info
(
'
executeShellCommand : data :
'
+
d
.
stdResult
);
console
.
info
(
'
executeShellCommand : data :
'
+
d
.
exitCode
);
})
console
.
info
(
'
OpenHarmonyTestRunner onRun call abilityDelegator.getAppContext
'
)
var
context
=
abilityDelegator
.
getAppContext
()
console
.
info
(
'
getAppContext :
'
+
JSON
.
stringify
(
context
))
console
.
info
(
'
OpenHarmonyTestRunner onRun end
'
)
}
};
\ No newline at end of file
arkui/ace_ets_component_three/entry/src/main/ets/test/AboutToDisappearJsunit.test.ets
浏览文件 @
5371fdba
...
...
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "
hypium/index
";
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "
@ohos/hypium
";
import router from '@system.router';
import events_emitter from '@ohos.events.emitter';
import Utils from './Utils';
...
...
@@ -23,7 +23,7 @@ export default function aboutToDisappearJsunit() {
beforeEach(async function (done) {
console.info("aboutToDisappear beforeEach start");
let options = {
uri: 'pages/aboutToDisappear',
uri: '
MainAbility/
pages/aboutToDisappear',
}
try {
router.clear();
...
...
arkui/ace_ets_component_three/entry/src/main/ets/test/AnimateJsunit.test.ets
浏览文件 @
5371fdba
// @ts-nocheck
/**
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
...
...
@@ -13,17 +12,20 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "
hypium/index
"
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "
@ohos/hypium
"
import router from '@system.router';
import events_emitter from '@ohos.events.emitter'
import Utils from './Utils';
import CommonFunc from '../MainAbility/utils/Common';
import {MessageManager,Callback} from '../MainAbility/utils/MessageManager';
const waitUiReadyMs = 1000;
export default function animateJsunit() {
describe('animateTest', function () {
beforeEach(async function (done) {
console.info("animate beforeEach start");
let options = {
uri: 'pages/animate',
uri: '
MainAbility/
pages/animate',
}
try {
router.clear();
...
...
@@ -55,7 +57,11 @@ export default function animateJsunit() {
}
let callback = (indexEvent) => {
console.info("animateTest_0100 get state result is: " + JSON.stringify(indexEvent))
expect(indexEvent.data.duration).assertEqual('100')
try {
expect(indexEvent.data.duration == 100).assertTrue();
} catch (err) {
console.info("animateTest_0100 get state result is errr: " + JSON.stringify(err));
}
}
try {
events_emitter.on(indexEvent, callback);
...
...
@@ -99,7 +105,12 @@ export default function animateJsunit() {
}
let callback = (indexEvent) => {
console.info("animateTest_0300 get state result is: " + JSON.stringify(indexEvent))
expect(indexEvent.data.iteration).assertEqual('1')
try {
expect(indexEvent.data.iterations == 1).assertTrue();
} catch (err) {
console.info("animateTest_0300 get state result err is: " + JSON.stringify(err))
}
}
try {
events_emitter.on(indexEvent, callback);
...
...
@@ -157,36 +168,27 @@ export default function animateJsunit() {
});
it('animateTest_0600', 0, async function (done) {
console.info('animateTest_0500 START');
try {
let eventData = {
data: {
"duration": '2000'
}
}
let indexEventOne = {
eventId: 50,
priority: events_emitter.EventPriority.LOW
}
console.info("animateTest_0600 start to publish emit");
events_emitter.emit(indexEventOne, eventData);
} catch (err) {
console.log("animateTest_0600 change component data error: " + err.message);
}
await CommonFunc.sleep(1000);
globalThis.value.message.notify({name:'duration', value:2000});
await CommonFunc.sleep(200);
let indexEvent = {
eventId:
51,
eventId: 1
51,
priority: events_emitter.EventPriority.LOW
}
let callback = (indexEvent) => {
console.info("animateTest_0600 get state result is: " + JSON.stringify(indexEvent))
expect(indexEvent.data.duration).assertEqual(2000)
try {
expect(indexEvent.data.duration == 2000).assertTrue();
} catch (err) {
console.info("animateTest_0600 get state result err is: " + JSON.stringify(err));
}
}
try {
events_emitter.on(indexEvent, callback);
} catch (err) {
console.info("animateTest_0600 on events_emitter err : " + JSON.stringify(err));
}
console.info("animateTest_0600 click result is: " + JSON.stringify(sendEventByKey('button1', 10, "")));
console.info("animateTest_0600 click result is: " + JSON.stringify(sendEventByKey('button1
1
', 10, "")));
await Utils.sleep(2000);
console.info('animateTest_0600 END');
done();
...
...
@@ -194,35 +196,26 @@ export default function animateJsunit() {
it('animateTest_0700', 0, async function (done) {
console.info('animateTest_0700 START');
try {
let eventData = {
data: {
"curve": "Linear"
}
}
let indexEventOne = {
eventId: 50,
priority: events_emitter.EventPriority.LOW
}
console.info("animateTest_0700 start to publish emit");
events_emitter.emit(indexEventOne, eventData);
} catch (err) {
console.log("animateTest_0700 change component data error: " + err.message);
}
globalThis.value.message.notify({name:'curve', value:'Linear'});
await CommonFunc.sleep(200);
let indexEvent = {
eventId: 52,
eventId:
1
52,
priority: events_emitter.EventPriority.LOW
}
let callback = (indexEvent) => {
console.info("animateTest_0700 get state result is: " + JSON.stringify(indexEvent))
expect(indexEvent.data.curve).assertEqual('Linear')
try {
expect(indexEvent.data.curve).assertEqual('Linear');
} catch (err) {
console.info("animateTest_0700 get state result err is: " + JSON.stringify(err))
}
}
try {
events_emitter.on(indexEvent, callback);
} catch (err) {
console.info("animateTest_0700 on events_emitter err : " + JSON.stringify(err));
}
console.info("animateTest_0700 click result is: " + JSON.stringify(sendEventByKey('button2', 10, "")));
console.info("animateTest_0700 click result is: " + JSON.stringify(sendEventByKey('button
1
2', 10, "")));
await Utils.sleep(2000);
console.info('animateTest_0700 END');
done();
...
...
@@ -230,35 +223,27 @@ export default function animateJsunit() {
it('animateTest_0800', 0, async function (done) {
console.info('animateTest_0800 START');
try {
let eventData = {
data: {
"iteration": "2"
}
}
let indexEventOne = {
eventId: 50,
priority: events_emitter.EventPriority.LOW
}
console.info("animateTest_0800 start to publish emit");
events_emitter.emit(indexEventOne, eventData);
} catch (err) {
console.log("animateTest_0800 change component data error: " + err.message);
}
globalThis.value.message.notify({name:'iteration', value:2});
await CommonFunc.sleep(200);
let indexEvent = {
eventId: 53,
eventId:
1
53,
priority: events_emitter.EventPriority.LOW
}
let callback = (indexEvent) => {
console.info("animateTest_0800 get state result is: " + JSON.stringify(indexEvent))
expect(indexEvent.data.iteration).assertEqual('2')
try {
expect(indexEvent.data.iterations).assertEqual(2)
} catch (err) {
console.info("animateTest_0800 get state result err is: " + JSON.stringify(err))
}
}
try {
events_emitter.on(indexEvent, callback);
} catch (err) {
console.info("animateTest_0800 on events_emitter err : " + JSON.stringify(err));
}
console.info("animateTest_0800 click result is: " + JSON.stringify(sendEventByKey('button3', 10, "")));
console.info("animateTest_0800 click result is: " + JSON.stringify(sendEventByKey('button
1
3', 10, "")));
await Utils.sleep(2000);
console.info('animateTest_0800 END');
done();
...
...
@@ -266,35 +251,27 @@ export default function animateJsunit() {
it('animateTest_0900', 0, async function (done) {
console.info('animateTest_0900 START');
try {
let eventData = {
data: {
"tempo": "20000"
}
}
let indexEventOne = {
eventId: 50,
priority: events_emitter.EventPriority.LOW
}
console.info("animateTest_0900 start to publish emit");
events_emitter.emit(indexEventOne, eventData);
} catch (err) {
console.log("animateTest_0900 change component data error: " + err.message);
}
globalThis.value.message.notify({name:'tempo', value:"20000"});
await CommonFunc.sleep(200);
let indexEvent = {
eventId: 54,
eventId:
1
54,
priority: events_emitter.EventPriority.LOW
}
let callback = (indexEvent) => {
console.info("animateTest_0900 get state result is: " + JSON.stringify(indexEvent))
expect(indexEvent.data.tempo).assertEqual('20000')
try {
expect(indexEvent.data.tempo).assertEqual('20000');
} catch (err) {
console.info("animateTest_0900 get state result err is: " + JSON.stringify(err))
}
}
try {
events_emitter.on(indexEvent, callback);
} catch (err) {
console.info("animateTest_0900 on events_emitter err : " + JSON.stringify(err));
}
console.info("animateTest_0900 click result is: " + JSON.stringify(sendEventByKey('button4', 10, "")));
console.info("animateTest_0900 click result is: " + JSON.stringify(sendEventByKey('button
1
4', 10, "")));
await Utils.sleep(2000);
console.info('animateTest_0900 END');
done();
...
...
@@ -302,35 +279,26 @@ export default function animateJsunit() {
it('animateTest_1000', 0, async function (done) {
console.info('animateTest_1000 START');
try {
let eventData = {
data: {
"playmode": "PlayMode.Alternate"
}
}
let indexEventOne = {
eventId: 50,
priority: events_emitter.EventPriority.LOW
}
console.info("animateTest_1000 start to publish emit");
events_emitter.emit(indexEventOne, eventData);
} catch (err) {
console.log("animateTest_1000 change component data error: " + err.message);
}
globalThis.value.message.notify({name:'playmode', value:PlayMode.Alternate});
await CommonFunc.sleep(200);
let indexEvent = {
eventId: 55,
eventId:
1
55,
priority: events_emitter.EventPriority.LOW
}
let callback = (indexEvent) => {
console.info("animateTest_1000 get state result is: " + JSON.stringify(indexEvent))
expect(indexEvent.data.playmode).assertEqual('alternate')
try {
expect(indexEvent.data.playmode).assertEqual('alternate');
} catch (err) {
console.info("animateTest_1000 get state result err is: " + JSON.stringify(err))
}
}
try {
events_emitter.on(indexEvent, callback);
} catch (err) {
console.info("animateTest_1000 on events_emitter err : " + JSON.stringify(err));
}
console.info("animateTest_1000 click result is: " + JSON.stringify(sendEventByKey('button5', 10, "")));
console.info("animateTest_1000 click result is: " + JSON.stringify(sendEventByKey('button
1
5', 10, "")));
await Utils.sleep(2000);
console.info('animateTest_1000 END');
done();
...
...
@@ -338,28 +306,20 @@ export default function animateJsunit() {
it('animateTest_1100', 0, async function (done) {
console.info('animateTest_1100 START');
try {
let eventData = {
data: {
"duration": -1000
}
}
let indexEventOne = {
eventId: 1011,
priority: events_emitter.EventPriority.LOW
}
console.info("animateTest_1100 start to publish emit");
events_emitter.emit(indexEventOne, eventData);
} catch (err) {
console.log("animateTest_1100 change component data error: " + err.message);
}
globalThis.value.message.notify({name:'duration', value:-1000});
await CommonFunc.sleep(200);
let indexEvent = {
eventId: 1001,
priority: events_emitter.EventPriority.LOW
}
let callback = (indexEvent) => {
console.info("animateTest_1100 get state result is: " + JSON.stringify(indexEvent))
expect(indexEvent.data.duration).assertEqual('-1000')
try {
expect(indexEvent.data.duration).assertEqual(-1000);
} catch (err) {
console.info("animateTest_1100 get state result err is: " + JSON.stringify(err))
}
}
try {
events_emitter.on(indexEvent, callback);
...
...
@@ -374,28 +334,19 @@ export default function animateJsunit() {
it('animateTest_1200', 0, async function (done) {
console.info('animateTest_1200 START');
try {
let eventData = {
data: {
"duration": 100000000
}
}
let indexEventOne = {
eventId: 1012,
priority: events_emitter.EventPriority.LOW
}
console.info("animateTest_1200 start to publish emit");
events_emitter.emit(indexEventOne, eventData);
} catch (err) {
console.log("animateTest_1200 change component data error: " + err.message);
}
globalThis.value.message.notify({name:'duration', value:100000000});
await CommonFunc.sleep(200);
let indexEvent = {
eventId: 1002,
priority: events_emitter.EventPriority.LOW
}
let callback = (indexEvent) => {
console.info("animateTest_1200 get state result is: " + JSON.stringify(indexEvent))
expect(indexEvent.data.duration).assertEqual('100000000')
try {
expect(indexEvent.data.duration).assertEqual(100000000);
} catch (err) {
console.info("animateTest_1200 get state result err is: " + JSON.stringify(err))
}
}
try {
events_emitter.on(indexEvent, callback);
...
...
@@ -410,28 +361,20 @@ export default function animateJsunit() {
it('animateTest_1300', 0, async function (done) {
console.info('animateTest_1300 START');
try {
let eventData = {
data: {
"curve": 123
}
}
let indexEventOne = {
eventId: 1013,
priority: events_emitter.EventPriority.LOW
}
console.info("animateTest_1300 start to publish emit");
events_emitter.emit(indexEventOne, eventData);
} catch (err) {
console.log("animateTest_1300 change component data error: " + err.message);
}
globalThis.value.message.notify({name:'curve', value:'123'});
await CommonFunc.sleep(200);
let indexEvent = {
eventId: 1003,
priority: events_emitter.EventPriority.LOW
}
let callback = (indexEvent) => {
console.info("animateTest_1300 get state result is: " + JSON.stringify(indexEvent))
expect(indexEvent.data.curve).assertEqual('123')
try {
expect(indexEvent.data.curve).assertEqual('123');
} catch (err) {
console.info("animateTest_1300 get state result err is: " + JSON.stringify(err))
}
}
try {
events_emitter.on(indexEvent, callback);
...
...
@@ -446,28 +389,19 @@ export default function animateJsunit() {
it('animateTest_1400', 0, async function (done) {
console.info('animateTest_1400 START');
try {
let eventData = {
data: {
"curve": 'abc'
}
}
let indexEventOne = {
eventId: 1014,
priority: events_emitter.EventPriority.LOW
}
console.info("animateTest_1400 start to publish emit");
events_emitter.emit(indexEventOne, eventData);
} catch (err) {
console.log("animateTest_1400 change component data error: " + err.message);
}
globalThis.value.message.notify({name:'curve', value:'abc'});
await CommonFunc.sleep(200);
let indexEvent = {
eventId: 1004,
priority: events_emitter.EventPriority.LOW
}
let callback = (indexEvent) => {
console.info("animateTest_1400 get state result is: " + JSON.stringify(indexEvent))
try {
expect(indexEvent.data.curve).assertEqual('abc')
} catch (err) {
console.info("animateTest_1400 get state result err is: " + JSON.stringify(err))
}
}
try {
events_emitter.on(indexEvent, callback);
...
...
@@ -482,28 +416,19 @@ export default function animateJsunit() {
it('animateTest_1500', 0, async function (done) {
console.info('animateTest_1500 START');
try {
let eventData = {
data: {
"iteration": "121212121212"
}
}
let indexEventOne = {
eventId: 1015,
priority: events_emitter.EventPriority.LOW
}
console.info("animateTest_1500 start to publish emit");
events_emitter.emit(indexEventOne, eventData);
} catch (err) {
console.log("animateTest_1500 change component data error: " + err.message);
}
globalThis.value.message.notify({name:'iteration', value:121});
await CommonFunc.sleep(200);
let indexEvent = {
eventId: 1005,
priority: events_emitter.EventPriority.LOW
}
let callback = (indexEvent) => {
console.info("animateTest_1500 get state result is: " + JSON.stringify(indexEvent))
expect(indexEvent.data.iteration).assertEqual('121212121212')
try {
expect(indexEvent.data.iteration).assertEqual(121);
} catch (err) {
console.info("animateTest_1500 get state result err is: " + JSON.stringify(err))
}
}
try {
events_emitter.on(indexEvent, callback);
...
...
@@ -518,35 +443,26 @@ export default function animateJsunit() {
it('animateTest_1600', 0, async function (done) {
console.info('animateTest_1600 START');
try {
let eventData = {
data: {
"iteration": "-5"
}
}
let indexEventOne = {
eventId: 1016,
priority: events_emitter.EventPriority.LOW
}
console.info("animateTest_1600 start to publish emit");
events_emitter.emit(indexEventOne, eventData);
} catch (err) {
console.log("animateTest_1600 change component data error: " + err.message);
}
globalThis.value.message.notify({name:'iteration', value:-5});
await CommonFunc.sleep(200);
let indexEvent = {
eventId: 1006,
priority: events_emitter.EventPriority.LOW
}
let callback = (indexEvent) => {
console.info("animateTest_1600 get state result is: " + JSON.stringify(indexEvent))
expect(indexEvent.data.iteration).assertEqual('-5')
try {
expect(indexEvent.data.iteration).assertEqual(-5);
} catch (err) {
console.info("animateTest_1600 get state result err is: " + JSON.stringify(err))
}
}
try {
events_emitter.on(indexEvent, callback);
} catch (err) {
console.info("animateTest_1600 on events_emitter err : " + JSON.stringify(err));
}
console.info("animateTest_1600 click result is: " + JSON.stringify(sendEventByKey('button11', 10, "")));
console.info("animateTest_1600 click result is: " + JSON.stringify(sendEventByKey('button11
1
', 10, "")));
await Utils.sleep(2000);
console.info('animateTest_1600 END');
done();
...
...
@@ -554,35 +470,27 @@ export default function animateJsunit() {
it('animateTest_1700', 0, async function (done) {
console.info('animateTest_1700 START');
try {
let eventData = {
data: {
"tempo": "12121212121212"
}
}
let indexEventOne = {
eventId: 1017,
priority: events_emitter.EventPriority.LOW
}
console.info("animateTest_1700 start to publish emit");
events_emitter.emit(indexEventOne, eventData);
} catch (err) {
console.log("animateTest_1700 change component data error: " + err.message);
}
globalThis.value.message.notify({name:'tempo', value:"12121212121212"});
await CommonFunc.sleep(200);
let indexEvent = {
eventId: 1007,
priority: events_emitter.EventPriority.LOW
}
let callback = (indexEvent) => {
console.info("animateTest_1700 get state result is: " + JSON.stringify(indexEvent))
expect(indexEvent.data.tempo).assertEqual('12121212121212')
try {
expect(indexEvent.data.tempo).assertEqual('12121212121212');
} catch (err) {
console.info("animateTest_1700 get state result err is: " + JSON.stringify(err))
}
}
try {
events_emitter.on(indexEvent, callback);
} catch (err) {
console.info("animateTest_1700 on events_emitter err : " + JSON.stringify(err));
}
console.info("animateTest_1700 click result is: " + JSON.stringify(sendEventByKey('button12', 10, "")));
console.info("animateTest_1700 click result is: " + JSON.stringify(sendEventByKey('button12
1
', 10, "")));
await Utils.sleep(2000);
console.info('animateTest_1700 END');
done();
...
...
@@ -590,35 +498,26 @@ export default function animateJsunit() {
it('animateTest_1800', 0, async function (done) {
console.info('animateTest_1800 START');
try {
let eventData = {
data: {
"tempo": "-5"
}
}
let indexEventOne = {
eventId: 1018,
priority: events_emitter.EventPriority.LOW
}
console.info("animateTest_1800 start to publish emit");
events_emitter.emit(indexEventOne, eventData);
} catch (err) {
console.log("animateTest_1800 change component data error: " + err.message);
}
globalThis.value.message.notify({name:'tempo', value:"-5"});
await CommonFunc.sleep(200);
let indexEvent = {
eventId: 1008,
priority: events_emitter.EventPriority.LOW
}
let callback = (indexEvent) => {
console.info("animateTest_1800 get state result is: " + JSON.stringify(indexEvent))
try {
expect(indexEvent.data.tempo).assertEqual('-5')
} catch (err) {
console.info("animateTest_1800 get state result err is: " + JSON.stringify(err))
}
}
try {
events_emitter.on(indexEvent, callback);
} catch (err) {
console.info("animateTest_1800 on events_emitter err : " + JSON.stringify(err));
}
console.info("animateTest_1800 click result is: " + JSON.stringify(sendEventByKey('button13', 10, "")));
console.info("animateTest_1800 click result is: " + JSON.stringify(sendEventByKey('button13
1
', 10, "")));
await Utils.sleep(2000);
console.info('animateTest_1800 END');
done();
...
...
@@ -626,35 +525,26 @@ export default function animateJsunit() {
it('animateTest_1900', 0, async function (done) {
console.info('animateTest_1900 START');
try {
let eventData = {
data: {
"playmode": "aaa"
}
}
let indexEventOne = {
eventId: 1019,
priority: events_emitter.EventPriority.LOW
}
console.info("animateTest_1900 start to publish emit");
events_emitter.emit(indexEventOne, eventData);
} catch (err) {
console.log("animateTest_1900 change component data error: " + err.message);
}
globalThis.value.message.notify({name:'playmode', value:-6});
await CommonFunc.sleep(200);
let indexEvent = {
eventId: 1009,
priority: events_emitter.EventPriority.LOW
}
let callback = (indexEvent) => {
console.info("animateTest_1900 get state result is: " + JSON.stringify(indexEvent))
expect(indexEvent.data.playmode).assertEqual('aaa')
try {
expect(indexEvent.data.playmode).assertEqual(-6);
} catch (err) {
console.info("animateTest_1900 get state result err is: " + JSON.stringify(err))
}
}
try {
events_emitter.on(indexEvent, callback);
} catch (err) {
console.info("animateTest_1900 on events_emitter err : " + JSON.stringify(err));
}
console.info("animateTest_1900 click result is: " + JSON.stringify(sendEventByKey('button14', 10, "")));
console.info("animateTest_1900 click result is: " + JSON.stringify(sendEventByKey('button14
1
', 10, "")));
await Utils.sleep(2000);
console.info('animateTest_1900 END');
done();
...
...
@@ -662,35 +552,28 @@ export default function animateJsunit() {
it('animateTest_2000', 0, async function (done) {
console.info('animateTest_2000 START');
try {
let eventData = {
data: {
"playmode": "123456"
}
}
let indexEventOne = {
eventId: 1020,
priority: events_emitter.EventPriority.LOW
}
console.info("animateTest_2000 start to publish emit");
events_emitter.emit(indexEventOne, eventData);
} catch (err) {
console.log("animateTest_2000 change component data error: " + err.message);
}
globalThis.value.message.notify({name:'playmode', value:123456});
await CommonFunc.sleep(200);
let indexEvent = {
eventId: 1010,
priority: events_emitter.EventPriority.LOW
}
let callback = (indexEvent) => {
console.info("animateTest_2000 get state result is: " + JSON.stringify(indexEvent))
expect(indexEvent.data.playmode).assertEqual('123456')
try {
expect(indexEvent.data.playmode).assertEqual(123456);
} catch (err) {
console.info("animateTest_2000 get state result err is: " + JSON.stringify(err));
}
}
try {
events_emitter.on(indexEvent, callback);
} catch (err) {
console.info("animateTest_2000 on events_emitter err : " + JSON.stringify(err));
}
console.info("animateTest_2000 click result is: " + JSON.stringify(sendEventByKey('button15', 10, "")));
console.info("animateTest_2000 click result is: " + JSON.stringify(sendEventByKey('button15
1
', 10, "")));
await Utils.sleep(2000);
console.info('animateTest_2000 END');
done();
...
...
arkui/ace_ets_component_three/entry/src/main/ets/test/BackgroundJsunit.test.ets
浏览文件 @
5371fdba
...
...
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "
hypium/index
"
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "
@ohos/hypium
"
import router from '@system.router';
import events_emitter from '@ohos.events.emitter'
import Utils from './Utils.ets';
...
...
@@ -23,7 +23,7 @@ export default function backgroundJsunit() {
beforeEach(async function (done) {
console.info("background beforeEach start");
let options = {
uri: 'pages/general-properties/background',
uri: '
MainAbility/
pages/general-properties/background',
}
try {
router.clear();
...
...
arkui/ace_ets_component_three/entry/src/main/ets/test/BadgeJsunit.test.ets
浏览文件 @
5371fdba
...
...
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "
hypium/index
"
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "
@ohos/hypium
"
import router from '@system.router';
import events_emitter from '@ohos.events.emitter'
import Utils from './Utils';
...
...
@@ -23,7 +23,7 @@ export default function badgeJsunit() {
beforeEach(async function (done) {
console.info("badge beforeEach start");
let options = {
uri: 'pages/badge',
uri: '
MainAbility/
pages/badge',
}
let result;
try {
...
...
@@ -52,67 +52,68 @@ export default function badgeJsunit() {
await Utils.sleep(1000);
let strJson = getInspectorByKey('badge');
let obj = JSON.parse(strJson);
console.info("[testBadge01] component obj is: " + JSON.stringify(obj
)
);
console.info("[testBadge01] component obj is: " + JSON.stringify(obj
.$attrs.style) + "---" + obj.$attrs.style
);
let style = JSON.parse(obj.$attrs.style);
expect(obj.$type).assertEqual('Badge');
expect(style.fontSize).assertEqual('20.00fp');
done();
});
it('testBadge02
', 0, async function (done) {
console.info('[testBadge0
2
] START');
it('testBadge03
', 0, async function (done) {
console.info('[testBadge0
3
] START');
await Utils.sleep(1000);
try {
var eventData = {
data: {
"fontSizeValue":
"30"
,
"fontSizeValue":
-1
,
}
}
var innerEvent = {
eventId: 63,
priority: events_emitter.EventPriority.LOW
}
console.info("[testBadge0
2
] start to publish emit");
console.info("[testBadge0
3
] start to publish emit");
events_emitter.emit(innerEvent, eventData);
} catch (err) {
console.log("[testBadge0
2
] change component data error: " + err.message);
console.log("[testBadge0
3
] change component data error: " + err.message);
}
await Utils.sleep(2000);
let strJsonNew = getInspectorByKey('badge');
let objNew = JSON.parse(strJsonNew);
console.info("[testBadge02] component objNew is: " + JSON.stringify(objNew));
let style = JSON.parse(objNew.$attrs.style);
expect(style.fontSize).assertEqual('30.00fp');
console.info("[testBadge03] component objNew is: " + style + "--" + objNew.$attrs.style);
expect(style.fontSize).assertEqual('10.00vp');
done();
});
it('testBadge0
3
', 0, async function (done) {
console.info('[testBadge0
3
] START');
it('testBadge0
2
', 0, async function (done) {
console.info('[testBadge0
2
] START');
await Utils.sleep(1000);
try {
var eventData = {
data: {
"fontSizeValue": "
-1
",
"fontSizeValue": "
30
",
}
}
var innerEvent = {
eventId: 63,
priority: events_emitter.EventPriority.LOW
}
console.info("[testBadge0
3
] start to publish emit");
console.info("[testBadge0
2
] start to publish emit");
events_emitter.emit(innerEvent, eventData);
} catch (err) {
console.log("[testBadge0
3
] change component data error: " + err.message);
console.log("[testBadge0
2
] change component data error: " + err.message);
}
await Utils.sleep(2000);
let strJsonNew = getInspectorByKey('badge');
let objNew = JSON.parse(strJsonNew);
console.info("[testBadge0
3
] component objNew is: " + JSON.stringify(objNew));
console.info("[testBadge0
2
] component objNew is: " + JSON.stringify(objNew));
let style = JSON.parse(objNew.$attrs.style);
expect(style.fontSize).assertEqual('
-1
.00fp');
expect(style.fontSize).assertEqual('
30
.00fp');
done();
});
it('testBadge04', 0, async function (done) {
console.info('[testBadge04] START');
await Utils.sleep(1000);
...
...
arkui/ace_ets_component_three/entry/src/main/ets/test/BlankJsunit.test.ets
浏览文件 @
5371fdba
...
...
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "
hypium/index
"
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "
@ohos/hypium
"
import router from '@system.router';
import events_emitter from '@ohos.events.emitter'
import Utils from './Utils';
...
...
@@ -23,7 +23,7 @@ export default function blankJsunit() {
beforeEach(async function (done) {
console.info("blank beforeEach start");
let options = {
uri: 'pages/blank',
uri: '
MainAbility/
pages/blank',
}
let result;
try {
...
...
arkui/ace_ets_component_three/entry/src/main/ets/test/ButtonJsunit.test.ets
浏览文件 @
5371fdba
...
...
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "
hypium/index
"
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "
@ohos/hypium
"
import router from '@system.router';
import events_emitter from '@ohos.events.emitter'
import Utils from './Utils';
...
...
@@ -23,7 +23,7 @@ export default function buttonJsunit() {
beforeEach(async function (done) {
console.info("button beforeEach start");
let options = {
uri: 'pages/button',
uri: '
MainAbility/
pages/button',
}
let result;
try {
...
...
@@ -306,10 +306,15 @@ export default function buttonJsunit() {
let event = JSON.parse(eventData.data.event);
console.info("[testButton12] get event state result is: " + Math.trunc(event.screenY));
console.info("[testButton12] get event state result is: " + Math.trunc(event.screenX));
try {
expect(event.screenX).assertEqual(185)
expect(event.screenY).assertEqual(485
)
expect(event.screenY).assertEqual(533
)
expect(event.x).assertEqual(100)
expect(event.y).assertEqual(50)
} catch (err) {
console.info("[testButton12_] expection err : " + JSON.stringify(err));
expect().assertFail();
}
done();
}
var innerEvent = {
...
...
arkui/ace_ets_component_three/entry/src/main/ets/test/Canvas2Jsunit.test.ets
浏览文件 @
5371fdba
...
...
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "
hypium/index
";
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "
@ohos/hypium
";
import router from '@system.router';
import Utils from './Utils';
...
...
@@ -22,7 +22,7 @@ export default function canvas2Jsunit() {
beforeEach(async function (done) {
console.info("canvas beforeEach start");
let options = {
uri: 'pages/canvas2',
uri: '
MainAbility/
pages/canvas2',
}
try {
router.clear();
...
...
arkui/ace_ets_component_three/entry/src/main/ets/test/CanvasJsunit.test.ets
浏览文件 @
5371fdba
...
...
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "
hypium/index
";
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "
@ohos/hypium
";
import router from '@system.router';
import Utils from './Utils';
...
...
@@ -22,7 +22,7 @@ export default function canvasJsunit() {
beforeEach(async function (done) {
console.info("canvas beforeEach start");
let options = {
uri: 'pages/canvas',
uri: '
MainAbility/
pages/canvas',
}
try {
router.clear();
...
...
arkui/ace_ets_component_three/entry/src/main/ets/test/CircleJsunit.test.ets
浏览文件 @
5371fdba
...
...
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "
hypium/index
";
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "
@ohos/hypium
";
import router from '@system.router';
import events_emitter from '@ohos.events.emitter';
import Utils from './Utils';
...
...
@@ -23,7 +23,7 @@ export default function circleJsunit() {
beforeEach(async function (done) {
console.info("circle beforeEach start");
let options = {
uri: 'pages/circle',
uri: '
MainAbility/
pages/circle',
}
try {
router.clear();
...
...
arkui/ace_ets_component_three/entry/src/main/ets/test/CommonJsunit.test.ets
浏览文件 @
5371fdba
...
...
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "
hypium/index
"
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "
@ohos/hypium
"
import display from '@ohos.display';
import Utils from './Utils';
...
...
arkui/ace_ets_component_three/entry/src/main/ets/test/GridJsunit.test.ets
浏览文件 @
5371fdba
...
...
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "
hypium/index
"
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "
@ohos/hypium
"
import router from '@system.router';
import events_emitter from '@ohos.events.emitter';
import Utils from './Utils';
...
...
@@ -23,7 +23,7 @@ export default function gridJsunit() {
beforeEach(async function (done) {
console.info('beforeEach ===================grid test beforeEach called===================');
let options = {
uri: 'pages/gridPage',
uri: '
MainAbility/
pages/gridPage',
}
try {
router.clear();
...
...
arkui/ace_ets_component_three/entry/src/main/ets/test/LineJsunit.test.ets
浏览文件 @
5371fdba
...
...
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "
hypium/index
"
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "
@ohos/hypium
"
import router from '@system.router';
import Utils from './Utils';
import events_emitter from '@ohos.events.emitter';
...
...
@@ -22,7 +22,7 @@ export default function LineJsunit() {
describe('LineTest', function () {
beforeEach(async function (done) {
let options = {
uri: 'pages/line',
uri: '
MainAbility/
pages/line',
}
try {
router.clear();
...
...
arkui/ace_ets_component_three/entry/src/main/ets/test/List.test.ets
浏览文件 @
5371fdba
arkui/ace_ets_component_three/entry/src/main/ets/test/LongPressGesture.test.ets
浏览文件 @
5371fdba
...
...
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "
hypium/index
";
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "
@ohos/hypium
";
import router from '@system.router';
import events_emitter from '@ohos.events.emitter';
import Utils from './Utils';
...
...
@@ -23,7 +23,7 @@ export default function longPressGestureJsunit() {
beforeEach(async function (done) {
console.info("longPressGesture beforeEach start");
let options = {
uri: 'pages/longPressGesture',
uri: '
MainAbility/
pages/longPressGesture',
}
try {
router.clear();
...
...
arkui/ace_ets_component_three/entry/src/main/ets/test/MotionPathJsunit.test.ets
浏览文件 @
5371fdba
...
...
@@ -14,7 +14,7 @@
* limitations under the License.
*/
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "
hypium/index
"
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "
@ohos/hypium
"
import router from '@system.router';
import Utils from './Utils';
import events_emitter from '@ohos.events.emitter';
...
...
@@ -23,7 +23,7 @@ export default function motionPathJsunit() {
describe('motionPathTest', function () {
beforeEach(async function (done) {
let options = {
uri: 'pages/motionPath',
uri: '
MainAbility/
pages/motionPath',
}
try {
router.clear();
...
...
arkui/ace_ets_component_three/entry/src/main/ets/test/PanGestureJsunit.test.ets
浏览文件 @
5371fdba
...
...
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "
hypium/index
";
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "
@ohos/hypium
";
import router from '@system.router';
import events_emitter from '@ohos.events.emitter';
import Utils from './Utils';
...
...
@@ -26,7 +26,7 @@ export default function PanGestureJsunit() {
beforeEach(async function (done) {
console.info("PanGesture beforeEach start");
let options = {
uri: 'pages/PanGesture',
uri: '
MainAbility/
pages/PanGesture',
}
try {
router.clear();
...
...
arkui/ace_ets_component_three/entry/src/main/ets/test/ParallelGestureJsunit.test.ets
浏览文件 @
5371fdba
...
...
@@ -14,7 +14,7 @@
* limitations under the License.
*/
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "
hypium/index
"
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "
@ohos/hypium
"
import router from '@system.router';
import Utils from './Utils';
import events_emitter from '@ohos.events.emitter';
...
...
@@ -23,7 +23,7 @@ export default function parallelGestureJsunit() {
describe('parallelGestureTest', function () {
beforeEach(async function (done) {
let options = {
uri: 'pages/parallelGesture',
uri: '
MainAbility/
pages/parallelGesture',
}
try {
router.clear();
...
...
arkui/ace_ets_component_three/entry/src/main/ets/test/PriorityGestureJsunit.test.ets
浏览文件 @
5371fdba
...
...
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "
hypium/index
"
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "
@ohos/hypium
"
import router from '@system.router';
import Utils from './Utils';
import events_emitter from '@ohos.events.emitter';
...
...
@@ -22,7 +22,7 @@ export default function priorityGestureJsunit() {
describe('priorityGestureTest', function () {
beforeEach(async function (done) {
let options = {
uri: 'pages/priorityGesture',
uri: '
MainAbility/
pages/priorityGesture',
}
try {
router.clear();
...
...
arkui/ace_ets_component_three/entry/src/main/ets/test/ProgressJsunit.test.ets
浏览文件 @
5371fdba
...
...
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "
hypium/index
"
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "
@ohos/hypium
"
import router from '@system.router';
import Utils from './Utils';
import events_emitter from '@ohos.events.emitter';
...
...
@@ -22,7 +22,7 @@ export default function progressJsunit() {
describe('progressTest', function () {
beforeEach(async function (done) {
let options = {
uri: 'pages/progress',
uri: '
MainAbility/
pages/progress',
}
try {
router.clear();
...
...
arkui/ace_ets_component_three/entry/src/main/ets/test/QrCodeJsunit.test.ets
浏览文件 @
5371fdba
...
...
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "
hypium/index
";
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "
@ohos/hypium
";
import router from '@system.router';
import events_emitter from '@ohos.events.emitter';
import Utils from './Utils';
...
...
@@ -22,7 +22,7 @@ export default function qrCodeJsunit() {
describe('qrCodeTest', function () {
beforeEach(async function (done) {
let options = {
uri: 'pages/QrCode',
uri: '
MainAbility/
pages/QrCode',
}
try {
router.clear();
...
...
arkui/ace_ets_component_three/entry/src/main/ets/test/RatingJsunit.test.ets
浏览文件 @
5371fdba
...
...
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "
hypium/index
"
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "
@ohos/hypium
"
import router from '@system.router';
import Utils from './Utils';
import events_emitter from '@ohos.events.emitter';
...
...
@@ -22,7 +22,7 @@ export default function ratingJsunit() {
describe('ratingTest', function () {
beforeEach(async function (done) {
let options = {
uri: 'pages/rating',
uri: '
MainAbility/
pages/rating',
}
try {
router.clear();
...
...
arkui/ace_ets_component_three/entry/src/main/ets/test/ResponseRegionJsunit.test.ets
浏览文件 @
5371fdba
...
...
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "
hypium/index
";
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "
@ohos/hypium
";
import router from '@system.router';
import events_emitter from '@ohos.events.emitter';
import Utils from './Utils';
...
...
@@ -26,7 +26,7 @@ export default function ResponseRegionJsunit() {
beforeEach(async function (done) {
console.info("ResponseRegion beforeEach start");
let options = {
uri: 'pages/ResponseRegion',
uri: '
MainAbility/
pages/ResponseRegion',
}
try {
router.clear();
...
...
arkui/ace_ets_component_three/entry/src/main/ets/test/ScrollCodeJsunit.test.ets
浏览文件 @
5371fdba
...
...
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "
hypium/index
";
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "
@ohos/hypium
";
import router from '@system.router';
import events_emitter from '@ohos.events.emitter';
import Utils from './Utils';
...
...
@@ -22,7 +22,7 @@ export default function scrollCodeJsunit() {
describe('scrollCodeTest', function () {
beforeEach(async function (done) {
let options = {
uri: 'pages/scrollCode',
uri: '
MainAbility/
pages/scrollCode',
}
try {
router.clear();
...
...
arkui/ace_ets_component_three/entry/src/main/ets/test/ShapeJsunit.test.ets
浏览文件 @
5371fdba
...
...
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "
hypium/index
"
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "
@ohos/hypium
"
import router from '@system.router';
import Utils from './Utils';
import events_emitter from '@ohos.events.emitter';
...
...
@@ -22,7 +22,7 @@ export default function shapeJsunit() {
describe('shapeTest', function () {
beforeEach(async function (done) {
let options = {
uri: 'pages/shape',
uri: '
MainAbility/
pages/shape',
}
try {
router.clear();
...
...
@@ -378,110 +378,111 @@ export default function shapeJsunit() {
done();
});
it('shapeTest_
19
00', 0, async function (done) {
console.info('shapeTest_
19
00 START');
it('shapeTest_
21
00', 0, async function (done) {
console.info('shapeTest_
21
00 START');
await Utils.sleep(1000);
try {
var eventData = {
data: {
"strokeMiterLimit": "
5
",
"strokeMiterLimit": "
-0.11111
",
}
}
var innerEvent = {
eventId: 192,
priority: events_emitter.EventPriority.LOW
}
console.info("shapeTest_
19
00 start to publish emit");
console.info("shapeTest_
21
00 start to publish emit");
events_emitter.emit(innerEvent, eventData);
} catch (err) {
console.log("shapeTest_
19
00 change component color error: " + err.message);
console.log("shapeTest_
21
00 change component color error: " + err.message);
}
await Utils.sleep(2000);
var strJson = getInspectorByKey('shape');
var obj = JSON.parse(strJson);
console.info("shapeTest_
19
00 component obj is: " + JSON.stringify(obj.$attrs.strokeMiterLimit));
expect(obj.$attrs.strokeMiterLimit).assertEqual('
5
.000000');
console.info("shapeTest_
21
00 component obj is: " + JSON.stringify(obj.$attrs.strokeMiterLimit));
expect(obj.$attrs.strokeMiterLimit).assertEqual('
4
.000000');
done();
});
it('shapeTest_2
0
00', 0, async function (done) {
console.info('shapeTest_
20
00 START');
it('shapeTest_2
2
00', 0, async function (done) {
console.info('shapeTest_
13
00 START');
await Utils.sleep(1000);
try {
var eventData = {
data: {
"strokeMiterLimit":
"string"
,
"strokeMiterLimit":
'aaa11111'
,
}
}
var innerEvent = {
eventId: 192,
priority: events_emitter.EventPriority.LOW
}
console.info("shapeTest_2
0
00 start to publish emit");
console.info("shapeTest_2
2
00 start to publish emit");
events_emitter.emit(innerEvent, eventData);
} catch (err) {
console.log("shapeTest_2
0
00 change component color error: " + err.message);
console.log("shapeTest_2
2
00 change component color error: " + err.message);
}
await Utils.sleep(2000);
var strJson = getInspectorByKey('shape');
var obj = JSON.parse(strJson);
console.info("shapeTest_2
0
00 component obj is: " + JSON.stringify(obj.$attrs.strokeMiterLimit));
console.info("shapeTest_2
2
00 component obj is: " + JSON.stringify(obj.$attrs.strokeMiterLimit));
expect(obj.$attrs.strokeMiterLimit).assertEqual('4.000000');
done();
});
it('shapeTest_
21
00', 0, async function (done) {
console.info('shapeTest_
21
00 START');
it('shapeTest_
19
00', 0, async function (done) {
console.info('shapeTest_
19
00 START');
await Utils.sleep(1000);
try {
var eventData = {
data: {
"strokeMiterLimit":
'-0.11111'
,
"strokeMiterLimit":
"5"
,
}
}
var innerEvent = {
eventId: 192,
priority: events_emitter.EventPriority.LOW
}
console.info("shapeTest_
21
00 start to publish emit");
console.info("shapeTest_
19
00 start to publish emit");
events_emitter.emit(innerEvent, eventData);
} catch (err) {
console.log("shapeTest_
21
00 change component color error: " + err.message);
console.log("shapeTest_
19
00 change component color error: " + err.message);
}
await Utils.sleep(2000);
var strJson = getInspectorByKey('shape');
var obj = JSON.parse(strJson);
console.info("shapeTest_
21
00 component obj is: " + JSON.stringify(obj.$attrs.strokeMiterLimit));
expect(obj.$attrs.strokeMiterLimit).assertEqual('
4
.000000');
console.info("shapeTest_
19
00 component obj is: " + JSON.stringify(obj.$attrs.strokeMiterLimit));
expect(obj.$attrs.strokeMiterLimit).assertEqual('
5
.000000');
done();
});
it('shapeTest_2
2
00', 0, async function (done) {
console.info('shapeTest_
13
00 START');
it('shapeTest_2
0
00', 0, async function (done) {
console.info('shapeTest_
20
00 START');
await Utils.sleep(1000);
try {
var eventData = {
data: {
"strokeMiterLimit":
'aaa11111'
,
"strokeMiterLimit":
"string"
,
}
}
var innerEvent = {
eventId: 192,
priority: events_emitter.EventPriority.LOW
}
console.info("shapeTest_2
2
00 start to publish emit");
console.info("shapeTest_2
0
00 start to publish emit");
events_emitter.emit(innerEvent, eventData);
} catch (err) {
console.log("shapeTest_2
2
00 change component color error: " + err.message);
console.log("shapeTest_2
0
00 change component color error: " + err.message);
}
await Utils.sleep(2000);
var strJson = getInspectorByKey('shape');
var obj = JSON.parse(strJson);
console.info("shapeTest_2
2
00 component obj is: " + JSON.stringify(obj.$attrs.strokeMiterLimit));
expect(obj.$attrs.strokeMiterLimit).assertEqual('
4
.000000');
console.info("shapeTest_2
0
00 component obj is: " + JSON.stringify(obj.$attrs.strokeMiterLimit));
expect(obj.$attrs.strokeMiterLimit).assertEqual('
5
.000000');
done();
});
it('shapeTest_2300', 0, async function (done) {
console.info('shapeTest_2300 START');
await Utils.sleep(1000);
...
...
arkui/ace_ets_component_three/entry/src/main/ets/test/SharedTransitionJsunit.test.ets
浏览文件 @
5371fdba
...
...
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "
hypium/index
"
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "
@ohos/hypium
"
import router from '@system.router';
import events_emitter from '@ohos.events.emitter'
import Utils from './Utils';
...
...
@@ -23,7 +23,7 @@ export default function sharedTransitionJsunit() {
beforeEach(async function (done) {
console.info("sharedTransition beforeEach start");
let options = {
uri: 'pages/sharedTransition',
uri: '
MainAbility/
pages/sharedTransition',
}
try {
router.clear();
...
...
@@ -92,16 +92,21 @@ export default function sharedTransitionJsunit() {
eventId: 194,
priority: events_emitter.EventPriority.LOW
}
console.info("sharedTransitionTest_0400 start to publish emit");
events_emitter.emit(indexEvent, eventData);
await Utils.sleep(2500);
} catch (err) {
console.log("sharedTransitionTest_0400 change component data error: " + err.message);
}
let callback = (indexEventOne) => {
console.info("sharedTransitionTest_0400 get state result is: " + JSON.stringify(indexEventOne));
try {
expect(indexEventOne.data.duration).assertEqual(2000);
expect(indexEventOne.data.delay).assertEqual(5);
expect(indexEventOne.data.type).assertEqual(SharedTransitionEffectType.Exchange);
} catch(err) {
console.info("sharedTransitionTest_0400 error: " + err.message);
}
}
let indexEventOne = {
eventId: 193,
...
...
arkui/ace_ets_component_three/entry/src/main/ets/test/SpanJsunit.test.ets
浏览文件 @
5371fdba
...
...
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "
hypium/index
"
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "
@ohos/hypium
"
import router from '@system.router';
import events_emitter from '@ohos.events.emitter';
import Utils from './Utils';
...
...
@@ -22,7 +22,7 @@ export default function spanJsunit() {
describe('spanTest', function () {
beforeEach(async function (done) {
let options = {
uri: 'pages/span',
uri: '
MainAbility/
pages/span',
}
try {
router.clear();
...
...
@@ -179,7 +179,7 @@ export default function spanJsunit() {
console.info("[testSpan007] component strJson:" + strJson);
let obj = JSON.parse(strJson);
console.info("[testSpan007] textCase:" + obj);
expect(obj.$attrs.textCase).assertEqual('TextCase.
Normal
');
expect(obj.$attrs.textCase).assertEqual('TextCase.
UpperCase
');
done();
});
...
...
@@ -205,7 +205,7 @@ export default function spanJsunit() {
console.info("[testSpan008] component strJson:" + strJson);
let obj = JSON.parse(strJson);
console.info("[testSpan008] fontColor:" + obj);
expect(obj.$attrs.fontColor).assertEqual('#FF000
00
0');
expect(obj.$attrs.fontColor).assertEqual('#FF000
99
0');
done();
});
...
...
@@ -231,7 +231,7 @@ export default function spanJsunit() {
console.info("[testSpan009] component strJson:" + strJson);
let obj = JSON.parse(strJson);
console.info("[testSpan009] fontColor:" + obj);
expect(obj.$attrs.fontColor).assertEqual('#FF000
00
0');
expect(obj.$attrs.fontColor).assertEqual('#FF000
99
0');
done();
});
})
...
...
arkui/ace_ets_component_three/entry/src/main/ets/test/TabsJsunit.test.ets
浏览文件 @
5371fdba
...
...
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "
hypium/index
"
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "
@ohos/hypium
"
import router from '@system.router';
import Utils from './Utils';
import events_emitter from '@ohos.events.emitter';
...
...
@@ -23,7 +23,7 @@ export default function tabsJsunit() {
beforeEach(async function (done) {
console.info("tabs beforeEach start");
let options = {
uri: 'pages/tabs',
uri: '
MainAbility/
pages/tabs',
}
try {
router.clear();
...
...
arkui/ace_ets_component_three/entry/src/main/ets/test/TapGesture.test.ets
浏览文件 @
5371fdba
...
...
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "
hypium/index
";
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "
@ohos/hypium
";
import router from '@system.router';
import events_emitter from '@ohos.events.emitter';
import Utils from './Utils';
...
...
@@ -23,7 +23,7 @@ export default function longPressGestureJsunit() {
beforeEach(async function (done) {
console.info("tapGesture beforeEach start");
let options = {
uri: 'pages/tapGesture',
uri: '
MainAbility/
pages/tapGesture',
}
try {
router.clear();
...
...
arkui/ace_ets_component_three/entry/src/main/ets/test/TextJsunit.test.ets
浏览文件 @
5371fdba
// @ts-nocheck
/**
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
...
...
@@ -13,7 +12,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "
hypium/index
";
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "
@ohos/hypium
";
import router from '@system.router';
import events_emitter from '@ohos.events.emitter';
import Utils from './Utils';
...
...
@@ -23,7 +22,7 @@ export default function textJsunit() {
beforeEach(async function (done) {
console.info("text beforeEach start");
let options = {
uri: 'pages/text',
uri: '
MainAbility/
pages/text',
}
try {
router.clear();
...
...
@@ -63,13 +62,8 @@ export default function textJsunit() {
let strJson = getInspectorByKey('image');
console.info("testText_0200 component strJson:" + strJson);
let obj = JSON.parse(strJson);
console.info("testText_0200 component obj is: " + JSON.stringify(obj));
var res = obj.$attrs.src.indexOf('RAWFILE/test.png');
console.info("testText_0200 result is: " + res);
var sres = obj.$attrs.src.slice(res, res + 16);
console.info("testText_0200 slice result is: " + sres);
expect(obj.$type).assertEqual('Image');
expect(obj.$attrs.src.slice(res, res + 16)).assertEqual('RAWFILE/test.png');
console.info("testText_0200 component strJson:" + obj.$attrs.src);
expect(obj.$attrs.src).assertEqual('resource://rawfile/test.png');
console.info('testText_0200 END');
done();
});
...
...
@@ -244,7 +238,7 @@ export default function textJsunit() {
let strJsonNew = getInspectorByKey('text');
let objNew = JSON.parse(strJsonNew);
console.info("testText_1100 component objNew is: " + JSON.stringify(objNew.$attrs.fontColor));
expect(objNew.$attrs.fontColor).assertEqual('#
FF000000
');
expect(objNew.$attrs.fontColor).assertEqual('#
330A59F7
');
console.info('testText_1100 END');
done();
});
...
...
arkui/ace_ets_component_three/entry/src/main/ets/test/TimeStampJsunit.test.ets
浏览文件 @
5371fdba
...
...
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "
hypium/index
"
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "
@ohos/hypium
"
import router from '@system.router';
import Utils from './Utils';
import events_emitter from '@ohos.events.emitter';
...
...
@@ -22,7 +22,7 @@ export default function timeStampJsunit() {
describe('timeStampTest', function () {
beforeEach(async function (done) {
let options = {
uri: 'pages/timeStamp',
uri: '
MainAbility/
pages/timeStamp',
}
try {
router.clear();
...
...
arkui/ace_ets_component_three/entry/src/main/ets/test/ToggleJsunit.test.ets
浏览文件 @
5371fdba
...
...
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "
hypium/index
";
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "
@ohos/hypium
";
import router from '@system.router';
import events_emitter from '@ohos.events.emitter';
import Utils from './Utils';
...
...
@@ -23,7 +23,7 @@ export default function ToggleJsunit() {
beforeEach(async function (done) {
console.info("toggle beforeEach start");
let options = {
uri: 'pages/toggle',
uri: '
MainAbility/
pages/toggle',
}
try {
router.clear();
...
...
arkui/ace_ets_component_three/entry/src/main/ets/test/TransitionJsunit.test.ets
浏览文件 @
5371fdba
...
...
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "
hypium/index
";
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "
@ohos/hypium
";
import router from '@system.router';
import events_emitter from '@ohos.events.emitter';
import Utils from './Utils';
...
...
@@ -23,7 +23,7 @@ export default function transitionJsunit() {
beforeEach(async function (done) {
console.info("text beforeEach start");
let options = {
uri: 'pages/transition',
uri: '
MainAbility/
pages/transition',
}
try {
router.clear();
...
...
arkui/ace_ets_component_three/entry/src/main/module.json
0 → 100644
浏览文件 @
5371fdba
{
"module"
:
{
"name"
:
"phone"
,
"type"
:
"entry"
,
"srcEntrance"
:
"./ets/Application/AbilityStage.ts"
,
"description"
:
"$string:phone_entry_dsc"
,
"mainElement"
:
"MainAbility"
,
"deviceTypes"
:
[
"tablet"
,
"default"
,
"phone"
],
"deliveryWithInstall"
:
true
,
"installationFree"
:
false
,
"uiSyntax"
:
"ets"
,
"pages"
:
"$profile:main_pages"
,
"abilities"
:
[{
"name"
:
"com.open.harmony.acetestthree.MainAbility"
,
"srcEntrance"
:
"./ets/MainAbility/MainAbility.ts"
,
"description"
:
"$string:phone_entry_main"
,
"icon"
:
"$media:icon"
,
"label"
:
"$string:entry_label"
,
"visible"
:
true
,
"orientation"
:
"portrait"
,
"skills"
:
[{
"actions"
:
[
"action.system.home"
],
"entities"
:
[
"entity.system.home"
]
}]
}]
}
}
\ No newline at end of file
arkui/ace_ets_component_three/entry/src/main/resources/base/element/string.json
浏览文件 @
5371fdba
...
...
@@ -27,6 +27,34 @@
{
"name"
:
"message_arrive"
,
"value"
:
"We will arrive at %s."
},
{
"name"
:
"phone_entry_dsc"
,
"value"
:
"i am an entry for phone"
},
{
"name"
:
"phone_entry_main"
,
"value"
:
"the phone entry ability"
},
{
"name"
:
"entry_label"
,
"value"
:
"ActsContextTest"
},
{
"name"
:
"form_description"
,
"value"
:
"my form"
},
{
"name"
:
"serviceability_description"
,
"value"
:
"my whether"
},
{
"name"
:
"description_application"
,
"value"
:
"demo for test"
},
{
"name"
:
"app_name"
,
"value"
:
"Demo"
}
]
}
\ No newline at end of file
arkui/ace_ets_component_three/entry/src/main/resources/base/profile/main_pages.json
0 → 100644
浏览文件 @
5371fdba
{
"src"
:
[
"MainAbility/pages/index"
,
"MainAbility/pages/index/index"
,
"MainAbility/pages/second/second"
,
"MainAbility/pages/toggle"
,
"MainAbility/pages/gridPage"
,
"MainAbility/pages/span"
,
"MainAbility/pages/text"
,
"MainAbility/pages/badge"
,
"MainAbility/pages/canvas"
,
"MainAbility/pages/longPressGesture"
,
"MainAbility/pages/button"
,
"MainAbility/pages/ResponseRegion"
,
"MainAbility/pages/PanGesture"
,
"MainAbility/pages/background"
,
"MainAbility/pages/QrCode"
,
"MainAbility/pages/tabs"
,
"MainAbility/pages/tapGesture"
,
"MainAbility/pages/progress"
,
"MainAbility/pages/animate"
,
"MainAbility/pages/rating"
,
"MainAbility/pages/canvas2"
,
"MainAbility/pages/shape"
,
"MainAbility/pages/motionPath"
,
"MainAbility/pages/scrollCode"
,
"MainAbility/pages/transition"
,
"MainAbility/pages/priorityGesture"
,
"MainAbility/pages/parallelGesture"
,
"MainAbility/pages/blank"
,
"MainAbility/pages/sharedTransition"
,
"MainAbility/pages/sharedTransition2"
,
"MainAbility/pages/line"
,
"MainAbility/pages/circle"
,
"MainAbility/pages/aboutToDisappear"
,
"MainAbility/pages/timeStamp"
]
}
\ No newline at end of file
arkui/ace_ets_dev/AppScope/app.json
0 → 100644
浏览文件 @
5371fdba
{
"app"
:
{
"bundleName"
:
"com.open.harmony.acedevtest"
,
"vendor"
:
"huawei"
,
"versionCode"
:
1000000
,
"versionName"
:
"1.0.0"
,
"debug"
:
false
,
"icon"
:
"$media:icon"
,
"label"
:
"$string:app_name"
,
"description"
:
"$string:description_application"
,
"distributedNotificationEnabled"
:
true
,
"keepAlive"
:
true
,
"singleUser"
:
true
,
"minAPIVersion"
:
10
,
"targetAPIVersion"
:
10
,
"car"
:
{
"apiCompatibleVersion"
:
10
,
"singleUser"
:
false
}
}
}
\ No newline at end of file
arkui/ace_ets_dev/AppScope/resources/base/element/string.json
0 → 100644
浏览文件 @
5371fdba
{
"string"
:[
{
"name"
:
"app_name"
,
"value"
:
"ohosProject"
}
]
}
\ No newline at end of file
arkui/ace_ets_dev/AppScope/resources/base/media/app_icon.png
0 → 100644
浏览文件 @
5371fdba
15.1 KB
arkui/ace_ets_dev/BUILD.gn
浏览文件 @
5371fdba
# Copyright (c) 202
1
Huawei Device Co., Ltd.
# Copyright (c) 202
3
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
...
...
@@ -14,23 +14,30 @@
import("//test/xts/tools/build/suite.gni")
ohos_js_hap_suite("ActsAceDevTest") {
hap_profile = "./entry/src/main/config.json"
hap_profile = "entry/src/main/module.json"
js_build_mode = "debug"
deps = [
":ace_ets_dev_assets",
":ace_ets_dev_resources",
":ace_ets_dev_test_assets",
":ace_ets_dev_resources"
]
ets2abc = true
certificate_profile = "
./
signature/openharmony_sx.p7b"
certificate_profile = "signature/openharmony_sx.p7b"
hap_name = "ActsAceDevTest"
subsystem_name = "arkui"
part_name = "ace_engine"
}
ohos_js_assets("ace_ets_dev_assets") {
source_dir = "./entry/src/main/ets/MainAbility"
ohos_app_scope("ace_ets_component_dev_app_profile") {
app_profile = "AppScope/app.json"
sources = [ "AppScope/resources" ]
}
ohos_js_assets("ace_ets_dev_test_assets") {
source_dir = "./entry/src/main/ets/TestAbility"
ohos_js_assets("ace_ets_dev_assets") {
source_dir = "entry/src/main/ets"
}
ohos_resources("ace_ets_dev_resources") {
sources = [ "./entry/src/main/resources" ]
hap_profile = "./entry/src/main/config.json"
sources = [ "entry/src/main/resources" ]
deps = [ ":ace_ets_component_dev_app_profile" ]
hap_profile = "entry/src/main/module.json"
}
arkui/ace_ets_dev/Test.json
浏览文件 @
5371fdba
{
"description"
:
"Configuration for
dev
Tests"
,
"description"
:
"Configuration for
hjunit demo
Tests"
,
"driver"
:
{
"type"
:
"OHJSUnitTest"
,
"test-timeout"
:
"600000"
,
"bundle-name"
:
"com.open.harmony.acedevtest"
,
"package-name"
:
"com.open.harmony.acedevtest
"
,
"module-name"
:
"phone
"
,
"shell-timeout"
:
"600000"
},
"kits"
:
[
...
...
arkui/ace_ets_dev/entry/src/main/config.json
已删除
100644 → 0
浏览文件 @
7aea3c5e
{
"app"
:
{
"bundleName"
:
"com.open.harmony.acedevtest"
,
"vendor"
:
"open"
,
"version"
:
{
"code"
:
1000000
,
"name"
:
"1.0.0"
},
"apiVersion"
:
{
"compatible"
:
7
,
"releaseType"
:
"Release"
,
"target"
:
8
}
},
"deviceConfig"
:
{},
"module"
:
{
"package"
:
"com.open.harmony.acedevtest"
,
"name"
:
".MyApplication"
,
"mainAbility"
:
"com.open.harmony.acedevtest.MainAbility"
,
"deviceType"
:
[
"tablet"
,
"default"
,
"phone"
],
"distro"
:
{
"deliveryWithInstall"
:
true
,
"moduleName"
:
"entry"
,
"moduleType"
:
"entry"
,
"installationFree"
:
false
},
"abilities"
:
[
{
"skills"
:
[
{
"entities"
:
[
"entity.system.home"
],
"actions"
:
[
"action.system.home"
]
}
],
"orientation"
:
"unspecified"
,
"visible"
:
true
,
"srcPath"
:
"MainAbility"
,
"name"
:
".MainAbility"
,
"srcLanguage"
:
"ets"
,
"icon"
:
"$media:icon"
,
"description"
:
"$string:description_mainability"
,
"formsEnabled"
:
false
,
"label"
:
"$string:entry_MainAbility"
,
"type"
:
"page"
,
"launchType"
:
"standard"
},
{
"orientation"
:
"unspecified"
,
"visible"
:
true
,
"srcPath"
:
"TestAbility"
,
"name"
:
".TestAbility"
,
"srcLanguage"
:
"ets"
,
"icon"
:
"$media:icon"
,
"description"
:
"$string:TestAbility_desc"
,
"formsEnabled"
:
false
,
"label"
:
"$string:TestAbility_label"
,
"type"
:
"page"
,
"launchType"
:
"standard"
}
],
"js"
:
[
{
"mode"
:
{
"syntax"
:
"ets"
,
"type"
:
"pageAbility"
},
"pages"
:
[
"pages/index"
,
"pages/curve"
],
"name"
:
".MainAbility"
,
"window"
:
{
"designWidth"
:
720
,
"autoDesignWidth"
:
false
}
},
{
"mode"
:
{
"syntax"
:
"ets"
,
"type"
:
"pageAbility"
},
"pages"
:
[
"pages/index"
],
"name"
:
".TestAbility"
,
"window"
:
{
"designWidth"
:
720
,
"autoDesignWidth"
:
false
}
}
]
}
}
arkui/ace_ets_dev/entry/src/main/ets/Application/AbilityStage.ts
0 → 100644
浏览文件 @
5371fdba
import
AbilityStage
from
"
@ohos.app.ability.AbilityStage
"
export
default
class
MyAbilityStage
extends
AbilityStage
{
onCreate
()
{
console
.
log
(
"
[Demo] MyAbilityStage onCreate
"
)
globalThis
.
stageOnCreateRun
=
1
;
globalThis
.
stageContext
=
this
.
context
;
}
}
arkui/ace_ets_dev/entry/src/main/ets/MainAbility/MainAbility.ts
0 → 100644
浏览文件 @
5371fdba
import
Ability
from
'
@ohos.app.ability.UIAbility
'
export
default
class
MainAbility
extends
Ability
{
onCreate
(
want
,
launchParam
){
// Ability is creating, initialize resources for this ability
console
.
log
(
"
[Demo] MainAbility onCreate
"
)
globalThis
.
abilityWant
=
want
;
}
onDestroy
()
{
// Ability is destroying, release resources for this ability
console
.
log
(
"
[Demo] MainAbility onDestroy
"
)
}
onWindowStageCreate
(
windowStage
)
{
// Main window is created, set main page for this ability
console
.
log
(
"
[Demo] MainAbility onWindowStageCreate windowStage=
"
+
windowStage
)
globalThis
.
windowStage
=
windowStage
globalThis
.
abilityContext
=
this
.
context
windowStage
.
setUIContent
(
this
.
context
,
"
MainAbility/pages/index/index
"
,
null
)
}
onWindowStageDestroy
()
{
//Main window is destroyed, release UI related resources
console
.
log
(
"
[Demo] MainAbility onWindowStageDestroy
"
)
}
onForeground
()
{
// Ability has brought to foreground
console
.
log
(
"
[Demo] MainAbility onForeground
"
)
}
onBackground
()
{
// Ability has back to background
console
.
log
(
"
[Demo] MainAbility onBackground
"
)
}
};
\ No newline at end of file
arkui/ace_ets_dev/entry/src/main/ets/MainAbility/app.ets
已删除
100644 → 0
浏览文件 @
7aea3c5e
// @ts-nocheck
/**
* Copyright (c) 2021 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 AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'
import { Hypium } from 'hypium/index'
import testsuite from '../test/List.test'
export default {
onCreate() {
console.info('Application 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.info('Application onDestroy')
},
}
\ No newline at end of file
arkui/ace_ets_dev/entry/src/main/ets/MainAbility/pages/index/index.ets
0 → 100644
浏览文件 @
5371fdba
/*
* Copyright (c) 2021 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';
import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'
import { Hypium } from '@ohos/hypium'
import testsuite from '../../../test/List.test'
@Entry
@Component
struct Index {
aboutToAppear(){
console.info("start run testcase!!!!")
var abilityDelegator: any
abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator()
var abilityDelegatorArguments: any
abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments()
console.info('start run testcase!!!')
Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite)
}
build() {
Flex({ direction:FlexDirection.Column, alignItems:ItemAlign.Center, justifyContent: FlexAlign.Center }) {
Text('Hello World')
.fontSize(50)
.fontWeight(FontWeight.Bold)
Button() {
Text('next page')
.fontSize(25)
.fontWeight(FontWeight.Bold)
}.type(ButtonType.Capsule)
.margin({
top: 20
})
.backgroundColor('#0D9FFB')
.onClick(() => {
})
}
.width('100%')
.height('100%')
}
}
\ No newline at end of file
arkui/ace_ets_
component_five/entry/src/main/ets/TestAbility/app
.ets
→
arkui/ace_ets_
dev/entry/src/main/ets/MainAbility/pages/second/second
.ets
浏览文件 @
5371fdba
// @ts-nocheck
/**
/*
* Copyright (c) 2021 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.
...
...
@@ -13,21 +12,32 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'
import { Hypium } from 'hypium/index'
import testsuite from '../test/List.test'
import router from '@system.router';
export default {
onCreate() {
console.info('Application 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.info('Application onDestroy')
},
@Entry
@Component
struct Second {
private content: string = "Second Page"
build() {
Flex({ direction: FlexDirection.Column,alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) {
Text(`${this.content}`)
.fontSize(50)
.fontWeight(FontWeight.Bold)
Button() {
Text('back to index')
.fontSize(20)
.fontWeight(FontWeight.Bold)
}.type(ButtonType.Capsule)
.margin({
top: 20
})
.backgroundColor('#0D9FFB')
.onClick(() => {
router.back()
})
}
.width('100%')
.height('100%')
}
}
\ No newline at end of file
arkui/ace_ets_dev/entry/src/main/ets/MainAbility/utils/Common.ets
0 → 100644
浏览文件 @
5371fdba
/**
* Copyright (c) 2023 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.
*/
export default class CommonFunc {
static rect_left;
static rect_top;
static rect_right;
static rect_bottom;
static rect_value;
static sleep(time){
return new Promise((resolve,reject)=>{
setTimeout(()=>{
resolve("ok")
},time)
}).then(()=>{
console.info(`sleep ${time} over...`)
})
}
static getComponentRect(key) {
let strJson = getInspectorByKey(key);
let obj = JSON.parse(strJson);
console.info("[getInspectorByKey] current component obj is: " + JSON.stringify(obj));
let rectInfo = JSON.parse('[' + obj.$rect + ']')
console.info("[getInspectorByKey] rectInfo is: " + rectInfo);
this.rect_left = JSON.parse('[' + rectInfo[0] + ']')[0]
this.rect_top = JSON.parse('[' + rectInfo[0] + ']')[1]
this.rect_right = JSON.parse('[' + rectInfo[1] + ']')[0]
this.rect_bottom = JSON.parse('[' + rectInfo[1] + ']')[1]
return this.rect_value = {
"left": this.rect_left, "top": this.rect_top, "right": this.rect_right, "bottom": this.rect_bottom
}
}
}
arkui/ace_ets_dev/entry/src/main/ets/MainAbility/utils/MessageManager.ets
0 → 100644
浏览文件 @
5371fdba
/**
* Copyright (c) 2023 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.
*/
export interface Callback {
(message:any):void
}
export class MessageManager {
callback:Callback
callbacks:Map<string,Callback> = new Map()
constructor() {
}
registerCallback(callback:Callback , type?:string) {
if (type == undefined) {
console.error('registerCallback callback set')
this.callback = callback
return
}
this.callbacks.set(type,callback)
}
notify(message:any, type?:string) {
if (type == undefined) {
this.callback(message)
return
}
let tmpCallback:Callback = this.callbacks.get(type)
if (tmpCallback === undefined) {
console.error('callbacks has no callback for type ' + type)
return
}
tmpCallback(message)
}
clear() {
this.callbacks.clear()
this.callback = null
}
}
\ No newline at end of file
arkui/ace_ets_dev/entry/src/main/ets/TestAbility/TestAbility.ts
0 → 100644
浏览文件 @
5371fdba
/*
* 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.app.ability.UIAbility
'
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
.
loadContent
(
"
TestAbility/pages/index
"
,
(
err
,
data
)
=>
{
if
(
err
.
code
)
{
console
.
error
(
'
Failed to load the content. Cause:
'
+
JSON
.
stringify
(
err
));
return
;
}
console
.
info
(
'
Succeeded in loading the content. Data:
'
+
JSON
.
stringify
(
data
))
});
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
arkui/ace_ets_dev/entry/src/main/ets/TestAbility/app.ets
已删除
100644 → 0
浏览文件 @
7aea3c5e
// @ts-nocheck
/**
* Copyright (c) 2021 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 AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'
import { Hypium } from 'hypium/index'
import testsuite from '../test/List.test'
export default {
onCreate() {
console.info('Application 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.info('Application onDestroy')
},
}
\ No newline at end of file
arkui/ace_ets_dev/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts
浏览文件 @
5371fdba
// @ts-nocheck
/**
* Copyright (c) 2021 Huawei Device Co., Ltd.
/*
* 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
...
...
@@ -21,25 +20,25 @@ var abilityDelegatorArguments = undefined
function
translateParamsToString
(
parameters
)
{
const
keySet
=
new
Set
([
'
-s class
'
,
'
-s notClass
'
,
'
-s suite
'
,
'
-s it
Name
'
,
'
-s class
'
,
'
-s notClass
'
,
'
-s suite
'
,
'
-s it
'
,
'
-s level
'
,
'
-s testType
'
,
'
-s size
'
,
'
-s timeout
'
,
'
-s
package
'
'
-s
dryRun
'
])
let
targetParams
=
''
;
for
(
const
key
in
parameters
)
{
if
(
keySet
.
has
(
key
))
{
targetParams
+=
'
'
+
key
+
'
'
+
parameters
[
key
]
targetParams
=
`
${
targetParams
}
${
key
}
${
parameters
[
key
]}
`
}
}
return
targetParams
.
trim
()
}
async
function
onAbilityCreateCallback
()
{
console
.
log
(
'
onAbilityCreateCallback
'
);
console
.
log
(
"
onAbilityCreateCallback
"
);
}
async
function
addAbilityMonitorCallback
(
err
:
any
)
{
console
.
info
(
'
addAbilityMonitorCallback :
'
+
JSON
.
stringify
(
err
))
console
.
info
(
"
addAbilityMonitorCallback :
"
+
JSON
.
stringify
(
err
))
}
export
default
class
OpenHarmonyTestRunner
implements
TestRunner
{
...
...
@@ -47,22 +46,26 @@ export default class OpenHarmonyTestRunner implements TestRunner {
}
onPrepare
()
{
console
.
info
(
'
OpenHarmonyTestRunner OnPrepare
'
)
console
.
info
(
"
OpenHarmonyTestRunner OnPrepare
"
)
}
onRun
()
{
async
onRun
()
{
console
.
log
(
'
OpenHarmonyTestRunner onRun run
'
)
abilityDelegatorArguments
=
AbilityDelegatorRegistry
.
getArguments
()
abilityDelegator
=
AbilityDelegatorRegistry
.
getAbilityDelegator
()
var
testAbilityName
=
abilityDelegatorArguments
.
bundleName
+
'
.MainAbility
'
let
lMonitor
=
{
abilityName
:
testAbilityName
,
onAbilityCreate
:
onAbilityCreateCallback
,
};
var
testAbilityName
=
abilityDelegatorArguments
.
parameters
[
'
-p
'
]
+
'
.MainAbility
'
abilityDelegator
.
addAbilityMonitor
(
lMonitor
,
addAbilityMonitorCallback
)
var
cmd
=
'
aa start -d 0 -a
'
+
testAbilityName
+
'
-b
'
+
abilityDelegatorArguments
.
bundleName
var
cmd
=
'
aa start -d 0 -a
com.open.harmony.acedevtest.MainAbility
'
+
'
-b
'
+
abilityDelegatorArguments
.
bundleName
cmd
+=
'
'
+
translateParamsToString
(
abilityDelegatorArguments
.
parameters
)
var
debug
=
abilityDelegatorArguments
.
parameters
[
"
-D
"
]
if
(
debug
==
'
true
'
)
{
cmd
+=
'
-D
'
}
console
.
info
(
'
cmd :
'
+
cmd
)
abilityDelegator
.
executeShellCommand
(
cmd
,
(
err
:
any
,
d
:
any
)
=>
{
...
...
@@ -70,9 +73,6 @@ export default class OpenHarmonyTestRunner implements TestRunner {
console
.
info
(
'
executeShellCommand : data :
'
+
d
.
stdResult
);
console
.
info
(
'
executeShellCommand : data :
'
+
d
.
exitCode
);
})
console
.
info
(
'
OpenHarmonyTestRunner onRun call abilityDelegator.getAppContext
'
)
var
context
=
abilityDelegator
.
getAppContext
()
console
.
info
(
'
getAppContext :
'
+
JSON
.
stringify
(
context
))
console
.
info
(
'
OpenHarmonyTestRunner onRun end
'
)
}
};
arkui/ace_ets_dev/entry/src/main/ets/test/CurveJsunit.test.ets
浏览文件 @
5371fdba
// @ts-nocheck
/**
* Copyright (c) 202
1
Huawei Device Co., Ltd.
* Copyright (c) 202
3
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
...
...
@@ -15,7 +15,7 @@
*/
import router from '@system.router';
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "
hypium/index
"
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "
@ohos/hypium
"
import Utils from './Utils.ets'
export default function CurveJsunit() {
...
...
@@ -23,7 +23,7 @@ export default function CurveJsunit() {
beforeEach(async function (done) {
console.info("flex beforeEach start");
let options = {
uri: 'pages/curve',
uri: '
MainAbility/
pages/curve',
}
try {
router.clear();
...
...
arkui/ace_ets_dev/entry/src/main/module.json
0 → 100644
浏览文件 @
5371fdba
{
"module"
:
{
"name"
:
"phone"
,
"type"
:
"entry"
,
"srcEntrance"
:
"./ets/Application/AbilityStage.ts"
,
"description"
:
"$string:phone_entry_dsc"
,
"mainElement"
:
"MainAbility"
,
"deviceTypes"
:
[
"tablet"
,
"default"
,
"phone"
],
"deliveryWithInstall"
:
true
,
"installationFree"
:
false
,
"uiSyntax"
:
"ets"
,
"pages"
:
"$profile:main_pages"
,
"abilities"
:
[{
"name"
:
"com.open.harmony.acedevtest.MainAbility"
,
"srcEntrance"
:
"./ets/MainAbility/MainAbility.ts"
,
"description"
:
"$string:phone_entry_main"
,
"icon"
:
"$media:icon"
,
"label"
:
"$string:entry_label"
,
"visible"
:
true
,
"orientation"
:
"portrait"
,
"skills"
:
[{
"actions"
:
[
"action.system.home"
],
"entities"
:
[
"entity.system.home"
]
}]
}]
}
}
arkui/ace_ets_dev/entry/src/main/resources/base/element/string.json
浏览文件 @
5371fdba
...
...
@@ -27,6 +27,34 @@
{
"name"
:
"message_arrive"
,
"value"
:
"We will arrive at %s."
},
{
"name"
:
"phone_entry_dsc"
,
"value"
:
"i am an entry for phone"
},
{
"name"
:
"phone_entry_main"
,
"value"
:
"the phone entry ability"
},
{
"name"
:
"entry_label"
,
"value"
:
"ActsContextTest"
},
{
"name"
:
"form_description"
,
"value"
:
"my form"
},
{
"name"
:
"serviceability_description"
,
"value"
:
"my whether"
},
{
"name"
:
"description_application"
,
"value"
:
"demo for test"
},
{
"name"
:
"app_name"
,
"value"
:
"Demo"
}
]
}
\ No newline at end of file
arkui/ace_ets_dev/entry/src/main/resources/base/profile/main_pages.json
0 → 100644
浏览文件 @
5371fdba
{
"src"
:
[
"MainAbility/pages/index/index"
,
"MainAbility/pages/second/second"
,
"MainAbility/pages/index"
,
"MainAbility/pages/curve"
]
}
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录