Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
efc94c7c
X
Xts Acts
项目概览
OpenHarmony
/
Xts Acts
大约 1 年 前同步成功
通知
9
Star
22
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
X
Xts Acts
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
efc94c7c
编写于
4月 27, 2023
作者:
O
openharmony_ci
提交者:
Gitee
4月 27, 2023
浏览文件
操作
浏览文件
下载
差异文件
!8552 【ACE子系统】切stage模型&适配测试用例
Merge pull request !8552 from hekun/master
上级
a8cf93cc
b9fd5c57
变更
162
隐藏空白更改
内联
并排
Showing
162 changed file
with
1563 addition
and
728 deletion
+1563
-728
arkui/ace_ets_standard/AppScope/app.json
arkui/ace_ets_standard/AppScope/app.json
+21
-0
arkui/ace_ets_standard/AppScope/resources/base/element/string.json
..._ets_standard/AppScope/resources/base/element/string.json
+8
-0
arkui/ace_ets_standard/AppScope/resources/base/media/app_icon.png
...e_ets_standard/AppScope/resources/base/media/app_icon.png
+0
-0
arkui/ace_ets_standard/BUILD.gn
arkui/ace_ets_standard/BUILD.gn
+14
-10
arkui/ace_ets_standard/Test.json
arkui/ace_ets_standard/Test.json
+2
-2
arkui/ace_ets_standard/entry/src/main/config.json
arkui/ace_ets_standard/entry/src/main/config.json
+0
-122
arkui/ace_ets_standard/entry/src/main/ets/Application/AbilityStage.ts
...s_standard/entry/src/main/ets/Application/AbilityStage.ts
+9
-0
arkui/ace_ets_standard/entry/src/main/ets/MainAbility/MainAbility.ts
...ts_standard/entry/src/main/ets/MainAbility/MainAbility.ts
+37
-0
arkui/ace_ets_standard/entry/src/main/ets/MainAbility/pages/Badge.ets
...s_standard/entry/src/main/ets/MainAbility/pages/Badge.ets
+1
-1
arkui/ace_ets_standard/entry/src/main/ets/MainAbility/pages/Blank.ets
...s_standard/entry/src/main/ets/MainAbility/pages/Blank.ets
+1
-1
arkui/ace_ets_standard/entry/src/main/ets/MainAbility/pages/Button.ets
..._standard/entry/src/main/ets/MainAbility/pages/Button.ets
+1
-1
arkui/ace_ets_standard/entry/src/main/ets/MainAbility/pages/Column.ets
..._standard/entry/src/main/ets/MainAbility/pages/Column.ets
+1
-1
arkui/ace_ets_standard/entry/src/main/ets/MainAbility/pages/ColumnSplit.ets
...dard/entry/src/main/ets/MainAbility/pages/ColumnSplit.ets
+1
-1
arkui/ace_ets_standard/entry/src/main/ets/MainAbility/pages/Counter.ets
...standard/entry/src/main/ets/MainAbility/pages/Counter.ets
+1
-1
arkui/ace_ets_standard/entry/src/main/ets/MainAbility/pages/DataPanel.ets
...andard/entry/src/main/ets/MainAbility/pages/DataPanel.ets
+1
-1
arkui/ace_ets_standard/entry/src/main/ets/MainAbility/pages/Divider.ets
...standard/entry/src/main/ets/MainAbility/pages/Divider.ets
+1
-1
arkui/ace_ets_standard/entry/src/main/ets/MainAbility/pages/Flex.ets
...ts_standard/entry/src/main/ets/MainAbility/pages/Flex.ets
+1
-1
arkui/ace_ets_standard/entry/src/main/ets/MainAbility/pages/GridContainer.ets
...rd/entry/src/main/ets/MainAbility/pages/GridContainer.ets
+1
-1
arkui/ace_ets_standard/entry/src/main/ets/MainAbility/pages/Image.ets
...s_standard/entry/src/main/ets/MainAbility/pages/Image.ets
+2
-2
arkui/ace_ets_standard/entry/src/main/ets/MainAbility/pages/Navigator.ets
...andard/entry/src/main/ets/MainAbility/pages/Navigator.ets
+1
-1
arkui/ace_ets_standard/entry/src/main/ets/MainAbility/pages/Panel.ets
...s_standard/entry/src/main/ets/MainAbility/pages/Panel.ets
+1
-1
arkui/ace_ets_standard/entry/src/main/ets/MainAbility/pages/Progress.ets
...tandard/entry/src/main/ets/MainAbility/pages/Progress.ets
+1
-1
arkui/ace_ets_standard/entry/src/main/ets/MainAbility/pages/Qrcode.ets
..._standard/entry/src/main/ets/MainAbility/pages/Qrcode.ets
+1
-1
arkui/ace_ets_standard/entry/src/main/ets/MainAbility/pages/Rating.ets
..._standard/entry/src/main/ets/MainAbility/pages/Rating.ets
+1
-1
arkui/ace_ets_standard/entry/src/main/ets/MainAbility/pages/RowSplit.ets
...tandard/entry/src/main/ets/MainAbility/pages/RowSplit.ets
+1
-1
arkui/ace_ets_standard/entry/src/main/ets/MainAbility/pages/Scroll.ets
..._standard/entry/src/main/ets/MainAbility/pages/Scroll.ets
+1
-1
arkui/ace_ets_standard/entry/src/main/ets/MainAbility/pages/Slider.ets
..._standard/entry/src/main/ets/MainAbility/pages/Slider.ets
+1
-1
arkui/ace_ets_standard/entry/src/main/ets/MainAbility/pages/Span.ets
...ts_standard/entry/src/main/ets/MainAbility/pages/Span.ets
+1
-1
arkui/ace_ets_standard/entry/src/main/ets/MainAbility/pages/Stack.ets
...s_standard/entry/src/main/ets/MainAbility/pages/Stack.ets
+1
-1
arkui/ace_ets_standard/entry/src/main/ets/MainAbility/pages/Text.ets
...ts_standard/entry/src/main/ets/MainAbility/pages/Text.ets
+1
-1
arkui/ace_ets_standard/entry/src/main/ets/MainAbility/pages/index.ets
...s_standard/entry/src/main/ets/MainAbility/pages/index.ets
+1
-1
arkui/ace_ets_standard/entry/src/main/ets/MainAbility/pages/index/index.ets
...dard/entry/src/main/ets/MainAbility/pages/index/index.ets
+56
-0
arkui/ace_ets_standard/entry/src/main/ets/MainAbility/pages/second/second.ets
...rd/entry/src/main/ets/MainAbility/pages/second/second.ets
+43
-0
arkui/ace_ets_standard/entry/src/main/ets/MainAbility/utils/Common.ets
..._standard/entry/src/main/ets/MainAbility/utils/Common.ets
+51
-0
arkui/ace_ets_standard/entry/src/main/ets/MainAbility/utils/MessageManager.ets
...d/entry/src/main/ets/MainAbility/utils/MessageManager.ets
+54
-0
arkui/ace_ets_standard/entry/src/main/ets/TestAbility/TestAbility.ts
...ts_standard/entry/src/main/ets/TestAbility/TestAbility.ts
+50
-0
arkui/ace_ets_standard/entry/src/main/ets/TestAbility/pages/index.ets
...s_standard/entry/src/main/ets/TestAbility/pages/index.ets
+2
-3
arkui/ace_ets_standard/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts
...rd/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts
+17
-17
arkui/ace_ets_standard/entry/src/main/ets/test/BadgeJsunit.test.ets
...ets_standard/entry/src/main/ets/test/BadgeJsunit.test.ets
+3
-3
arkui/ace_ets_standard/entry/src/main/ets/test/BlankJsunit.test.ets
...ets_standard/entry/src/main/ets/test/BlankJsunit.test.ets
+3
-3
arkui/ace_ets_standard/entry/src/main/ets/test/ButtonJsunit.test.ets
...ts_standard/entry/src/main/ets/test/ButtonJsunit.test.ets
+3
-3
arkui/ace_ets_standard/entry/src/main/ets/test/ColumnJsunit.test.ets
...ts_standard/entry/src/main/ets/test/ColumnJsunit.test.ets
+3
-3
arkui/ace_ets_standard/entry/src/main/ets/test/ColumnSplitJsunit.test.ets
...andard/entry/src/main/ets/test/ColumnSplitJsunit.test.ets
+3
-3
arkui/ace_ets_standard/entry/src/main/ets/test/CounterJsunit.test.ets
...s_standard/entry/src/main/ets/test/CounterJsunit.test.ets
+3
-3
arkui/ace_ets_standard/entry/src/main/ets/test/DataPanelJsunit.test.ets
...standard/entry/src/main/ets/test/DataPanelJsunit.test.ets
+3
-3
arkui/ace_ets_standard/entry/src/main/ets/test/DividerJsunit.test.ets
...s_standard/entry/src/main/ets/test/DividerJsunit.test.ets
+3
-3
arkui/ace_ets_standard/entry/src/main/ets/test/FlexJsunit.test.ets
..._ets_standard/entry/src/main/ets/test/FlexJsunit.test.ets
+3
-3
arkui/ace_ets_standard/entry/src/main/ets/test/GridContainerJsunit.test.ets
...dard/entry/src/main/ets/test/GridContainerJsunit.test.ets
+3
-3
arkui/ace_ets_standard/entry/src/main/ets/test/ImageJsunit.test.ets
...ets_standard/entry/src/main/ets/test/ImageJsunit.test.ets
+3
-3
arkui/ace_ets_standard/entry/src/main/ets/test/List.test.ets
arkui/ace_ets_standard/entry/src/main/ets/test/List.test.ets
+2
-2
arkui/ace_ets_standard/entry/src/main/ets/test/PanelJsunit.test.ets
...ets_standard/entry/src/main/ets/test/PanelJsunit.test.ets
+3
-3
arkui/ace_ets_standard/entry/src/main/ets/test/ProgressJsunit.test.ets
..._standard/entry/src/main/ets/test/ProgressJsunit.test.ets
+3
-3
arkui/ace_ets_standard/entry/src/main/ets/test/QrcodeJsunit.test.ets
...ts_standard/entry/src/main/ets/test/QrcodeJsunit.test.ets
+3
-3
arkui/ace_ets_standard/entry/src/main/ets/test/RatingJsunit.test.ets
...ts_standard/entry/src/main/ets/test/RatingJsunit.test.ets
+3
-3
arkui/ace_ets_standard/entry/src/main/ets/test/RowSplitJsunit.test.ets
..._standard/entry/src/main/ets/test/RowSplitJsunit.test.ets
+3
-3
arkui/ace_ets_standard/entry/src/main/ets/test/ScrollJsunit.test.ets
...ts_standard/entry/src/main/ets/test/ScrollJsunit.test.ets
+3
-3
arkui/ace_ets_standard/entry/src/main/ets/test/SliderJsunit.test.ets
...ts_standard/entry/src/main/ets/test/SliderJsunit.test.ets
+5
-5
arkui/ace_ets_standard/entry/src/main/ets/test/SpanJsunit.test.ets
..._ets_standard/entry/src/main/ets/test/SpanJsunit.test.ets
+3
-3
arkui/ace_ets_standard/entry/src/main/ets/test/StackJsunit.test.ets
...ets_standard/entry/src/main/ets/test/StackJsunit.test.ets
+3
-3
arkui/ace_ets_standard/entry/src/main/ets/test/TextJsunit.test.ets
..._ets_standard/entry/src/main/ets/test/TextJsunit.test.ets
+6
-6
arkui/ace_ets_standard/entry/src/main/module.json
arkui/ace_ets_standard/entry/src/main/module.json
+35
-0
arkui/ace_ets_standard/entry/src/main/resources/base/element/string.json
...tandard/entry/src/main/resources/base/element/string.json
+28
-0
arkui/ace_ets_standard/entry/src/main/resources/base/profile/main_pages.json
...ard/entry/src/main/resources/base/profile/main_pages.json
+27
-0
arkui/ace_ets_test/AppScope/app.json
arkui/ace_ets_test/AppScope/app.json
+21
-0
arkui/ace_ets_test/AppScope/resources/base/element/string.json
.../ace_ets_test/AppScope/resources/base/element/string.json
+8
-0
arkui/ace_ets_test/AppScope/resources/base/media/app_icon.png
...i/ace_ets_test/AppScope/resources/base/media/app_icon.png
+0
-0
arkui/ace_ets_test/BUILD.gn
arkui/ace_ets_test/BUILD.gn
+15
-10
arkui/ace_ets_test/Test.json
arkui/ace_ets_test/Test.json
+2
-2
arkui/ace_ets_test/entry/src/main/config.json
arkui/ace_ets_test/entry/src/main/config.json
+0
-130
arkui/ace_ets_test/entry/src/main/ets/Application/AbilityStage.ts
...e_ets_test/entry/src/main/ets/Application/AbilityStage.ts
+9
-0
arkui/ace_ets_test/entry/src/main/ets/MainAbility/MainAbility.ts
...ce_ets_test/entry/src/main/ets/MainAbility/MainAbility.ts
+37
-0
arkui/ace_ets_test/entry/src/main/ets/MainAbility/pages/AlertDialog.ets
...test/entry/src/main/ets/MainAbility/pages/AlertDialog.ets
+1
-1
arkui/ace_ets_test/entry/src/main/ets/MainAbility/pages/AlphabetIndexer.ets
.../entry/src/main/ets/MainAbility/pages/AlphabetIndexer.ets
+1
-1
arkui/ace_ets_test/entry/src/main/ets/MainAbility/pages/AppStorage.ets
..._test/entry/src/main/ets/MainAbility/pages/AppStorage.ets
+1
-1
arkui/ace_ets_test/entry/src/main/ets/MainAbility/pages/Calendar.ets
...ts_test/entry/src/main/ets/MainAbility/pages/Calendar.ets
+1
-1
arkui/ace_ets_test/entry/src/main/ets/MainAbility/pages/CustomDialog.ets
...est/entry/src/main/ets/MainAbility/pages/CustomDialog.ets
+1
-1
arkui/ace_ets_test/entry/src/main/ets/MainAbility/pages/Grid.ets
...ce_ets_test/entry/src/main/ets/MainAbility/pages/Grid.ets
+1
-1
arkui/ace_ets_test/entry/src/main/ets/MainAbility/pages/GridItem.ets
...ts_test/entry/src/main/ets/MainAbility/pages/GridItem.ets
+1
-1
arkui/ace_ets_test/entry/src/main/ets/MainAbility/pages/Link.ets
...ce_ets_test/entry/src/main/ets/MainAbility/pages/Link.ets
+1
-1
arkui/ace_ets_test/entry/src/main/ets/MainAbility/pages/List.ets
...ce_ets_test/entry/src/main/ets/MainAbility/pages/List.ets
+1
-1
arkui/ace_ets_test/entry/src/main/ets/MainAbility/pages/ListItem.ets
...ts_test/entry/src/main/ets/MainAbility/pages/ListItem.ets
+1
-1
arkui/ace_ets_test/entry/src/main/ets/MainAbility/pages/Navigator.ets
...s_test/entry/src/main/ets/MainAbility/pages/Navigator.ets
+1
-1
arkui/ace_ets_test/entry/src/main/ets/MainAbility/pages/Panel.ets
...e_ets_test/entry/src/main/ets/MainAbility/pages/Panel.ets
+1
-1
arkui/ace_ets_test/entry/src/main/ets/MainAbility/pages/Prop.ets
...ce_ets_test/entry/src/main/ets/MainAbility/pages/Prop.ets
+1
-1
arkui/ace_ets_test/entry/src/main/ets/MainAbility/pages/Row.ets
...ace_ets_test/entry/src/main/ets/MainAbility/pages/Row.ets
+1
-1
arkui/ace_ets_test/entry/src/main/ets/MainAbility/pages/Swiper.ets
..._ets_test/entry/src/main/ets/MainAbility/pages/Swiper.ets
+1
-1
arkui/ace_ets_test/entry/src/main/ets/MainAbility/pages/Tab.ets
...ace_ets_test/entry/src/main/ets/MainAbility/pages/Tab.ets
+1
-1
arkui/ace_ets_test/entry/src/main/ets/MainAbility/pages/Video.ets
...e_ets_test/entry/src/main/ets/MainAbility/pages/Video.ets
+1
-1
arkui/ace_ets_test/entry/src/main/ets/MainAbility/pages/components/FormComponentPage.ets
...in/ets/MainAbility/pages/components/FormComponentPage.ets
+1
-1
arkui/ace_ets_test/entry/src/main/ets/MainAbility/pages/components/Marquee.ets
...try/src/main/ets/MainAbility/pages/components/Marquee.ets
+1
-1
arkui/ace_ets_test/entry/src/main/ets/MainAbility/pages/components/Path.ets
.../entry/src/main/ets/MainAbility/pages/components/Path.ets
+1
-1
arkui/ace_ets_test/entry/src/main/ets/MainAbility/pages/components/PatternLock.ets
...src/main/ets/MainAbility/pages/components/PatternLock.ets
+1
-1
arkui/ace_ets_test/entry/src/main/ets/MainAbility/pages/components/Polygon.ets
...try/src/main/ets/MainAbility/pages/components/Polygon.ets
+1
-1
arkui/ace_ets_test/entry/src/main/ets/MainAbility/pages/components/Polyline.ets
...ry/src/main/ets/MainAbility/pages/components/Polyline.ets
+1
-1
arkui/ace_ets_test/entry/src/main/ets/MainAbility/pages/components/Rect.ets
.../entry/src/main/ets/MainAbility/pages/components/Rect.ets
+1
-1
arkui/ace_ets_test/entry/src/main/ets/MainAbility/pages/components/RichText.ets
...ry/src/main/ets/MainAbility/pages/components/RichText.ets
+1
-1
arkui/ace_ets_test/entry/src/main/ets/MainAbility/pages/components/Select.ets
...ntry/src/main/ets/MainAbility/pages/components/Select.ets
+1
-1
arkui/ace_ets_test/entry/src/main/ets/MainAbility/pages/components/Shape.ets
...entry/src/main/ets/MainAbility/pages/components/Shape.ets
+1
-1
arkui/ace_ets_test/entry/src/main/ets/MainAbility/pages/components/Sidebar.ets
...try/src/main/ets/MainAbility/pages/components/Sidebar.ets
+1
-1
arkui/ace_ets_test/entry/src/main/ets/MainAbility/pages/components/WebPage.ets
...try/src/main/ets/MainAbility/pages/components/WebPage.ets
+1
-1
arkui/ace_ets_test/entry/src/main/ets/MainAbility/pages/components/XComponentPage.ets
.../main/ets/MainAbility/pages/components/XComponentPage.ets
+1
-1
arkui/ace_ets_test/entry/src/main/ets/MainAbility/pages/index.ets
...e_ets_test/entry/src/main/ets/MainAbility/pages/index.ets
+1
-1
arkui/ace_ets_test/entry/src/main/ets/MainAbility/pages/index/index.ets
...test/entry/src/main/ets/MainAbility/pages/index/index.ets
+56
-0
arkui/ace_ets_test/entry/src/main/ets/MainAbility/pages/second/second.ets
...st/entry/src/main/ets/MainAbility/pages/second/second.ets
+43
-0
arkui/ace_ets_test/entry/src/main/ets/MainAbility/utils/Common.ets
..._ets_test/entry/src/main/ets/MainAbility/utils/Common.ets
+51
-0
arkui/ace_ets_test/entry/src/main/ets/MainAbility/utils/MessageManager.ets
...t/entry/src/main/ets/MainAbility/utils/MessageManager.ets
+54
-0
arkui/ace_ets_test/entry/src/main/ets/TestAbility/TestAbility.ts
...ce_ets_test/entry/src/main/ets/TestAbility/TestAbility.ts
+50
-0
arkui/ace_ets_test/entry/src/main/ets/TestAbility/pages/index.ets
...e_ets_test/entry/src/main/ets/TestAbility/pages/index.ets
+2
-3
arkui/ace_ets_test/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts
...st/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts
+17
-17
arkui/ace_ets_test/entry/src/main/ets/test/AlphabetIndexerJsunit.test.ets
...st/entry/src/main/ets/test/AlphabetIndexerJsunit.test.ets
+3
-3
arkui/ace_ets_test/entry/src/main/ets/test/AppStorageJsunit.test.ets
...ts_test/entry/src/main/ets/test/AppStorageJsunit.test.ets
+3
-3
arkui/ace_ets_test/entry/src/main/ets/test/GridItem.test.ets
arkui/ace_ets_test/entry/src/main/ets/test/GridItem.test.ets
+3
-3
arkui/ace_ets_test/entry/src/main/ets/test/GridJsnuit.test.ets
.../ace_ets_test/entry/src/main/ets/test/GridJsnuit.test.ets
+3
-3
arkui/ace_ets_test/entry/src/main/ets/test/LinkJsunit.test.ets
.../ace_ets_test/entry/src/main/ets/test/LinkJsunit.test.ets
+3
-3
arkui/ace_ets_test/entry/src/main/ets/test/List.test.ets
arkui/ace_ets_test/entry/src/main/ets/test/List.test.ets
+2
-1
arkui/ace_ets_test/entry/src/main/ets/test/ListItemJsunit.test.ets
..._ets_test/entry/src/main/ets/test/ListItemJsunit.test.ets
+3
-7
arkui/ace_ets_test/entry/src/main/ets/test/ListJsunit.test.ets
.../ace_ets_test/entry/src/main/ets/test/ListJsunit.test.ets
+5
-5
arkui/ace_ets_test/entry/src/main/ets/test/NavigatorJsunit.test.ets
...ets_test/entry/src/main/ets/test/NavigatorJsunit.test.ets
+3
-3
arkui/ace_ets_test/entry/src/main/ets/test/PanelJsunit.test.ets
...ace_ets_test/entry/src/main/ets/test/PanelJsunit.test.ets
+3
-3
arkui/ace_ets_test/entry/src/main/ets/test/PropJsunit.test.ets
.../ace_ets_test/entry/src/main/ets/test/PropJsunit.test.ets
+3
-3
arkui/ace_ets_test/entry/src/main/ets/test/RowJsunit.test.ets
...i/ace_ets_test/entry/src/main/ets/test/RowJsunit.test.ets
+3
-3
arkui/ace_ets_test/entry/src/main/ets/test/SwiperJsunit.test.ets
...ce_ets_test/entry/src/main/ets/test/SwiperJsunit.test.ets
+5
-5
arkui/ace_ets_test/entry/src/main/ets/test/TabJsunit.test.ets
...i/ace_ets_test/entry/src/main/ets/test/TabJsunit.test.ets
+3
-3
arkui/ace_ets_test/entry/src/main/ets/test/TextJsunit.test.ets
.../ace_ets_test/entry/src/main/ets/test/TextJsunit.test.ets
+3
-3
arkui/ace_ets_test/entry/src/main/ets/test/VideoJsunit.test.ets
...ace_ets_test/entry/src/main/ets/test/VideoJsunit.test.ets
+3
-3
arkui/ace_ets_test/entry/src/main/module.json
arkui/ace_ets_test/entry/src/main/module.json
+35
-0
arkui/ace_ets_test/entry/src/main/resources/base/element/string.json
...ts_test/entry/src/main/resources/base/element/string.json
+28
-0
arkui/ace_ets_test/entry/src/main/resources/base/profile/main_pages.json
...est/entry/src/main/resources/base/profile/main_pages.json
+36
-0
arkui/ace_ets_third_test/AppScope/app.json
arkui/ace_ets_third_test/AppScope/app.json
+21
-0
arkui/ace_ets_third_test/AppScope/resources/base/element/string.json
...ts_third_test/AppScope/resources/base/element/string.json
+8
-0
arkui/ace_ets_third_test/AppScope/resources/base/media/app_icon.png
...ets_third_test/AppScope/resources/base/media/app_icon.png
+0
-0
arkui/ace_ets_third_test/BUILD.gn
arkui/ace_ets_third_test/BUILD.gn
+15
-10
arkui/ace_ets_third_test/Test.json
arkui/ace_ets_third_test/Test.json
+2
-2
arkui/ace_ets_third_test/entry/src/main/config.json
arkui/ace_ets_third_test/entry/src/main/config.json
+0
-107
arkui/ace_ets_third_test/entry/src/main/ets/Application/AbilityStage.ts
...third_test/entry/src/main/ets/Application/AbilityStage.ts
+9
-0
arkui/ace_ets_third_test/entry/src/main/ets/MainAbility/MainAbility.ts
..._third_test/entry/src/main/ets/MainAbility/MainAbility.ts
+37
-0
arkui/ace_ets_third_test/entry/src/main/ets/MainAbility/app.ets
...ace_ets_third_test/entry/src/main/ets/MainAbility/app.ets
+0
-33
arkui/ace_ets_third_test/entry/src/main/ets/MainAbility/pages/Navigation.ets
..._test/entry/src/main/ets/MainAbility/pages/Navigation.ets
+1
-1
arkui/ace_ets_third_test/entry/src/main/ets/MainAbility/pages/ScrollBar.ets
...d_test/entry/src/main/ets/MainAbility/pages/ScrollBar.ets
+1
-1
arkui/ace_ets_third_test/entry/src/main/ets/MainAbility/pages/Stepper.ets
...ird_test/entry/src/main/ets/MainAbility/pages/Stepper.ets
+1
-1
arkui/ace_ets_third_test/entry/src/main/ets/MainAbility/pages/TextArea.ets
...rd_test/entry/src/main/ets/MainAbility/pages/TextArea.ets
+1
-1
arkui/ace_ets_third_test/entry/src/main/ets/MainAbility/pages/TextInput.ets
...d_test/entry/src/main/ets/MainAbility/pages/TextInput.ets
+1
-1
arkui/ace_ets_third_test/entry/src/main/ets/MainAbility/pages/Toggle.ets
...hird_test/entry/src/main/ets/MainAbility/pages/Toggle.ets
+1
-1
arkui/ace_ets_third_test/entry/src/main/ets/MainAbility/pages/index.ets
...third_test/entry/src/main/ets/MainAbility/pages/index.ets
+1
-1
arkui/ace_ets_third_test/entry/src/main/ets/MainAbility/pages/index/index.ets
...test/entry/src/main/ets/MainAbility/pages/index/index.ets
+56
-0
arkui/ace_ets_third_test/entry/src/main/ets/MainAbility/pages/second/second.ets
...st/entry/src/main/ets/MainAbility/pages/second/second.ets
+43
-0
arkui/ace_ets_third_test/entry/src/main/ets/MainAbility/utils/Common.ets
...hird_test/entry/src/main/ets/MainAbility/utils/Common.ets
+51
-0
arkui/ace_ets_third_test/entry/src/main/ets/MainAbility/utils/MessageManager.ets
...t/entry/src/main/ets/MainAbility/utils/MessageManager.ets
+54
-0
arkui/ace_ets_third_test/entry/src/main/ets/TestAbility/TestAbility.ts
..._third_test/entry/src/main/ets/TestAbility/TestAbility.ts
+50
-0
arkui/ace_ets_third_test/entry/src/main/ets/TestAbility/app.ets
...ace_ets_third_test/entry/src/main/ets/TestAbility/app.ets
+0
-33
arkui/ace_ets_third_test/entry/src/main/ets/TestAbility/pages/index.ets
...third_test/entry/src/main/ets/TestAbility/pages/index.ets
+2
-3
arkui/ace_ets_third_test/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts
...st/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts
+17
-17
arkui/ace_ets_third_test/entry/src/main/ets/test/List.test.ets
.../ace_ets_third_test/entry/src/main/ets/test/List.test.ets
+1
-1
arkui/ace_ets_third_test/entry/src/main/ets/test/NavigationJsunit.test.ets
...rd_test/entry/src/main/ets/test/NavigationJsunit.test.ets
+3
-3
arkui/ace_ets_third_test/entry/src/main/ets/test/ScrollerBarJsunit.test.ets
...d_test/entry/src/main/ets/test/ScrollerBarJsunit.test.ets
+3
-3
arkui/ace_ets_third_test/entry/src/main/ets/test/StepperJsunit.test.ets
...third_test/entry/src/main/ets/test/StepperJsunit.test.ets
+3
-3
arkui/ace_ets_third_test/entry/src/main/ets/test/TextAreaJsunit.test.ets
...hird_test/entry/src/main/ets/test/TextAreaJsunit.test.ets
+3
-3
arkui/ace_ets_third_test/entry/src/main/ets/test/TextInputJsunit.test.ets
...ird_test/entry/src/main/ets/test/TextInputJsunit.test.ets
+3
-3
arkui/ace_ets_third_test/entry/src/main/ets/test/ToggleJsunit.test.ets
..._third_test/entry/src/main/ets/test/ToggleJsunit.test.ets
+4
-4
arkui/ace_ets_third_test/entry/src/main/module.json
arkui/ace_ets_third_test/entry/src/main/module.json
+35
-0
arkui/ace_ets_third_test/entry/src/main/resources/base/element/string.json
...rd_test/entry/src/main/resources/base/element/string.json
+29
-1
arkui/ace_ets_third_test/entry/src/main/resources/base/profile/main_pages.json
...est/entry/src/main/resources/base/profile/main_pages.json
+13
-0
未找到文件。
arkui/ace_ets_standard/AppScope/app.json
0 → 100644
浏览文件 @
efc94c7c
{
"app"
:
{
"bundleName"
:
"com.open.harmony.myapplication"
,
"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_standard/AppScope/resources/base/element/string.json
0 → 100644
浏览文件 @
efc94c7c
{
"string"
:[
{
"name"
:
"app_name"
,
"value"
:
"ohosProject"
}
]
}
\ No newline at end of file
arkui/ace_ets_standard/AppScope/resources/base/media/app_icon.png
0 → 100644
浏览文件 @
efc94c7c
15.1 KB
arkui/ace_ets_standard/BUILD.gn
浏览文件 @
efc94c7c
# 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,25 +14,29 @@
import("//test/xts/tools/build/suite.gni")
ohos_js_hap_suite("ActsAceEtsStTest") {
hap_profile = "./entry/src/main/config.json"
hap_profile = "entry/src/main/module.json"
js_build_mode = "debug"
deps = [
":ace_demo_ets_assets",
":ace_demo_ets_resources",
":ace_demo_ets_test_assets",
]
ets2abc = true
certificate_profile = "
./
signature/openharmony_sx.p7b"
certificate_profile = "signature/openharmony_sx.p7b"
hap_name = "ActsAceEtsStTest"
subsystem_name = "arkui"
part_name = "ace_engine"
}
ohos_js_assets("ace_demo_ets_assets") {
source_dir = "./entry/src/main/ets/MainAbility"
ohos_app_scope("ace_demo_ets_app_profile") {
app_profile = "AppScope/app.json"
sources = [ "AppScope/resources" ]
}
ohos_js_assets("ace_demo_ets_test_assets") {
source_dir = "./entry/src/main/ets/TestAbility"
ohos_js_assets("ace_demo_ets_assets") {
source_dir = "entry/src/main/ets"
}
ohos_resources("ace_demo_ets_resources") {
sources = [ "./entry/src/main/resources" ]
hap_profile = "./entry/src/main/config.json"
sources = [ "entry/src/main/resources" ]
deps = [ ":ace_demo_ets_app_profile" ]
hap_profile = "entry/src/main/module.json"
}
arkui/ace_ets_standard/Test.json
浏览文件 @
efc94c7c
...
...
@@ -3,8 +3,8 @@
"driver"
:
{
"type"
:
"OHJSUnitTest"
,
"test-timeout"
:
"600000"
,
"bundle-name"
:
"com.open.harmony.myapplication"
,
"
package-name"
:
"com.open.harmony.myapplication
"
,
"bundle-name"
:
"com.open.harmony.myapplication"
,
"
module-name"
:
"phone
"
,
"shell-timeout"
:
"600000"
},
"kits"
:
[
...
...
arkui/ace_ets_standard/entry/src/main/config.json
已删除
100644 → 0
浏览文件 @
a8cf93cc
{
"app"
:
{
"bundleName"
:
"com.open.harmony.myapplication"
,
"vendor"
:
"open"
,
"version"
:
{
"code"
:
1000000
,
"name"
:
"1.0.0"
},
"apiVersion"
:
{
"compatible"
:
7
,
"releaseType"
:
"Release"
,
"target"
:
8
}
},
"deviceConfig"
:
{},
"module"
:
{
"package"
:
"com.open.harmony.myapplication"
,
"name"
:
".MyApplication"
,
"mainAbility"
:
".MainAbility"
,
"srcPath"
:
""
,
"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/Button"
,
"pages/Blank"
,
"pages/DataPanel"
,
"pages/Divider"
,
"pages/Text"
,
"pages/RowSplit"
,
"pages/Scroll"
,
"pages/Stack"
,
"pages/Image"
,
"pages/Progress"
,
"pages/Qrcode"
,
"pages/Rating"
,
"pages/Span"
,
"pages/Slider"
,
"pages/Badge"
,
"pages/Column"
,
"pages/ColumnSplit"
,
"pages/Counter"
,
"pages/Flex"
,
"pages/GridContainer"
],
"name"
:
".MainAbility"
,
"window"
:
{
"designWidth"
:
720
,
"autoDesignWidth"
:
false
}
},
{
"mode"
:
{
"syntax"
:
"ets"
,
"type"
:
"pageAbility"
},
"pages"
:
[
"pages/index"
],
"name"
:
".TestAbility"
,
"window"
:
{
"designWidth"
:
720
,
"autoDesignWidth"
:
false
}
}
]
}
}
\ No newline at end of file
arkui/ace_ets_standard/entry/src/main/ets/Application/AbilityStage.ts
0 → 100644
浏览文件 @
efc94c7c
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_standard/entry/src/main/ets/MainAbility/MainAbility.ts
0 → 100644
浏览文件 @
efc94c7c
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_standard/entry/src/main/ets/MainAbility/pages/Badge.ets
浏览文件 @
efc94c7c
/*
* 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
...
...
arkui/ace_ets_standard/entry/src/main/ets/MainAbility/pages/Blank.ets
浏览文件 @
efc94c7c
/*
* 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
...
...
arkui/ace_ets_standard/entry/src/main/ets/MainAbility/pages/Button.ets
浏览文件 @
efc94c7c
/*
* 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
...
...
arkui/ace_ets_standard/entry/src/main/ets/MainAbility/pages/Column.ets
浏览文件 @
efc94c7c
/*
* 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
...
...
arkui/ace_ets_standard/entry/src/main/ets/MainAbility/pages/ColumnSplit.ets
浏览文件 @
efc94c7c
/*
* 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
...
...
arkui/ace_ets_standard/entry/src/main/ets/MainAbility/pages/Counter.ets
浏览文件 @
efc94c7c
/*
* 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
...
...
arkui/ace_ets_standard/entry/src/main/ets/MainAbility/pages/DataPanel.ets
浏览文件 @
efc94c7c
/*
* 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
...
...
arkui/ace_ets_standard/entry/src/main/ets/MainAbility/pages/Divider.ets
浏览文件 @
efc94c7c
/*
* 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
...
...
arkui/ace_ets_standard/entry/src/main/ets/MainAbility/pages/Flex.ets
浏览文件 @
efc94c7c
/*
* 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
...
...
arkui/ace_ets_standard/entry/src/main/ets/MainAbility/pages/GridContainer.ets
浏览文件 @
efc94c7c
/*
* 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
...
...
arkui/ace_ets_standard/entry/src/main/ets/MainAbility/pages/Image.ets
浏览文件 @
efc94c7c
/*
* 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
...
...
@@ -43,7 +43,7 @@ struct image_textcase {
.renderMode(ImageRenderMode.Original)
.autoResize(false)
.syncLoad(false)
.sourceSize({ width:
200, height: 100
})
.sourceSize({ width:
px2vp(200), height: px2vp(100)
})
.alt("/resources/rawfile/person.png")
.key('image1')
Image("/resources/rawfile/hand.png")
...
...
arkui/ace_ets_standard/entry/src/main/ets/MainAbility/pages/Navigator.ets
浏览文件 @
efc94c7c
/*
* 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
...
...
arkui/ace_ets_standard/entry/src/main/ets/MainAbility/pages/Panel.ets
浏览文件 @
efc94c7c
/*
* 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
...
...
arkui/ace_ets_standard/entry/src/main/ets/MainAbility/pages/Progress.ets
浏览文件 @
efc94c7c
/*
* 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
...
...
arkui/ace_ets_standard/entry/src/main/ets/MainAbility/pages/Qrcode.ets
浏览文件 @
efc94c7c
/*
* 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
...
...
arkui/ace_ets_standard/entry/src/main/ets/MainAbility/pages/Rating.ets
浏览文件 @
efc94c7c
/*
* 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
...
...
arkui/ace_ets_standard/entry/src/main/ets/MainAbility/pages/RowSplit.ets
浏览文件 @
efc94c7c
/*
* 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
...
...
arkui/ace_ets_standard/entry/src/main/ets/MainAbility/pages/Scroll.ets
浏览文件 @
efc94c7c
/*
* 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
...
...
arkui/ace_ets_standard/entry/src/main/ets/MainAbility/pages/Slider.ets
浏览文件 @
efc94c7c
/*
* 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
...
...
arkui/ace_ets_standard/entry/src/main/ets/MainAbility/pages/Span.ets
浏览文件 @
efc94c7c
/*
* 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
...
...
arkui/ace_ets_standard/entry/src/main/ets/MainAbility/pages/Stack.ets
浏览文件 @
efc94c7c
/*
* 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
...
...
arkui/ace_ets_standard/entry/src/main/ets/MainAbility/pages/Text.ets
浏览文件 @
efc94c7c
/*
* 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
...
...
arkui/ace_ets_standard/entry/src/main/ets/MainAbility/pages/index.ets
浏览文件 @
efc94c7c
/*
* 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
...
...
arkui/ace_ets_standard/entry/src/main/ets/MainAbility/pages/index/index.ets
0 → 100644
浏览文件 @
efc94c7c
/*
* 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.
*/
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_
test/entry/src/main/ets/TestAbility/app
.ets
→
arkui/ace_ets_
standard/entry/src/main/ets/MainAbility/pages/second/second
.ets
浏览文件 @
efc94c7c
// @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')
},
/*
* 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.
*/
import router from '@system.router';
@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_standard/entry/src/main/ets/MainAbility/utils/Common.ets
0 → 100644
浏览文件 @
efc94c7c
/**
* 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_
test/entry/src/main/ets/MainAbility/app
.ets
→
arkui/ace_ets_
standard/entry/src/main/ets/MainAbility/utils/MessageManager
.ets
浏览文件 @
efc94c7c
// @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')
},
/**
* 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_standard/entry/src/main/ets/TestAbility/TestAbility.ts
0 → 100644
浏览文件 @
efc94c7c
/*
* 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.
*/
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_standard/entry/src/main/ets/TestAbility/pages/index.ets
浏览文件 @
efc94c7c
// @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
...
...
@@ -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
...
...
arkui/ace_ets_standard/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts
浏览文件 @
efc94c7c
// @ts-nocheck
/**
* Copyright (c) 2021 Huawei Device Co., Ltd.
/*
* 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
...
...
@@ -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.myapplication.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_standard/entry/src/main/ets/test/BadgeJsunit.test.ets
浏览文件 @
efc94c7c
/*
* 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,7 +14,7 @@
*/
// @ts-nocheck
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';
export default function badgeJsunit() {
...
...
@@ -32,7 +32,7 @@ export default function badgeJsunit() {
describe('badgeTest', function () {
beforeEach(async function (done) {
let options = {
uri: 'pages/Badge',
uri: '
MainAbility/
pages/Badge',
}
try {
router.clear();
...
...
arkui/ace_ets_standard/entry/src/main/ets/test/BlankJsunit.test.ets
浏览文件 @
efc94c7c
/*
* 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,7 +14,7 @@
*/
// @ts-nocheck
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';
export default function blankJsunit() {
...
...
@@ -32,7 +32,7 @@ export default function blankJsunit() {
describe('BlankTest', function () {
beforeEach(async function (done) {
let options = {
uri: 'pages/Blank',
uri: '
MainAbility/
pages/Blank',
}
try {
router.clear();
...
...
arkui/ace_ets_standard/entry/src/main/ets/test/ButtonJsunit.test.ets
浏览文件 @
efc94c7c
/*
* 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,7 +14,7 @@
*/
// @ts-nocheck
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';
export default function buttonJsunit() {
...
...
@@ -32,7 +32,7 @@ export default function buttonJsunit() {
describe('buttonTest', function () {
beforeEach(async function (done) {
let options = {
uri: 'pages/Button',
uri: '
MainAbility/
pages/Button',
}
try {
router.clear();
...
...
arkui/ace_ets_standard/entry/src/main/ets/test/ColumnJsunit.test.ets
浏览文件 @
efc94c7c
/*
* 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,7 +14,7 @@
*/
// @ts-nocheck
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';
export default function columnJsunit() {
...
...
@@ -32,7 +32,7 @@ export default function columnJsunit() {
describe('columnTest', function () {
beforeEach(async function (done) {
let options = {
uri: 'pages/Column',
uri: '
MainAbility/
pages/Column',
}
try {
router.clear();
...
...
arkui/ace_ets_standard/entry/src/main/ets/test/ColumnSplitJsunit.test.ets
浏览文件 @
efc94c7c
/*
* 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,7 +14,7 @@
*/
// @ts-nocheck
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';
export default function columnSplitJsunit() {
...
...
@@ -32,7 +32,7 @@ export default function columnSplitJsunit() {
describe('columnSplitTest', function () {
beforeEach(async function (done) {
let options = {
uri: 'pages/ColumnSplit',
uri: '
MainAbility/
pages/ColumnSplit',
}
try {
router.clear();
...
...
arkui/ace_ets_standard/entry/src/main/ets/test/CounterJsunit.test.ets
浏览文件 @
efc94c7c
/*
* 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,7 +14,7 @@
*/
// @ts-nocheck
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';
export default function counterJsunit() {
...
...
@@ -32,7 +32,7 @@ export default function counterJsunit() {
describe('counterTest', function () {
beforeEach(async function (done) {
let options = {
uri: 'pages/Counter',
uri: '
MainAbility/
pages/Counter',
}
try {
router.clear();
...
...
arkui/ace_ets_standard/entry/src/main/ets/test/DataPanelJsunit.test.ets
浏览文件 @
efc94c7c
/*
* 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,7 +14,7 @@
*/
// @ts-nocheck
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';
export default function datapanelJsunit() {
...
...
@@ -32,7 +32,7 @@ export default function datapanelJsunit() {
describe('dataPanelTest', function () {
beforeEach(async function (done) {
let options = {
uri: 'pages/DataPanel',
uri: '
MainAbility/
pages/DataPanel',
}
try {
router.clear();
...
...
arkui/ace_ets_standard/entry/src/main/ets/test/DividerJsunit.test.ets
浏览文件 @
efc94c7c
/*
* 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,7 +14,7 @@
*/
// @ts-nocheck
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';
export default function dividerJsunit() {
...
...
@@ -32,7 +32,7 @@ export default function dividerJsunit() {
describe('dividerTest', function () {
beforeEach(async function (done) {
let options = {
uri: 'pages/Divider',
uri: '
MainAbility/
pages/Divider',
}
try {
router.clear();
...
...
arkui/ace_ets_standard/entry/src/main/ets/test/FlexJsunit.test.ets
浏览文件 @
efc94c7c
/*
* 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,7 +14,7 @@
*/
// @ts-nocheck
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';
export default function flexJsunit() {
...
...
@@ -32,7 +32,7 @@ export default function flexJsunit() {
describe('flexTest', function () {
beforeEach(async function (done) {
let options = {
uri: 'pages/Flex',
uri: '
MainAbility/
pages/Flex',
}
try {
router.clear();
...
...
arkui/ace_ets_standard/entry/src/main/ets/test/GridContainerJsunit.test.ets
浏览文件 @
efc94c7c
/*
* 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,7 +14,7 @@
*/
// @ts-nocheck
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';
export default function gridContainerJsunit() {
...
...
@@ -32,7 +32,7 @@ export default function gridContainerJsunit() {
describe('gridContainerTest', function () {
beforeEach(async function (done) {
let options = {
uri: 'pages/GridContainer',
uri: '
MainAbility/
pages/GridContainer',
}
try {
router.clear();
...
...
arkui/ace_ets_standard/entry/src/main/ets/test/ImageJsunit.test.ets
浏览文件 @
efc94c7c
/*
* 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,7 +14,7 @@
*/
// @ts-nocheck
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';
export default function imageJsunit() {
...
...
@@ -32,7 +32,7 @@ export default function imageJsunit() {
describe('imageTest', function () {
beforeEach(async function (done) {
let options = {
uri: 'pages/Image',
uri: '
MainAbility/
pages/Image',
}
try {
router.clear();
...
...
arkui/ace_ets_standard/entry/src/main/ets/test/List.test.ets
浏览文件 @
efc94c7c
/*
* 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
...
...
@@ -33,6 +33,7 @@ import flexJsunit from './FlexJsunit.test.ets';
import counterJsunit from './CounterJsunit.test.ets';
import columnSplitJsunit from './ColumnSplitJsunit.test.ets';
import columnJsunit from './ColumnJsunit.test.ets';
export default function testsuite() {
buttonJsunit()
blankJsunit()
...
...
@@ -54,5 +55,4 @@ export default function testsuite() {
counterJsunit()
flexJsunit()
gridContainerJsunit()
}
\ No newline at end of file
arkui/ace_ets_standard/entry/src/main/ets/test/PanelJsunit.test.ets
浏览文件 @
efc94c7c
/*
* 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,7 +14,7 @@
*/
// @ts-nocheck
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';
export default function panelJsunit() {
...
...
@@ -32,7 +32,7 @@ export default function panelJsunit() {
describe('panelTest', function () {
beforeEach(async function (done) {
let options = {
uri: 'pages/Panel',
uri: '
MainAbility/
pages/Panel',
}
try {
router.clear();
...
...
arkui/ace_ets_standard/entry/src/main/ets/test/ProgressJsunit.test.ets
浏览文件 @
efc94c7c
/*
* 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,7 +14,7 @@
*/
// @ts-nocheck
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';
export default function progressJsunit() {
...
...
@@ -32,7 +32,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_standard/entry/src/main/ets/test/QrcodeJsunit.test.ets
浏览文件 @
efc94c7c
/*
* 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,7 +14,7 @@
*/
// @ts-nocheck
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';
export default function qrcodeJsunit() {
...
...
@@ -32,7 +32,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_standard/entry/src/main/ets/test/RatingJsunit.test.ets
浏览文件 @
efc94c7c
/*
* 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,7 +14,7 @@
*/
// @ts-nocheck
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';
export default function ratingJsunit() {
...
...
@@ -32,7 +32,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_standard/entry/src/main/ets/test/RowSplitJsunit.test.ets
浏览文件 @
efc94c7c
/*
* 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,7 +14,7 @@
*/
// @ts-nocheck
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';
export default function rowSplitJsunit() {
...
...
@@ -32,7 +32,7 @@ export default function rowSplitJsunit() {
describe('RowSplitTest', function () {
beforeEach(async function (done) {
let options = {
uri: 'pages/RowSplit',
uri: '
MainAbility/
pages/RowSplit',
}
try {
router.clear();
...
...
arkui/ace_ets_standard/entry/src/main/ets/test/ScrollJsunit.test.ets
浏览文件 @
efc94c7c
/*
* 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,7 +14,7 @@
*/
// @ts-nocheck
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';
export default function ScrollJsunit() {
...
...
@@ -32,7 +32,7 @@ export default function ScrollJsunit() {
describe('scrollTest', function () {
beforeEach(async function (done) {
let options = {
uri: 'pages/Scroll',
uri: '
MainAbility/
pages/Scroll',
}
try {
router.clear();
...
...
arkui/ace_ets_standard/entry/src/main/ets/test/SliderJsunit.test.ets
浏览文件 @
efc94c7c
/*
* 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,7 +14,7 @@
*/
// @ts-nocheck
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';
export default function sliderJsunit() {
...
...
@@ -32,7 +32,7 @@ export default function sliderJsunit() {
describe('SliderTest', function () {
beforeEach(async function (done) {
let options = {
uri: 'pages/Slider',
uri: '
MainAbility/
pages/Slider',
}
try {
router.clear();
...
...
@@ -71,7 +71,7 @@ export default function sliderJsunit() {
expect(obj.$attrs.constructor.min).assertEqual(0.000000.toFixed(6))
expect(obj.$attrs.constructor.max).assertEqual(100.000000.toFixed(6))
expect(obj.$attrs.constructor.step).assertEqual(1.000000.toFixed(6))
expect(obj.$attrs.
constructor.
style).assertEqual("SliderStyle.OutSet")
expect(obj.$attrs.style).assertEqual("SliderStyle.OutSet")
console.info('testGetSliderAttr1 END');
done();
});
...
...
@@ -88,7 +88,7 @@ export default function sliderJsunit() {
console.info("component obj is Slider: " + JSON.stringify(obj));
expect(obj.$attrs.showTips).assertEqual("true")
expect(obj.$attrs.showSteps).assertEqual("true")
expect(obj.$attrs.
constructor.
style).assertEqual("SliderStyle.InSet")
expect(obj.$attrs.style).assertEqual("SliderStyle.InSet")
console.info('testGetSliderAttr2 END');
done();
});
...
...
arkui/ace_ets_standard/entry/src/main/ets/test/SpanJsunit.test.ets
浏览文件 @
efc94c7c
/*
* 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,7 +14,7 @@
*/
// @ts-nocheck
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';
export default function spanJsunit() {
...
...
@@ -32,7 +32,7 @@ export default function spanJsunit() {
describe('SpanTest', function () {
beforeEach(async function (done) {
let options = {
uri: 'pages/Span',
uri: '
MainAbility/
pages/Span',
}
try {
router.clear();
...
...
arkui/ace_ets_standard/entry/src/main/ets/test/StackJsunit.test.ets
浏览文件 @
efc94c7c
/*
* 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,7 +14,7 @@
*/
// @ts-nocheck
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';
export default function StackJsunit() {
...
...
@@ -32,7 +32,7 @@ export default function StackJsunit() {
describe('StackTest', function () {
beforeEach(async function (done) {
let options = {
uri: 'pages/Stack',
uri: '
MainAbility/
pages/Stack',
}
try {
router.clear();
...
...
arkui/ace_ets_standard/entry/src/main/ets/test/TextJsunit.test.ets
浏览文件 @
efc94c7c
/*
* 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,7 +14,7 @@
*/
// @ts-nocheck
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';
export default function textJsunit() {
...
...
@@ -32,7 +32,7 @@ export default function textJsunit() {
describe('textTest', function () {
beforeEach(async function (done) {
let options = {
uri: 'pages/Text',
uri: '
MainAbility/
pages/Text',
}
try {
router.clear();
...
...
@@ -93,7 +93,7 @@ export default function textJsunit() {
expect(obj.$attrs.fontWeight).assertEqual("FontWeight.Bold")
expect(obj.$attrs.fontStyle).assertEqual("FontStyle.Italic")
expect(obj.$attrs.fontFamily).assertEqual("sans-serif")
expect(obj.$attrs.textAlign).assertEqual("TextAlign.
Center
")
expect(obj.$attrs.textAlign).assertEqual("TextAlign.
End
")
expect(obj.$attrs.textOverflow).assertEqual("TextOverflow.Ellipsis")
expect(obj.$attrs.lineHeight).assertEqual("15.00fp")
expect(obj.$attrs.baselineOffset).assertEqual("0")
...
...
@@ -125,7 +125,7 @@ export default function textJsunit() {
expect(obj.$attrs.enabled).assertEqual(true)
expect(obj.$attrs.visibility).assertEqual("Visibility.Hidden")
expect(obj.$attrs.fontWeight).assertEqual("FontWeight.Normal")
expect(obj.$attrs.textAlign).assertEqual("TextAlign.
Lef
t")
expect(obj.$attrs.textAlign).assertEqual("TextAlign.
Star
t")
expect(obj.$attrs.textOverflow).assertEqual("TextOverflow.Clip")
expect(obj.$attrs.decoration).assertEqual(JSON.stringify({
type: "TextDecorationType.LineThrough", color: "#FFFF0000"
...
...
@@ -150,7 +150,7 @@ export default function textJsunit() {
expect(obj.$attrs.borderStyle).assertEqual("BorderStyle.Solid")
expect(obj.$attrs.visibility).assertEqual("Visibility.None")
expect(obj.$attrs.fontWeight).assertEqual("FontWeight.Bolder")
expect(obj.$attrs.textAlign).assertEqual("TextAlign.
Right
")
expect(obj.$attrs.textAlign).assertEqual("TextAlign.
Center
")
expect(obj.$attrs.textCase).assertEqual("TextCase.UpperCase")
expect(obj.$attrs.decoration).assertEqual(JSON.stringify({
type: "TextDecorationType.None", color: "#FFFF0000"
...
...
arkui/ace_ets_standard/entry/src/main/module.json
0 → 100644
浏览文件 @
efc94c7c
{
"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.myapplication.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_standard/entry/src/main/resources/base/element/string.json
浏览文件 @
efc94c7c
...
...
@@ -15,6 +15,34 @@
{
"name"
:
"TestAbility_label"
,
"value"
:
"label"
},
{
"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_standard/entry/src/main/resources/base/profile/main_pages.json
0 → 100644
浏览文件 @
efc94c7c
{
"src"
:
[
"MainAbility/pages/index/index"
,
"MainAbility/pages/second/second"
,
"MainAbility/pages/index"
,
"MainAbility/pages/Button"
,
"MainAbility/pages/Blank"
,
"MainAbility/pages/DataPanel"
,
"MainAbility/pages/Divider"
,
"MainAbility/pages/Text"
,
"MainAbility/pages/RowSplit"
,
"MainAbility/pages/Scroll"
,
"MainAbility/pages/Stack"
,
"MainAbility/pages/Image"
,
"MainAbility/pages/Progress"
,
"MainAbility/pages/Qrcode"
,
"MainAbility/pages/Rating"
,
"MainAbility/pages/Span"
,
"MainAbility/pages/Slider"
,
"MainAbility/pages/Badge"
,
"MainAbility/pages/Column"
,
"MainAbility/pages/ColumnSplit"
,
"MainAbility/pages/Counter"
,
"MainAbility/pages/Flex"
,
"MainAbility/pages/GridContainer"
]
}
\ No newline at end of file
arkui/ace_ets_test/AppScope/app.json
0 → 100644
浏览文件 @
efc94c7c
{
"app"
:
{
"bundleName"
:
"com.open.harmony.standardtest"
,
"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_test/AppScope/resources/base/element/string.json
0 → 100644
浏览文件 @
efc94c7c
{
"string"
:[
{
"name"
:
"app_name"
,
"value"
:
"ohosProject"
}
]
}
\ No newline at end of file
arkui/ace_ets_test/AppScope/resources/base/media/app_icon.png
0 → 100644
浏览文件 @
efc94c7c
15.1 KB
arkui/ace_ets_test/BUILD.gn
浏览文件 @
efc94c7c
# 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,25 +14,30 @@
import("//test/xts/tools/build/suite.gni")
ohos_js_hap_suite("ActsAceEtsTest") {
hap_profile = "./entry/src/main/config.json"
hap_profile = "entry/src/main/module.json"
js_build_mode = "debug"
deps = [
":ace_ets_assets",
":ace_ets_resources",
":ace_ets_test_assets",
]
ets2abc = true
certificate_profile = "
./
signature/openharmony_sx.p7b"
certificate_profile = "signature/openharmony_sx.p7b"
hap_name = "ActsAceEtsTest"
subsystem_name = "arkui"
part_name = "ace_engine"
}
ohos_js_assets("ace_ets_assets") {
source_dir = "./entry/src/main/ets/MainAbility"
ohos_app_scope("ace_ets_test_app_profile") {
app_profile = "AppScope/app.json"
sources = [ "AppScope/resources" ]
}
ohos_js_assets("ace_ets_test_assets") {
source_dir = "./entry/src/main/ets/TestAbility"
ohos_js_assets("ace_ets_assets") {
source_dir = "entry/src/main/ets"
}
ohos_resources("ace_ets_resources") {
sources = [ "./entry/src/main/resources" ]
hap_profile = "./entry/src/main/config.json"
sources = [ "entry/src/main/resources" ]
deps = [ ":ace_ets_test_app_profile" ]
hap_profile = "entry/src/main/module.json"
}
arkui/ace_ets_test/Test.json
浏览文件 @
efc94c7c
...
...
@@ -3,8 +3,8 @@
"driver"
:
{
"type"
:
"OHJSUnitTest"
,
"test-timeout"
:
"600000"
,
"bundle-name"
:
"com.open.harmony.standardtest"
,
"
package-name"
:
"com.open.harmony.standardtest
"
,
"bundle-name"
:
"com.open.harmony.standardtest"
,
"
module-name"
:
"phone
"
,
"shell-timeout"
:
"600000"
},
"kits"
:
[
...
...
arkui/ace_ets_test/entry/src/main/config.json
已删除
100644 → 0
浏览文件 @
a8cf93cc
{
"app"
:
{
"bundleName"
:
"com.open.harmony.standardtest"
,
"vendor"
:
"open"
,
"version"
:
{
"code"
:
1000000
,
"name"
:
"1.0.0"
},
"apiVersion"
:
{
"compatible"
:
7
,
"releaseType"
:
"Release"
,
"target"
:
8
}
},
"deviceConfig"
:
{},
"module"
:
{
"package"
:
"com.open.harmony.standardtest"
,
"name"
:
".MyApplication"
,
"mainAbility"
:
".MainAbility"
,
"srcPath"
:
""
,
"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/AlphabetIndexer"
,
"pages/Grid"
,
"pages/GridItem"
,
"pages/List"
,
"pages/ListItem"
,
"pages/Navigator"
,
"pages/Panel"
,
"pages/Row"
,
"pages/Swiper"
,
"pages/Tab"
,
"pages/Calendar"
,
"pages/AlertDialog"
,
"pages/Prop"
,
"pages/Link"
,
"pages/AppStorage"
,
"pages/Video"
,
"pages/components/Marquee"
,
"pages/components/Path"
,
"pages/components/PatternLock"
,
"pages/components/Polygon"
,
"pages/components/Polyline"
,
"pages/components/Rect"
,
"pages/components/RichText"
,
"pages/components/Select"
,
"pages/components/Shape"
,
"pages/components/Sidebar"
,
"pages/components/FormComponentPage"
,
"pages/components/XComponentPage"
,
"pages/components/WebPage"
],
"name"
:
".MainAbility"
,
"window"
:
{
"designWidth"
:
720
,
"autoDesignWidth"
:
false
}
},
{
"mode"
:
{
"syntax"
:
"ets"
,
"type"
:
"pageAbility"
},
"pages"
:
[
"pages/index"
],
"name"
:
".TestAbility"
,
"window"
:
{
"designWidth"
:
720
,
"autoDesignWidth"
:
false
}
}
]
}
}
\ No newline at end of file
arkui/ace_ets_test/entry/src/main/ets/Application/AbilityStage.ts
0 → 100644
浏览文件 @
efc94c7c
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_test/entry/src/main/ets/MainAbility/MainAbility.ts
0 → 100644
浏览文件 @
efc94c7c
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_test/entry/src/main/ets/MainAbility/pages/AlertDialog.ets
浏览文件 @
efc94c7c
// @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
...
...
arkui/ace_ets_test/entry/src/main/ets/MainAbility/pages/AlphabetIndexer.ets
浏览文件 @
efc94c7c
/*
* 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
...
...
arkui/ace_ets_test/entry/src/main/ets/MainAbility/pages/AppStorage.ets
浏览文件 @
efc94c7c
/*
* 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
...
...
arkui/ace_ets_test/entry/src/main/ets/MainAbility/pages/Calendar.ets
浏览文件 @
efc94c7c
/*
* 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
...
...
arkui/ace_ets_test/entry/src/main/ets/MainAbility/pages/CustomDialog.ets
浏览文件 @
efc94c7c
/*
* 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
...
...
arkui/ace_ets_test/entry/src/main/ets/MainAbility/pages/Grid.ets
浏览文件 @
efc94c7c
/*
* 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
...
...
arkui/ace_ets_test/entry/src/main/ets/MainAbility/pages/GridItem.ets
浏览文件 @
efc94c7c
/*
* 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
...
...
arkui/ace_ets_test/entry/src/main/ets/MainAbility/pages/Link.ets
浏览文件 @
efc94c7c
/*
* 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
...
...
arkui/ace_ets_test/entry/src/main/ets/MainAbility/pages/List.ets
浏览文件 @
efc94c7c
// @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
...
...
arkui/ace_ets_test/entry/src/main/ets/MainAbility/pages/ListItem.ets
浏览文件 @
efc94c7c
/*
* 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
...
...
arkui/ace_ets_test/entry/src/main/ets/MainAbility/pages/Navigator.ets
浏览文件 @
efc94c7c
/*
* 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
...
...
arkui/ace_ets_test/entry/src/main/ets/MainAbility/pages/Panel.ets
浏览文件 @
efc94c7c
/*
* 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
...
...
arkui/ace_ets_test/entry/src/main/ets/MainAbility/pages/Prop.ets
浏览文件 @
efc94c7c
/*
* 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
...
...
arkui/ace_ets_test/entry/src/main/ets/MainAbility/pages/Row.ets
浏览文件 @
efc94c7c
/*
* 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
...
...
arkui/ace_ets_test/entry/src/main/ets/MainAbility/pages/Swiper.ets
浏览文件 @
efc94c7c
/*
* 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
...
...
arkui/ace_ets_test/entry/src/main/ets/MainAbility/pages/Tab.ets
浏览文件 @
efc94c7c
/*
* 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
...
...
arkui/ace_ets_test/entry/src/main/ets/MainAbility/pages/Video.ets
浏览文件 @
efc94c7c
/*
* 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
...
...
arkui/ace_ets_test/entry/src/main/ets/MainAbility/pages/components/FormComponentPage.ets
浏览文件 @
efc94c7c
/*
* 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
...
...
arkui/ace_ets_test/entry/src/main/ets/MainAbility/pages/components/Marquee.ets
浏览文件 @
efc94c7c
// @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
...
...
arkui/ace_ets_test/entry/src/main/ets/MainAbility/pages/components/Path.ets
浏览文件 @
efc94c7c
// @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
...
...
arkui/ace_ets_test/entry/src/main/ets/MainAbility/pages/components/PatternLock.ets
浏览文件 @
efc94c7c
// @ts-nocheck
// @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
...
...
arkui/ace_ets_test/entry/src/main/ets/MainAbility/pages/components/Polygon.ets
浏览文件 @
efc94c7c
// @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
...
...
arkui/ace_ets_test/entry/src/main/ets/MainAbility/pages/components/Polyline.ets
浏览文件 @
efc94c7c
// @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
...
...
arkui/ace_ets_test/entry/src/main/ets/MainAbility/pages/components/Rect.ets
浏览文件 @
efc94c7c
// @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
...
...
arkui/ace_ets_test/entry/src/main/ets/MainAbility/pages/components/RichText.ets
浏览文件 @
efc94c7c
// @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
...
...
arkui/ace_ets_test/entry/src/main/ets/MainAbility/pages/components/Select.ets
浏览文件 @
efc94c7c
// @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
...
...
arkui/ace_ets_test/entry/src/main/ets/MainAbility/pages/components/Shape.ets
浏览文件 @
efc94c7c
// @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
...
...
arkui/ace_ets_test/entry/src/main/ets/MainAbility/pages/components/Sidebar.ets
浏览文件 @
efc94c7c
// @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
...
...
arkui/ace_ets_test/entry/src/main/ets/MainAbility/pages/components/WebPage.ets
浏览文件 @
efc94c7c
// @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
...
...
arkui/ace_ets_test/entry/src/main/ets/MainAbility/pages/components/XComponentPage.ets
浏览文件 @
efc94c7c
/*
* 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
...
...
arkui/ace_ets_test/entry/src/main/ets/MainAbility/pages/index.ets
浏览文件 @
efc94c7c
/*
* 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
...
...
arkui/ace_ets_test/entry/src/main/ets/MainAbility/pages/index/index.ets
0 → 100644
浏览文件 @
efc94c7c
/*
* 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.
*/
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_
standard/entry/src/main/ets/MainAbility/app
.ets
→
arkui/ace_ets_
test/entry/src/main/ets/MainAbility/pages/second/second
.ets
浏览文件 @
efc94c7c
// @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')
},
/*
* 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.
*/
import router from '@system.router';
@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_test/entry/src/main/ets/MainAbility/utils/Common.ets
0 → 100644
浏览文件 @
efc94c7c
/**
* 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_test/entry/src/main/ets/MainAbility/utils/MessageManager.ets
0 → 100644
浏览文件 @
efc94c7c
/**
* 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_test/entry/src/main/ets/TestAbility/TestAbility.ts
0 → 100644
浏览文件 @
efc94c7c
/*
* 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.
*/
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_test/entry/src/main/ets/TestAbility/pages/index.ets
浏览文件 @
efc94c7c
// @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
...
...
@@ -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
...
...
arkui/ace_ets_test/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts
浏览文件 @
efc94c7c
// @ts-nocheck
/**
* Copyright (c) 2021 Huawei Device Co., Ltd.
/*
* 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
...
...
@@ -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.standardtest.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_test/entry/src/main/ets/test/AlphabetIndexerJsunit.test.ets
浏览文件 @
efc94c7c
// @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
...
...
@@ -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';
export default function alphabetIndexerJsunit() {
...
...
@@ -32,7 +32,7 @@ export default function alphabetIndexerJsunit() {
describe('alphabetIndexerTest', function () {
beforeEach(async function (done) {
let options = {
uri: 'pages/AlphabetIndexer',
uri: '
MainAbility/
pages/AlphabetIndexer',
}
try {
router.clear();
...
...
arkui/ace_ets_test/entry/src/main/ets/test/AppStorageJsunit.test.ets
浏览文件 @
efc94c7c
/*
* 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,7 +14,7 @@
*/
// @ts-nocheck
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';
export default function appStorageJsunit() {
...
...
@@ -32,7 +32,7 @@ export default function appStorageJsunit() {
describe('appStorageTest', function () {
beforeEach(async function (done) {
let options = {
uri: 'pages/AppStorage',
uri: '
MainAbility/
pages/AppStorage',
}
try {
router.clear();
...
...
arkui/ace_ets_test/entry/src/main/ets/test/GridItem.test.ets
浏览文件 @
efc94c7c
/*
* 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,7 +14,7 @@
*/
// @ts-nocheck
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';
export default function gridItemJsunit() {
...
...
@@ -32,7 +32,7 @@ export default function gridItemJsunit() {
describe('gridItemTest', function () {
beforeEach(async function (done) {
let options = {
uri: 'pages/GridItem',
uri: '
MainAbility/
pages/GridItem',
}
try {
router.clear();
...
...
arkui/ace_ets_test/entry/src/main/ets/test/GridJsnuit.test.ets
浏览文件 @
efc94c7c
/*
* 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,7 +14,7 @@
*/
// @ts-nocheck
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';
export default function gridJsunit() {
...
...
@@ -32,7 +32,7 @@ export default function gridJsunit() {
describe('gridTest', function () {
beforeEach(async function (done) {
let options = {
uri: 'pages/Grid',
uri: '
MainAbility/
pages/Grid',
}
try {
router.clear();
...
...
arkui/ace_ets_test/entry/src/main/ets/test/LinkJsunit.test.ets
浏览文件 @
efc94c7c
/*
* 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,7 +14,7 @@
*/
// @ts-nocheck
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';
export default function linkJsunit() {
...
...
@@ -33,7 +33,7 @@ export default function linkJsunit() {
describe('linkTest', function () {
beforeEach(async function (done) {
let options = {
uri: 'pages/Link',
uri: '
MainAbility/
pages/Link',
}
try {
router.clear();
...
...
arkui/ace_ets_test/entry/src/main/ets/test/List.test.ets
浏览文件 @
efc94c7c
/*
* 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
...
...
@@ -27,6 +27,7 @@ import listItemJsunit from './ListItemJsunit.test.ets';
import gridItemJsunit from './GridItem.test.ets';
import gridJsunit from './GridJsnuit.test.ets';
import videoJsunit from './VideoJsunit.test.ets';
export default function testsuite() {
alphabetIndexerJsunit()
rowJsunit()
...
...
arkui/ace_ets_test/entry/src/main/ets/test/ListItemJsunit.test.ets
浏览文件 @
efc94c7c
/*
* 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,7 +14,7 @@
*/
// @ts-nocheck
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';
export default function listItemJsunit() {
...
...
@@ -32,7 +32,7 @@ export default function listItemJsunit() {
describe('listItemTest', function () {
beforeEach(async function (done) {
let options = {
uri: 'pages/ListItem',
uri: '
MainAbility/
pages/ListItem',
}
try {
router.clear();
...
...
@@ -72,7 +72,6 @@ export default function listItemJsunit() {
console.log('ListItem1‘s sticky is ' + JSON.stringify(obj.$attrs.sticky))
console.log('ListItem1‘s editable is ' + JSON.stringify(obj.$attrs.editable))
expect(obj.$attrs.sticky).assertEqual('Sticky.None')
expect(obj.$attrs.editable).assertEqual('true')
console.info('++++++++++++++++ ListItem TestCase 1 End ++++++++++++++++');
done();
});
...
...
@@ -94,7 +93,6 @@ export default function listItemJsunit() {
console.log('ListItem2‘s editable is ' + JSON.stringify(obj.$attrs.editable))
await sleep(1)
expect(obj.$attrs.sticky).assertEqual('Sticky.Normal')
expect(obj.$attrs.editable).assertEqual('EditMode.Deletable')
console.info('++++++++++++++++ ListItem TestCase 2 End ++++++++++++++++');
done();
});
...
...
@@ -116,7 +114,6 @@ export default function listItemJsunit() {
console.log('ListItem3‘s editable is ' + JSON.stringify(obj.$attrs.editable))
await sleep(1)
expect(obj.$attrs.sticky).assertEqual('Sticky.Opacity')
expect(obj.$attrs.editable).assertEqual('EditMode.None')
console.info('++++++++++++++++ ListItem TestCase 3 End ++++++++++++++++');
done();
});
...
...
@@ -138,7 +135,6 @@ export default function listItemJsunit() {
console.log('ListItem4‘s editable is ' + JSON.stringify(obj.$attrs.editable))
await sleep(1)
expect(obj.$attrs.sticky).assertEqual('Sticky.Opacity')
expect(obj.$attrs.editable).assertEqual('EditMode.Movable')
console.info('++++++++++++++++ ListItem TestCase 4 End ++++++++++++++++');
done();
});
...
...
arkui/ace_ets_test/entry/src/main/ets/test/ListJsunit.test.ets
浏览文件 @
efc94c7c
/*
* 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,7 +14,7 @@
*/
// @ts-nocheck
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';
export default function listJsunit() {
...
...
@@ -32,7 +32,7 @@ export default function listJsunit() {
describe('listTest', function () {
beforeEach(async function (done) {
let options = {
uri: 'pages/List',
uri: '
MainAbility/
pages/List',
}
try {
router.clear();
...
...
@@ -74,10 +74,10 @@ export default function listJsunit() {
console.log('List‘s listDirection is ' + JSON.stringify(obj.$attrs.listDirection))
console.log('List‘s divider is ' + JSON.stringify(obj.$attrs.divider))
console.log('List‘s edgeEffect is ' + JSON.stringify(obj.$attrs.edgeEffect))
expect(obj.$attrs.initialIndex).assertEqual(
0.000000.toFixed(6)
)
expect(obj.$attrs.initialIndex).assertEqual(
'0'
)
expect(obj.$attrs.listDirection).assertEqual('Axis.Vertical')
expect(obj.$attrs.edgeEffect).assertEqual('EdgeEffect.None')
expect(obj.$attrs.editMode).assertEqual(
"false"
)
expect(obj.$attrs.editMode).assertEqual(
false
)
console.info('++++++++++++++++ List TestCase 1 End ++++++++++++++++');
done();
});
...
...
arkui/ace_ets_test/entry/src/main/ets/test/NavigatorJsunit.test.ets
浏览文件 @
efc94c7c
/*
* 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,7 +14,7 @@
*/
// @ts-nocheck
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';
export default function navigatorJsunit() {
...
...
@@ -32,7 +32,7 @@ export default function navigatorJsunit() {
describe('navigatorTest', function () {
beforeEach(async function (done) {
let options = {
uri: 'pages/Navigator',
uri: '
MainAbility/
pages/Navigator',
}
try {
router.clear();
...
...
arkui/ace_ets_test/entry/src/main/ets/test/PanelJsunit.test.ets
浏览文件 @
efc94c7c
/*
* 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,7 +14,7 @@
*/
// @ts-nocheck
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';
export default function panelJsunit() {
...
...
@@ -33,7 +33,7 @@ export default function panelJsunit() {
beforeEach(async function (done) {
let options = {
uri: 'pages/Panel',
uri: '
MainAbility/
pages/Panel',
}
try {
router.clear();
...
...
arkui/ace_ets_test/entry/src/main/ets/test/PropJsunit.test.ets
浏览文件 @
efc94c7c
/*
* 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,7 +14,7 @@
*/
// @ts-nocheck
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';
export default function propJsunit() {
...
...
@@ -33,7 +33,7 @@ export default function propJsunit() {
beforeEach(async function (done) {
let options = {
uri: 'pages/Prop',
uri: '
MainAbility/
pages/Prop',
}
try {
router.clear();
...
...
arkui/ace_ets_test/entry/src/main/ets/test/RowJsunit.test.ets
浏览文件 @
efc94c7c
/*
* 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,7 +14,7 @@
*/
// @ts-nocheck
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';
export default function rowJsunit() {
...
...
@@ -32,7 +32,7 @@ export default function rowJsunit() {
describe('rowTest', function () {
beforeEach(async function (done) {
let options = {
uri: 'pages/Row',
uri: '
MainAbility/
pages/Row',
}
try {
router.clear();
...
...
arkui/ace_ets_test/entry/src/main/ets/test/SwiperJsunit.test.ets
浏览文件 @
efc94c7c
/*
* 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,7 +14,7 @@
*/
// @ts-nocheck
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'
;
export
default
function
swiperJsunit
()
{
...
...
@@ -34,7 +34,7 @@ export default function swiperJsunit() {
console
.
info
(
'afterEach backToIndexPromise ...'
);
setTimeout
(()
=>
{
router
.
back
({
uri
:
'pages/index'
uri
:
'
MainAbility/
pages/index'
});
resolve
();
},
500
);
...
...
@@ -56,7 +56,7 @@ export default function swiperJsunit() {
beforeEach
(
async
function
(
done
)
{
let
options
=
{
uri
:
'pages/Swiper'
,
uri
:
'
MainAbility/
pages/Swiper'
,
}
try
{
router
.
clear
();
...
...
@@ -107,7 +107,7 @@ export default function swiperJsunit() {
expect
(
obj
.
$attrs
.
indicator
)
.
assertEqual
(
'true'
)
expect
(
obj
.
$attrs
.
loop
)
.
assertEqual
(
'false'
)
expect
(
obj
.
$attrs
.
vertical
)
.
assertEqual
(
'false'
)
expect
(
obj
.
$attrs
.
duration
)
.
assertEqual
(
1000.000000.
toFixed
(
6
)
)
expect
(
obj
.
$attrs
.
duration
)
.
assertEqual
(
"1000"
)
console
.
info
(
'++++++++++++++++ Swiper TestCase 1 End +++++++++++++++++'
);
done
();
});
...
...
arkui/ace_ets_test/entry/src/main/ets/test/TabJsunit.test.ets
浏览文件 @
efc94c7c
/*
* 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,7 +14,7 @@
*/
// @ts-nocheck
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';
export default function tabJsunit() {
...
...
@@ -33,7 +33,7 @@ export default function tabJsunit() {
beforeEach(async function (done) {
let options = {
uri: 'pages/Tab',
uri: '
MainAbility/
pages/Tab',
}
try {
router.clear();
...
...
arkui/ace_ets_test/entry/src/main/ets/test/TextJsunit.test.ets
浏览文件 @
efc94c7c
/*
* 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,7 +14,7 @@
*/
// @ts-nocheck
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';
export default function textJsunit() {
...
...
@@ -33,7 +33,7 @@ export default function textJsunit() {
beforeEach(async function (done) {
let options = {
uri: 'pages/Text',
uri: '
MainAbility/
pages/Text',
}
try {
router.clear();
...
...
arkui/ace_ets_test/entry/src/main/ets/test/VideoJsunit.test.ets
浏览文件 @
efc94c7c
/*
* 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,7 +14,7 @@
*/
// @ts-nocheck
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';
export default function videoJsunit() {
...
...
@@ -33,7 +33,7 @@ export default function videoJsunit() {
beforeEach(async function (done) {
let options = {
uri: 'pages/Video',
uri: '
MainAbility/
pages/Video',
}
try {
router.clear();
...
...
arkui/ace_ets_test/entry/src/main/module.json
0 → 100644
浏览文件 @
efc94c7c
{
"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.standardtest.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_test/entry/src/main/resources/base/element/string.json
浏览文件 @
efc94c7c
...
...
@@ -15,6 +15,34 @@
{
"name"
:
"TestAbility_label"
,
"value"
:
"label"
},
{
"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_test/entry/src/main/resources/base/profile/main_pages.json
0 → 100644
浏览文件 @
efc94c7c
{
"src"
:
[
"MainAbility/pages/index/index"
,
"MainAbility/pages/second/second"
,
"MainAbility/pages/index"
,
"MainAbility/pages/AlphabetIndexer"
,
"MainAbility/pages/Grid"
,
"MainAbility/pages/GridItem"
,
"MainAbility/pages/List"
,
"MainAbility/pages/ListItem"
,
"MainAbility/pages/Navigator"
,
"MainAbility/pages/Panel"
,
"MainAbility/pages/Row"
,
"MainAbility/pages/Swiper"
,
"MainAbility/pages/Tab"
,
"MainAbility/pages/Calendar"
,
"MainAbility/pages/AlertDialog"
,
"MainAbility/pages/Prop"
,
"MainAbility/pages/Link"
,
"MainAbility/pages/AppStorage"
,
"MainAbility/pages/Video"
,
"MainAbility/pages/components/Marquee"
,
"MainAbility/pages/components/Path"
,
"MainAbility/pages/components/PatternLock"
,
"MainAbility/pages/components/Polygon"
,
"MainAbility/pages/components/Polyline"
,
"MainAbility/pages/components/Rect"
,
"MainAbility/pages/components/RichText"
,
"MainAbility/pages/components/Select"
,
"MainAbility/pages/components/Shape"
,
"MainAbility/pages/components/Sidebar"
,
"MainAbility/pages/components/FormComponentPage"
,
"MainAbility/pages/components/XComponentPage"
,
"MainAbility/pages/components/WebPage"
]
}
\ No newline at end of file
arkui/ace_ets_third_test/AppScope/app.json
0 → 100644
浏览文件 @
efc94c7c
{
"app"
:
{
"bundleName"
:
"com.example.actsaceetstest"
,
"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_third_test/AppScope/resources/base/element/string.json
0 → 100644
浏览文件 @
efc94c7c
{
"string"
:[
{
"name"
:
"app_name"
,
"value"
:
"ohosProject"
}
]
}
\ No newline at end of file
arkui/ace_ets_third_test/AppScope/resources/base/media/app_icon.png
0 → 100644
浏览文件 @
efc94c7c
15.1 KB
arkui/ace_ets_third_test/BUILD.gn
浏览文件 @
efc94c7c
# 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,25 +14,30 @@
import("//test/xts/tools/build/suite.gni")
ohos_js_hap_suite("ActsAceEtsThirdTest") {
hap_profile = "./entry/src/main/config.json"
hap_profile = "entry/src/main/module.json"
js_build_mode = "debug"
deps = [
":ace_third_ets_assets",
":ace_third_ets_resources",
":ace_third_ets_test_assets",
]
ets2abc = true
certificate_profile = "
./
signature/openharmony_sx.p7b"
certificate_profile = "signature/openharmony_sx.p7b"
hap_name = "ActsAceEtsThirdTest"
subsystem_name = "arkui"
part_name = "ace_engine"
}
ohos_js_assets("ace_third_ets_assets") {
source_dir = "./entry/src/main/ets/MainAbility"
ohos_app_scope("ace_ets_third_app_profile") {
app_profile = "AppScope/app.json"
sources = [ "AppScope/resources" ]
}
ohos_js_assets("ace_third_ets_test_assets") {
source_dir = "./entry/src/main/ets/TestAbility"
ohos_js_assets("ace_third_ets_assets") {
source_dir = "entry/src/main/ets"
}
ohos_resources("ace_third_ets_resources") {
sources = [ "./entry/src/main/resources" ]
hap_profile = "./entry/src/main/config.json"
sources = [ "entry/src/main/resources" ]
deps = [ ":ace_ets_third_app_profile" ]
hap_profile = "entry/src/main/module.json"
}
arkui/ace_ets_third_test/Test.json
浏览文件 @
efc94c7c
...
...
@@ -3,8 +3,8 @@
"driver"
:
{
"type"
:
"OHJSUnitTest"
,
"test-timeout"
:
"600000"
,
"bundle-name"
:
"com.example.actsaceetstest"
,
"
package-name"
:
"com.example.actsaceetstest
"
,
"bundle-name"
:
"com.example.actsaceetstest"
,
"
module-name"
:
"phone
"
,
"shell-timeout"
:
"600000"
},
"kits"
:
[
...
...
arkui/ace_ets_third_test/entry/src/main/config.json
已删除
100644 → 0
浏览文件 @
a8cf93cc
{
"app"
:
{
"bundleName"
:
"com.example.actsaceetstest"
,
"vendor"
:
"open"
,
"version"
:
{
"code"
:
1000000
,
"name"
:
"1.0.0"
},
"apiVersion"
:
{
"compatible"
:
7
,
"releaseType"
:
"Release"
,
"target"
:
8
}
},
"deviceConfig"
:
{},
"module"
:
{
"package"
:
"com.example.actsaceetstest"
,
"name"
:
".MyApplication"
,
"mainAbility"
:
".MainAbility"
,
"srcPath"
:
""
,
"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/TextArea"
,
"pages/TextInput"
,
"pages/Toggle"
,
"pages/ScrollBar"
,
"pages/Stepper"
,
"pages/Navigation"
],
"name"
:
".MainAbility"
,
"window"
:
{
"designWidth"
:
720
,
"autoDesignWidth"
:
false
}
},
{
"mode"
:
{
"syntax"
:
"ets"
,
"type"
:
"pageAbility"
},
"pages"
:
[
"pages/index"
],
"name"
:
".TestAbility"
,
"window"
:
{
"designWidth"
:
720
,
"autoDesignWidth"
:
false
}
}
]
}
}
\ No newline at end of file
arkui/ace_ets_third_test/entry/src/main/ets/Application/AbilityStage.ts
0 → 100644
浏览文件 @
efc94c7c
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_third_test/entry/src/main/ets/MainAbility/MainAbility.ts
0 → 100644
浏览文件 @
efc94c7c
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_third_test/entry/src/main/ets/MainAbility/app.ets
已删除
100644 → 0
浏览文件 @
a8cf93cc
// @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_third_test/entry/src/main/ets/MainAbility/pages/Navigation.ets
浏览文件 @
efc94c7c
/*
* 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
...
...
arkui/ace_ets_third_test/entry/src/main/ets/MainAbility/pages/ScrollBar.ets
浏览文件 @
efc94c7c
/*
* 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
...
...
arkui/ace_ets_third_test/entry/src/main/ets/MainAbility/pages/Stepper.ets
浏览文件 @
efc94c7c
/*
* 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
...
...
arkui/ace_ets_third_test/entry/src/main/ets/MainAbility/pages/TextArea.ets
浏览文件 @
efc94c7c
/*
* 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
...
...
arkui/ace_ets_third_test/entry/src/main/ets/MainAbility/pages/TextInput.ets
浏览文件 @
efc94c7c
/*
* 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
...
...
arkui/ace_ets_third_test/entry/src/main/ets/MainAbility/pages/Toggle.ets
浏览文件 @
efc94c7c
/*
* 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
...
...
arkui/ace_ets_third_test/entry/src/main/ets/MainAbility/pages/index.ets
浏览文件 @
efc94c7c
/*
* 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
...
...
arkui/ace_ets_third_test/entry/src/main/ets/MainAbility/pages/index/index.ets
0 → 100644
浏览文件 @
efc94c7c
/*
* 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.
*/
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_
standard/entry/src/main/ets/TestAbility/app
.ets
→
arkui/ace_ets_
third_test/entry/src/main/ets/MainAbility/pages/second/second
.ets
浏览文件 @
efc94c7c
// @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')
},
/*
* 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.
*/
import router from '@system.router';
@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_third_test/entry/src/main/ets/MainAbility/utils/Common.ets
0 → 100644
浏览文件 @
efc94c7c
/**
* 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_third_test/entry/src/main/ets/MainAbility/utils/MessageManager.ets
0 → 100644
浏览文件 @
efc94c7c
/**
* 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_third_test/entry/src/main/ets/TestAbility/TestAbility.ts
0 → 100644
浏览文件 @
efc94c7c
/*
* 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.
*/
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_third_test/entry/src/main/ets/TestAbility/app.ets
已删除
100644 → 0
浏览文件 @
a8cf93cc
// @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_third_test/entry/src/main/ets/TestAbility/pages/index.ets
浏览文件 @
efc94c7c
// @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
...
...
@@ -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
...
...
arkui/ace_ets_third_test/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts
浏览文件 @
efc94c7c
// @ts-nocheck
/**
* Copyright (c) 2021 Huawei Device Co., Ltd.
/*
* 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
...
...
@@ -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.example.actsaceetstest.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_third_test/entry/src/main/ets/test/List.test.ets
浏览文件 @
efc94c7c
/*
* 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
...
...
arkui/ace_ets_third_test/entry/src/main/ets/test/NavigationJsunit.test.ets
浏览文件 @
efc94c7c
/*
* 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,7 +14,7 @@
*/
// @ts-nocheck
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';
export default function navigationJsunit() {
...
...
@@ -38,7 +38,7 @@ export default function navigationJsunit() {
console.info('[navigationTest] before each called')
await sleep(1)
let options = {
uri: 'pages/Navigation',
uri: '
MainAbility/
pages/Navigation',
}
try {
router.clear();
...
...
arkui/ace_ets_third_test/entry/src/main/ets/test/ScrollerBarJsunit.test.ets
浏览文件 @
efc94c7c
/*
* 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,7 +14,7 @@
*/
// @ts-nocheck
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';
export default function scrollbarJsunit() {
...
...
@@ -37,7 +37,7 @@ export default function scrollbarJsunit() {
beforeEach(async function (done) {
console.info('[scrollbarTest] before each called')
let options = {
uri: 'pages/ScrollBar',
uri: '
MainAbility/
pages/ScrollBar',
}
try {
let pages = router.getState()
...
...
arkui/ace_ets_third_test/entry/src/main/ets/test/StepperJsunit.test.ets
浏览文件 @
efc94c7c
/*
* 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,7 +14,7 @@
*/
// @ts-nocheck
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';
export default function stepperJsunit() {
...
...
@@ -49,7 +49,7 @@ export default function stepperJsunit() {
it('testStepper010', 0, async function (done) {
console.info('testStepper010 START');
let options = {
uri: 'pages/Stepper',
uri: '
MainAbility/
pages/Stepper',
}
try {
let result = await router.push(options)
...
...
arkui/ace_ets_third_test/entry/src/main/ets/test/TextAreaJsunit.test.ets
浏览文件 @
efc94c7c
/*
* 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,7 +14,7 @@
*/
// @ts-nocheck
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';
export default function textAreaJsunit() {
...
...
@@ -37,7 +37,7 @@ export default function textAreaJsunit() {
beforeEach(async function (done) {
console.info('[textAreaTest] before each called')
let options = {
uri: 'pages/TextArea',
uri: '
MainAbility/
pages/TextArea',
}
try {
let result = await router.push(options)
...
...
arkui/ace_ets_third_test/entry/src/main/ets/test/TextInputJsunit.test.ets
浏览文件 @
efc94c7c
/*
* 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,7 +14,7 @@
*/
// @ts-nocheck
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';
export default function textInputJsunit() {
...
...
@@ -36,7 +36,7 @@ export default function textInputJsunit() {
beforeEach(async function (done) {
console.info('[textInputTest] before each called')
let options = {
uri: 'pages/TextInput',
uri: '
MainAbility/
pages/TextInput',
}
try {
let pages = router.getState()
...
...
arkui/ace_ets_third_test/entry/src/main/ets/test/ToggleJsunit.test.ets
浏览文件 @
efc94c7c
/*
* 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,7 +14,7 @@
*/
// @ts-nocheck
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';
export default function toggleJsunit() {
...
...
@@ -36,7 +36,7 @@ export default function toggleJsunit() {
beforeEach(async function (done) {
console.info('[toggleTest] before each called')
let options = {
uri: 'pages/Toggle',
uri: '
MainAbility/
pages/Toggle',
}
try {
let pages = router.getState()
...
...
@@ -140,7 +140,7 @@ export default function toggleJsunit() {
console.info('testToggle050 START');
let strJson = getInspectorByKey('toggle5');
let obj = JSON.parse(strJson);
console.info("[toggle5] get inspector value is: " + JSON.stringify(obj));
console.info("[toggle5] get inspector value is: " + JSON.stringify(obj
.$attrs
));
expect(obj.$type).assertEqual('Toggle')
expect(obj.$attrs.type).assertEqual('ToggleType.Button')
expect(obj.$attrs.isOn).assertEqual('false')
...
...
arkui/ace_ets_third_test/entry/src/main/module.json
0 → 100644
浏览文件 @
efc94c7c
{
"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.example.actsaceetstest.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_third_test/entry/src/main/resources/base/element/string.json
浏览文件 @
efc94c7c
...
...
@@ -15,6 +15,34 @@
{
"name"
:
"TestAbility_label"
,
"value"
:
"label"
}
},
{
"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_third_test/entry/src/main/resources/base/profile/main_pages.json
0 → 100644
浏览文件 @
efc94c7c
{
"src"
:
[
"MainAbility/pages/index/index"
,
"MainAbility/pages/second/second"
,
"MainAbility/pages/index"
,
"MainAbility/pages/TextArea"
,
"MainAbility/pages/TextInput"
,
"MainAbility/pages/Toggle"
,
"MainAbility/pages/ScrollBar"
,
"MainAbility/pages/Stepper"
,
"MainAbility/pages/Navigation"
]
}
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录