Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
51f8779d
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看板
未验证
提交
51f8779d
编写于
6月 12, 2023
作者:
O
openharmony_ci
提交者:
Gitee
6月 12, 2023
浏览文件
操作
浏览文件
下载
差异文件
!8982 gridScrollBar xts测试
Merge pull request !8982 from huangdong/master
上级
dffc8988
95b0ef92
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
158 addition
and
1 deletion
+158
-1
arkui/ace_ets_component_completion/ace_ets_component_wholeCompletion/src/main/ets/TestAbility/pages/gridScrollBar.ets
...mpletion/src/main/ets/TestAbility/pages/gridScrollBar.ets
+57
-0
arkui/ace_ets_component_completion/ace_ets_component_wholeCompletion/src/main/ets/test/List.test.ets
...component_wholeCompletion/src/main/ets/test/List.test.ets
+2
-0
arkui/ace_ets_component_completion/ace_ets_component_wholeCompletion/src/main/ets/test/gridScrollbarUpdate.test.ets
...Completion/src/main/ets/test/gridScrollbarUpdate.test.ets
+97
-0
arkui/ace_ets_component_completion/ace_ets_component_wholeCompletion/src/main/resources/base/profile/test_pages.json
...ompletion/src/main/resources/base/profile/test_pages.json
+2
-1
未找到文件。
arkui/ace_ets_component_completion/ace_ets_component_wholeCompletion/src/main/ets/TestAbility/pages/gridScrollBar.ets
0 → 100644
浏览文件 @
51f8779d
/*
* 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.
*/
@Entry
@Component
struct gridScrollBar {
@State Number: String[] = ['0', '1', '2', '3', '4']
build() {
Column({ space: 5 }) {
Grid() {
ForEach(this.Number, (day: string) => {
ForEach(this.Number, (day: string) => {
GridItem() {
Text(day)
.fontSize(16)
.backgroundColor(0xF9CF93)
.width('100%')
.height(80)
.textAlign(TextAlign.Center)
}
}, day => day)
}, day => day)
}
.key('Grid_scrollbarUpdate_0800')
.columnsTemplate('1fr 1fr 1fr 1fr 1fr')
.columnsGap(10)
.rowsGap(10)
.onScrollIndex((first: number) => {
console.info(first.toString())
})
.onScrollBarUpdate((index:number,offset:number)=> {
return ({totalOffset:10, totalLength:200})
})
.width('90%')
.backgroundColor(0xFAEEE0)
.height(300)
}.width('100%').margin({ top: 5 })
}
}
\ No newline at end of file
arkui/ace_ets_component_completion/ace_ets_component_wholeCompletion/src/main/ets/test/List.test.ets
浏览文件 @
51f8779d
...
...
@@ -31,6 +31,7 @@ import imageObscuredTest from './imageObscuredTest.test';
import stageAnimatorTest from './stageAnimator.test';
import navigationTypeTest from './navigationType.test';
import textSpanFontTest from './textSpanFont.test';
import gridScrollbarUpdateTest from './gridScrollbarUpdate.test';
export default function testsuite() {
stageFontTest()
...
...
@@ -51,4 +52,5 @@ export default function testsuite() {
stageAnimatorTest()
navigationTypeTest()
textSpanFontTest()
gridScrollbarUpdateTest()
}
\ No newline at end of file
arkui/ace_ets_component_completion/ace_ets_component_wholeCompletion/src/main/ets/test/gridScrollbarUpdate.test.ets
0 → 100644
浏览文件 @
51f8779d
/*
* 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 hilog from '@ohos.hilog';
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'
import router from '@system.router';
export default function gridScrollbarUpdateTest() {
describe('gridScrollbarUpdateTest', function () {
// Defines a test suite. Two parameters are supported: test suite name and test suite function.
beforeAll(function () {
// Presets an action, which is performed only once before all test cases of the test suite start.
// This API supports only one parameter: preset action function.
})
beforeEach(async function (done) {
console.info("flex beforeEach start");
let options = {
uri: 'TestAbility/pages/gridScrollBar',
}
try {
router.clear();
let pages = router.getState();
console.info("get gridScrollBar state success " + JSON.stringify(pages));
if (!("gridScrollBar" == pages.name)) {
console.info("get gridScrollBar state success " + JSON.stringify(pages.name));
let result = await router.push(options);
console.info("push gridScrollBar page success " + JSON.stringify(result));
}
} catch (err) {
console.error("push gridScrollBar page error: " + err);
}
done()
});
afterEach(function () {
// Presets a clear action, which is performed after each unit test case ends.
// The number of execution times is the same as the number of test cases defined by **it**.
// This API supports only one parameter: clear action function.
})
afterAll(function () {
// Presets a clear action, which is performed after all test cases of the test suite end.
// This API supports only one parameter: clear action function.
})
it('Grid_scrollbarUpdate_0801', 0, async function (done) {
console.info('Grid_scrollbarUpdate_0801 START');
setTimeout(()=>{
try{
let strJson = getInspectorByKey('Grid_scrollbarUpdate_0800');
console.info('Grid_scrollbarUpdate_0801 START :'+ JSON.stringify(strJson));
let obj = JSON.parse(strJson);
console.info("Grid_scrollbarUpdate_0801 obj is: " + JSON.stringify(obj));
let width = obj.$attrs.width
let height = obj.$attrs.height
expect(width).assertEqual("90.00%");
expect(height).assertEqual("300.00vp");
console.info('Grid_scrollbarUpdate_0801 END ');
} catch(err) {
expect().assertFail()
console.info('Grid_scrollbarUpdate_0801 ERR '+ JSON.stringify(err));
}
done();
},500)
})
it('Grid_scrollbarUpdate_0802', 0, async function (done) {
console.info('Grid_scrollbarUpdate_0802 START');
setTimeout(()=>{
try{
let strJson = getInspectorByKey('Grid_scrollbarUpdate_0800');
console.info('Grid_scrollbarUpdate_0802 START :'+ JSON.stringify(strJson));
let obj = JSON.parse(strJson);
console.info("Grid_scrollbarUpdate_0802 obj is: " + JSON.stringify(obj));
expect(obj.$type).assertEqual("Grid");
console.info('Grid_scrollbarUpdate_0802 END ');
} catch(err) {
expect().assertFail()
console.info('Grid_scrollbarUpdate_0802 ERR '+ JSON.stringify(err));
}
done();
},500)
})
})
}
\ No newline at end of file
arkui/ace_ets_component_completion/ace_ets_component_wholeCompletion/src/main/resources/base/profile/test_pages.json
浏览文件 @
51f8779d
...
...
@@ -19,6 +19,7 @@
"TestAbility/pages/imageObscuredTest"
,
"TestAbility/pages/stageAnimator"
,
"TestAbility/pages/navigationType"
,
"TestAbility/pages/textSpanFont"
"TestAbility/pages/textSpanFont"
,
"TestAbility/pages/gridScrollBar"
]
}
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录