Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
9f8c84be
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,发现更多精彩内容 >>
提交
9f8c84be
编写于
8月 30, 2022
作者:
B
bayanxing
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
code check
Signed-off-by:
N
bayanxing
<
bayanxing@kaihong.com
>
上级
8626dad7
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
118 addition
and
90 deletion
+118
-90
arkui/ace_ets_component_apilack/entry/src/main/ets/test/List.test.ets
...s_component_apilack/entry/src/main/ets/test/List.test.ets
+0
-90
arkui/ace_ets_component_apilack/entry/src/main/ets/test/Utils.ets
...e_ets_component_apilack/entry/src/main/ets/test/Utils.ets
+118
-0
未找到文件。
arkui/ace_ets_component_apilack/entry/src/main/ets/test/List.test.ets
浏览文件 @
9f8c84be
...
@@ -13,102 +13,12 @@
...
@@ -13,102 +13,12 @@
* limitations under the License.
* limitations under the License.
*/
*/
import curvesStepsJsunit from './curves.test.ets';
import mediaQueryOffJsunit from './mediaQuery.test.ets';
import pluginComponentRequestJsunit from './pluginComponent.test.ets';
import routerEnableAlertBeforeBackPageJsunit from './router.test.ets';
import alphabetIndexerOnSelectJsunit from './alphabetIndexer.test.ets';
import alphabetIndexerOnSelectJsunit from './alphabetIndexer.test.ets';
import checkBoxGroupSelectAllJsunit from './checkBoxGroup.test.ets';
import checkBoxGroupSelectAllJsunit from './checkBoxGroup.test.ets';
import circleNeJsunit from './circle.test.ets';
import circleNeJsunit from './circle.test.ets';
import commonBackgroundBlurStyleJsunit from './common.test.ets';
import common_ts_ets_apiStaticClearJsunit from './common_ts_ets_api.test.ets';
import ellipseNeJsunit from './ellipse.test.ets';
import gaugeColorsJsunit from './gauge.test.ets';
import gestureSetDirectionJsunit from './gesture.test.ets';
import gridMaxCountJsunit from './grid.test.ets';
import gridItemOnSelectJsunit from './gridItem.test.ets';
import grid_colSpanJsunit from './grid_col.test.ets';
import grid_rowOnBreakpointChangeJsunit from './grid_row.test.ets';
import lazyForEachOnDataAddJsunit from './lazyForEach.test.ets';
import lineNeJsunit from './line.test.ets';
import list_itemOnSelectJsunit from './list_item.test.ets';
import matrix2dMultiplyJsunit from './matrix2d.test.ets';
import navigatorTargetJsunit from './navigator.test.ets';
import page_transitionSlideJsunit from './page_transition.test.ets';
import panelBackgroundMaskJsunit from './panel.test.ets';
import pathNeJsunit from './path.test.ets';
import polygonNeJsunit from './polygon.test.ets';
import polyLineNeJsunit from './polyLine.test.ets';
import progressStyleJsunit from './progress.test.ets';
import rectNeJsunit from './rect.test.ets';
import scrollOnScrollBeginJsunit from './scroll.test.ets';
import searchOnCutJsunit from './search.test.ets';
import selectOnSelectJsunit from './select.test.ets';
import shapeNeJsunit from './shape.test.ets';
import sideBarShowSideBarJsunit from './sideBar.test.ets';
import stackAlignContentJsunit from './stack.test.ets';
import stateManagementGetSharedJsunit from './stateManagement.test.ets';
import swiperCurveJsunit from './swiper.test.ets';
import tabsBarPositionJsunit from './tabs.test.ets';
import textMinFontSizeJsunit from './text.test.ets';
import textAreaOnCutJsunit from './textArea.test.ets';
import textInputOnEditChangeJsunit from './textInput.test.ets';
import textPickerDefaultPickerItemHeightJsunit from './textPicker.test.ets';
import videoOnFullscreenChangeJsunit from './video.test.ets';
import webGetTitleJsunit from './web.test.ets';
import xcomponentGetXComponentContextJsunit from './xcomponent.test.ets';
import domCreateElementJsunit from './dom.test.ets';
import viewModelMatrixJsunit from './viewModel.test.ets';
import promptShowDialogJsunit from './prompt.test.ets';
import featureAbilityStartAbilityJsunit from './featureAbility.test.ets';
export default function testsuite() {
export default function testsuite() {
curvesStepsJsunit()
mediaQueryOffJsunit()
pluginComponentRequestJsunit()
alphabetIndexerOnSelectJsunit()
alphabetIndexerOnSelectJsunit()
checkBoxGroupSelectAllJsunit()
checkBoxGroupSelectAllJsunit()
circleNeJsunit()
circleNeJsunit()
commonBackgroundBlurStyleJsunit()
ellipseNeJsunit()
gaugeColorsJsunit()
gestureSetDirectionJsunit()
gridMaxCountJsunit()
gridItemOnSelectJsunit()
grid_colSpanJsunit()
grid_rowOnBreakpointChangeJsunit()
lazyForEachOnDataAddJsunit()
lineNeJsunit()
list_itemOnSelectJsunit()
matrix2dMultiplyJsunit()
navigatorTargetJsunit()
page_transitionSlideJsunit()
panelBackgroundMaskJsunit()
pathNeJsunit()
polygonNeJsunit()
polyLineNeJsunit()
progressStyleJsunit()
rectNeJsunit()
scrollOnScrollBeginJsunit()
searchOnCutJsunit()
selectOnSelectJsunit()
shapeNeJsunit()
sideBarShowSideBarJsunit()
stackAlignContentJsunit()
stateManagementGetSharedJsunit()
swiperCurveJsunit()
tabsBarPositionJsunit()
textMinFontSizeJsunit()
textAreaOnCutJsunit()
textInputOnEditChangeJsunit()
textPickerDefaultPickerItemHeightJsunit()
videoOnFullscreenChangeJsunit()
webGetTitleJsunit()
xcomponentGetXComponentContextJsunit()
domCreateElementJsunit()
viewModelMatrixJsunit()
promptShowDialogJsunit()
common_ts_ets_apiStaticClearJsunit()
featureAbilityStartAbilityJsunit()
routerEnableAlertBeforeBackPageJsunit()
}
}
\ No newline at end of file
arkui/ace_ets_component_apilack/entry/src/main/ets/test/Utils.ets
0 → 100644
浏览文件 @
9f8c84be
// @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.
*/
export default class Utils {
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()
}, 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
}
}
static async swipe(downX, downY, upX, upY, steps) {
console.info('start to swipe')
this.drags(downX, downY, upX, upY, steps, false)
}
static async drag(downX, downY, upX, upY, steps) {
console.info('start to drag')
this.drags(downX, downY, upX, upY, steps, true)
}
static async drags(downX, downY, upX, upY, steps, drag) {
var xStep;
var yStep;
var swipeSteps;
var ret;
xStep = 0;
yStep = 0;
ret = false;
swipeSteps = steps;
if (swipeSteps == 0) {
swipeSteps = 1;
}
xStep = (upX - downX) / swipeSteps;
yStep = (upY - downY) / swipeSteps;
console.info('move step is: ' + 'xStep: ' + xStep + ' yStep: ' + yStep)
var downPonit: TouchObject = {
id: 1,
x: downX,
y: downY,
type: TouchType.Down,
}
console.info('down touch started: ' + JSON.stringify(downPonit))
sendTouchEvent(downPonit);
console.info('start to move')
if (drag) {
await this.sleep(500)
}
for (var i = 1;i <= swipeSteps; i++) {
var movePoint: TouchObject = {
id: 1,
x: downX + (xStep * i),
y: downY + (yStep * i),
type: TouchType.Move
}
console.info('move touch started: ' + JSON.stringify(movePoint))
ret = sendTouchEvent(movePoint)
if (ret == false) {
break;
}
await this.sleep(5)
}
console.info('start to up')
if (drag) {
await this.sleep(100)
}
var upPoint: TouchObject = {
id: 1,
x: upX,
y: upY,
type: TouchType.Up,
}
console.info('up touch started: ' + JSON.stringify(upPoint))
sendTouchEvent(upPoint)
await this.sleep(500)
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录