Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
ac8b3249
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看板
提交
ac8b3249
编写于
5月 29, 2023
作者:
Z
zhangshuqi
1
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix the testcase
Signed-off-by:
N
zhangshuqi
<
zhangshuqi7@huawei.com
>
上级
6edaadd2
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
167 addition
and
61 deletion
+167
-61
arkui/ace_ets_layout_test/entry/src/main/ets/MainAbility/pages/Swiper/Swiper_ItemChange/swiperItemSize2.ets
...bility/pages/Swiper/Swiper_ItemChange/swiperItemSize2.ets
+62
-0
arkui/ace_ets_layout_test/entry/src/main/ets/test/List.test.ets
...ace_ets_layout_test/entry/src/main/ets/test/List.test.ets
+5
-9
arkui/ace_ets_layout_test/entry/src/main/ets/test/Swiper/Swiper_ItemChange/swiperItemSize.test.ets
...ets/test/Swiper/Swiper_ItemChange/swiperItemSize.test.ets
+4
-52
arkui/ace_ets_layout_test/entry/src/main/ets/test/Swiper/Swiper_ItemChange/swiperItemSize2.test.ets
...ts/test/Swiper/Swiper_ItemChange/swiperItemSize2.test.ets
+95
-0
arkui/ace_ets_layout_test/entry/src/main/resources/base/profile/main_pages.json
...est/entry/src/main/resources/base/profile/main_pages.json
+1
-0
未找到文件。
arkui/ace_ets_layout_test/entry/src/main/ets/MainAbility/pages/Swiper/Swiper_ItemChange/swiperItemSize2.ets
0 → 100644
浏览文件 @
ac8b3249
/*
* Copyright (c) 2023 iSoftStone Information Technology (Group) 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 {MessageManager,Callback} from '../../../common/MessageManager';
@Entry
@Component
struct SwiperItemSizeTest2 {
@State testHeight: number = 150
@State testWidth: number = 150
@State testIndex: number = 0
messageManager:MessageManager = new MessageManager()
onPageShow() {
console.info('SwiperItemSize onPageShow');
globalThis.value = {
name:'messageManager',message:this.messageManager
}
let callback:Callback = (message:any) => {
console.error('message = ' + message.name + "--" + message.value);
if (message.name == 'height') {
this.testHeight = message.value;
}
if (message.name == 'width') {
this.testWidth = message.value;
}
if (message.name == 'index') {
this.testIndex = message.value;
}
}
this.messageManager.registerCallback(callback);
}
build() {
Column({ space: 5 }) {
Swiper() {
Column(){Text ('1')}.width(this.testWidth).height(this.testHeight).backgroundColor(0xF5DEB3).key('itemSizekey2_01')
Column(){Text ('2')}.width(this.testWidth).height(this.testHeight).backgroundColor(0xD2B48C).key('itemSizekey2_02')
Column(){Text ('3')}.width(this.testWidth).height(this.testHeight).backgroundColor(0xF5DEB3).key('itemSizekey2_03')
Column(){Text ('4')}.width(this.testWidth).height(this.testHeight).backgroundColor(0xD2B48C)
Column(){Text ('5')}.width(this.testWidth).height(this.testHeight).backgroundColor(0xF5DEB3)
Column(){Text ('6')}.width(this.testWidth).height(this.testHeight).backgroundColor(0xD2B48C)
}
.key('itemSizekey2')
.height(300)
.width(300)
.index(this.testIndex)
.indicator(true)
.loop(true)
.displayCount(1)
}.margin({ top: 5 })
}
}
\ No newline at end of file
arkui/ace_ets_layout_test/entry/src/main/ets/test/List.test.ets
浏览文件 @
ac8b3249
...
@@ -75,10 +75,7 @@ import swiperIndex from './Swiper/Swiper_ParmsChange/swiperIndex.test.ets';
...
@@ -75,10 +75,7 @@ import swiperIndex from './Swiper/Swiper_ParmsChange/swiperIndex.test.ets';
import swiperVertical from './Swiper/Swiper_ParmsChange/swiperVertical.test.ets';
import swiperVertical from './Swiper/Swiper_ParmsChange/swiperVertical.test.ets';
import swiperLoopTrue from './Swiper/Swiper_ParmsChange/swiperLoopTrue.test.ets';
import swiperLoopTrue from './Swiper/Swiper_ParmsChange/swiperLoopTrue.test.ets';
import swiperLoopFalse from './Swiper/Swiper_ParmsChange/swiperLoopFalse.test.ets';
import swiperLoopFalse from './Swiper/Swiper_ParmsChange/swiperLoopFalse.test.ets';
import swiperAutoPlay_1 from './Swiper/Swiper_ParmsChange/swiperAutoPlay_1.test.ets';
import swiperAutoPlay_2 from './Swiper/Swiper_ParmsChange/swiperAutoPlay_2.test.ets';
import swiperAutoPlay_3 from './Swiper/Swiper_ParmsChange/swiperAutoPlay_3.test.ets';
import swiperAutoPlay_4 from './Swiper/Swiper_ParmsChange/swiperAutoPlay_4.test.ets';
import swiperItemSpace from './Swiper/Swiper_ParmsChange/swiperItemSpace.test.ets';
import swiperItemSpace from './Swiper/Swiper_ParmsChange/swiperItemSpace.test.ets';
import swiperPadding from './Swiper/Swiper_ParmsChange/swiperPadding.test.ets';
import swiperPadding from './Swiper/Swiper_ParmsChange/swiperPadding.test.ets';
import swiperMargin from './Swiper/Swiper_ParmsChange/swiperMargin.test.ets';
import swiperMargin from './Swiper/Swiper_ParmsChange/swiperMargin.test.ets';
...
@@ -86,6 +83,7 @@ import swiperMarPad from './Swiper/Swiper_ParmsChange/swiperMarPad.test.ets';
...
@@ -86,6 +83,7 @@ import swiperMarPad from './Swiper/Swiper_ParmsChange/swiperMarPad.test.ets';
import swiperDisableSwipeTrue from './Swiper/Swiper_ParmsChange/swiperDisableSwipeTrue.test.ets';
import swiperDisableSwipeTrue from './Swiper/Swiper_ParmsChange/swiperDisableSwipeTrue.test.ets';
import swiperDisableSwipeFalse from './Swiper/Swiper_ParmsChange/swiperDisableSwipeFalse.test.ets';
import swiperDisableSwipeFalse from './Swiper/Swiper_ParmsChange/swiperDisableSwipeFalse.test.ets';
import swiperItemSize from './Swiper/Swiper_ItemChange/swiperItemSize.test.ets';
import swiperItemSize from './Swiper/Swiper_ItemChange/swiperItemSize.test.ets';
import swiperItemSize2 from './Swiper/Swiper_ItemChange/swiperItemSize2.test.ets';
import swiperItemPadding from './Swiper/Swiper_ItemChange/swiperItemPadding.test.ets';
import swiperItemPadding from './Swiper/Swiper_ItemChange/swiperItemPadding.test.ets';
import swiperItemMargin from './Swiper/Swiper_ItemChange/swiperItemMargin.test.ets';
import swiperItemMargin from './Swiper/Swiper_ItemChange/swiperItemMargin.test.ets';
import swiperItemPadMar from './Swiper/Swiper_ItemChange/swiperItemPadMar.test.ets';
import swiperItemPadMar from './Swiper/Swiper_ItemChange/swiperItemPadMar.test.ets';
...
@@ -149,7 +147,7 @@ import Grid_Col_Span_Default from './Grid/Grid_Col/Grid_Col_Span/Grid_Col_Span_D
...
@@ -149,7 +147,7 @@ import Grid_Col_Span_Default from './Grid/Grid_Col/Grid_Col_Span/Grid_Col_Span_D
import Grid_Col_Offset_Default from './Grid/Grid_Col/Grid_Col_Offset/Grid_Col_Offset_Default.test.ets';
import Grid_Col_Offset_Default from './Grid/Grid_Col/Grid_Col_Offset/Grid_Col_Offset_Default.test.ets';
import Grid_Col_Offset_Number from './Grid/Grid_Col/Grid_Col_Offset/Grid_Col_Offset_Number.test.ets';
import Grid_Col_Offset_Number from './Grid/Grid_Col/Grid_Col_Offset/Grid_Col_Offset_Number.test.ets';
import Grid_Col_Offset_GridColColumnOption from './Grid/Grid_Col/Grid_Col_Offset/Grid_Col_Offset_GridColColumnOption.test.ets';
import Grid_Col_Offset_GridColColumnOption from './Grid/Grid_Col/Grid_Col_Offset/Grid_Col_Offset_GridColColumnOption.test.ets';
import Grid_Row_Columns from './Grid/Grid_Row/Grid_Row_Columns/Grid_Row_Columns.test.ets';
import Grid_Row_Columns from './Grid/Grid_Row/Grid_Row_Columns/Grid_Row_Columns.test.ets';
import Grid_Row_Columns_Default from './Grid/Grid_Row/Grid_Row_Columns/Grid_Row_Columns_Default.test.ets';
import Grid_Row_Columns_Default from './Grid/Grid_Row/Grid_Row_Columns/Grid_Row_Columns_Default.test.ets';
import Grid_Row_Columns_Option from './Grid/Grid_Row/Grid_Row_Columns/Grid_Row_Columns_Option.test.ets';
import Grid_Row_Columns_Option from './Grid/Grid_Row/Grid_Row_Columns/Grid_Row_Columns_Option.test.ets';
...
@@ -469,10 +467,7 @@ swiperIndex()
...
@@ -469,10 +467,7 @@ swiperIndex()
swiperVertical()
swiperVertical()
swiperLoopTrue()
swiperLoopTrue()
swiperLoopFalse()
swiperLoopFalse()
swiperAutoPlay_1()
swiperAutoPlay_2()
swiperAutoPlay_3()
swiperAutoPlay_4()
swiperItemSpace()
swiperItemSpace()
swiperPadding()
swiperPadding()
swiperMargin()
swiperMargin()
...
@@ -480,6 +475,7 @@ swiperMarPad()
...
@@ -480,6 +475,7 @@ swiperMarPad()
swiperDisableSwipeTrue()
swiperDisableSwipeTrue()
swiperDisableSwipeFalse()
swiperDisableSwipeFalse()
swiperItemSize()
swiperItemSize()
swiperItemSize2()
swiperItemPadding()
swiperItemPadding()
swiperItemMargin()
swiperItemMargin()
swiperItemPadMar()
swiperItemPadMar()
...
...
arkui/ace_ets_layout_test/entry/src/main/ets/test/Swiper/Swiper_ItemChange/swiperItemSize.test.ets
浏览文件 @
ac8b3249
...
@@ -60,8 +60,8 @@ export default function swiperItemSize() {
...
@@ -60,8 +60,8 @@ export default function swiperItemSize() {
console.info("Before page turning , the itemSizekey01.left value is " + JSON.stringify(itemSizekey01.left));
console.info("Before page turning , the itemSizekey01.left value is " + JSON.stringify(itemSizekey01.left));
expect(itemSizekey.left).assertEqual(itemSizekey01.left);
expect(itemSizekey.left).assertEqual(itemSizekey01.left);
expect(itemSizekey.top).assertEqual(itemSizekey01.top);
expect(itemSizekey.top).assertEqual(itemSizekey01.top);
expect(
Math.round(itemSizekey.right - itemSizekey01.right)).assertEqual(vp2px(150)
);
expect(
itemSizekey.right).assertEqual(itemSizekey01.right
);
expect(Math.round(itemSizekey.bottom - itemSizekey01.bottom)).assertEqual(vp2px(150));
// Flipping.
// Flipping.
let driver = await Driver.create();
let driver = await Driver.create();
await driver.swipe(250, 230, 200, 230);
await driver.swipe(250, 230, 200, 230);
...
@@ -75,8 +75,8 @@ export default function swiperItemSize() {
...
@@ -75,8 +75,8 @@ export default function swiperItemSize() {
console.info("After page turning , the itemSizekey02.left value is " + JSON.stringify(itemSizekey02.left));
console.info("After page turning , the itemSizekey02.left value is " + JSON.stringify(itemSizekey02.left));
expect(itemSizekey.left).assertEqual(itemSizekey02.left);
expect(itemSizekey.left).assertEqual(itemSizekey02.left);
expect(itemSizekey.top).assertEqual(itemSizekey02.top);
expect(itemSizekey.top).assertEqual(itemSizekey02.top);
expect(
Math.round(itemSizekey.right - itemSizekey01.right)).assertEqual(vp2px(150)
);
expect(
itemSizekey.right).assertEqual(itemSizekey02.right
);
expect(Math.round(itemSizekey.bottom - itemSizekey01.bottom)).assertEqual(vp2px(150));
console.info("The type value is " + JSON.stringify(obj.$type));
console.info("The type value is " + JSON.stringify(obj.$type));
console.info("The loop value is " + JSON.stringify(obj.$attrs.loop));
console.info("The loop value is " + JSON.stringify(obj.$attrs.loop));
console.info("The displayCount value is " + JSON.stringify(obj.$attrs.displayCount));
console.info("The displayCount value is " + JSON.stringify(obj.$attrs.displayCount));
...
@@ -87,53 +87,5 @@ export default function swiperItemSize() {
...
@@ -87,53 +87,5 @@ export default function swiperItemSize() {
done();
done();
});
});
/**
* @tc.number SUB_ACE_SWIPER_ITEMCHANGED_0200
* @tc.name testSwiperItemSizeExceed.
* @tc.desc Set item's height and width values '350*350'.
*/
it('testSwiperItemSizeExceed', 0, async function (done) {
console.info('new testSwiperItemSizeExceed START');
globalThis.value.message.notify({name:'index', value: 0});
globalThis.value.message.notify({name:'height', value: 350});
globalThis.value.message.notify({name:'width', value: 350});
await CommonFunc.sleep(1000);
let strJson = getInspectorByKey('itemSizekey');
let obj = JSON.parse(strJson);
let itemSizekey = CommonFunc.getComponentRect('itemSizekey');
let itemSizekey01 = CommonFunc.getComponentRect('itemSizekey01');
let itemSizekey02 = CommonFunc.getComponentRect('itemSizekey02');
let itemSizekey03 = CommonFunc.getComponentRect('itemSizekey03');
// Before flipping the page.
console.info("Before page turning , the itemSizekey.left value is " + JSON.stringify(itemSizekey.left));
console.info("Before page turning , the itemSizekey01.left value is " + JSON.stringify(itemSizekey01.left));
expect(itemSizekey.left).assertEqual(itemSizekey01.left);
expect(itemSizekey.right).assertEqual(itemSizekey01.right);
expect(itemSizekey.top).assertEqual(itemSizekey01.top);
expect(itemSizekey.bottom).assertEqual(itemSizekey01.bottom);
// Flipping.
let driver = await Driver.create();
await driver.swipe(250, 230, 200, 230);
await CommonFunc.sleep(1000);
// After flipping the page.
itemSizekey = CommonFunc.getComponentRect('itemSizekey');
itemSizekey01 = CommonFunc.getComponentRect('itemSizekey01');
itemSizekey02 = CommonFunc.getComponentRect('itemSizekey02');
itemSizekey03 = CommonFunc.getComponentRect('itemSizekey03');
console.info("After page turning , the itemSizekey.left value is " + JSON.stringify(itemSizekey.left));
console.info("After page turning , the itemSizekey02.left value is " + JSON.stringify(itemSizekey02.left));
expect(itemSizekey.left).assertEqual(itemSizekey02.left);
expect(itemSizekey.right).assertEqual(itemSizekey02.right);
expect(itemSizekey.top).assertEqual(itemSizekey02.top);
expect(itemSizekey.bottom).assertEqual(itemSizekey02.bottom);
console.info("The type value is " + JSON.stringify(obj.$type));
console.info("The loop value is " + JSON.stringify(obj.$attrs.loop));
console.info("The displayCount value is " + JSON.stringify(obj.$attrs.displayCount));
expect(obj.$type).assertEqual('Swiper');
expect(obj.$attrs.loop).assertEqual('true');
expect(obj.$attrs.displayCount).assertEqual(1);
console.info('new testSwiperItemSizeExceed END');
done();
});
})
})
}
}
\ No newline at end of file
arkui/ace_ets_layout_test/entry/src/main/ets/test/Swiper/Swiper_ItemChange/swiperItemSize2.test.ets
0 → 100644
浏览文件 @
ac8b3249
/**
* Copyright (c) 2023 iSoftStone Information Technology (Group) 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 {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from "@ohos/hypium";
import router from '@system.router';
import CommonFunc from "../../../MainAbility/common/Common";
import { UiComponent, UiDriver, Component, Driver, UiWindow, ON, BY, MatchPattern, DisplayRotation, ResizeDirection, WindowMode, PointerMatrix, UiDirection, MouseButton } from '@ohos.UiTest';
export default function swiperItemSize2() {
describe('swiperItemSizeTest2', function () {
beforeEach(async function (done) {
let options = {
uri: 'MainAbility/pages/Swiper/Swiper_ItemChange/swiperItemSize2',
}
try {
router.clear();
await CommonFunc.sleep(1000);
let pages = router.getState();
console.info("get swiperItemSize2 state success " + JSON.stringify(pages));
if (!("swiperItemSize2" == pages.name)) {
console.info("get swiperItemSize2 state success " + JSON.stringify(pages.name));
let result = await router.push(options)
console.info("push swiperItemSize2 page success " + JSON.stringify(result));
}
} catch (err) {
console.error("push swiperItemSize2 page error " + JSON.stringify(err));
}
});
afterEach(async function () {
await CommonFunc.sleep(1000);
console.info("swiperItemSize2 after each called");
});
/**
* @tc.number SUB_ACE_SWIPER_ITEMCHANGED_0100
* @tc.name testSwiperItemSizeExceed.
* @tc.desc Set item's height and width values '350*350'.
*/
it('testSwiperItemSizeExceed2', 0, async function (done) {
console.info('new testSwiperItemSizeExceed2 START');
globalThis.value.message.notify({name:'index', value: 0});
globalThis.value.message.notify({name:'height', value: 350});
globalThis.value.message.notify({name:'width', value: 350});
await CommonFunc.sleep(1000);
let strJson = getInspectorByKey('itemSizekey2');
let obj = JSON.parse(strJson);
let itemSizekey2 = CommonFunc.getComponentRect('itemSizekey2');
let itemSizekey2_01 = CommonFunc.getComponentRect('itemSizekey2_01');
let itemSizekey2_02 = CommonFunc.getComponentRect('itemSizekey2_02');
let itemSizekey2_03 = CommonFunc.getComponentRect('itemSizekey2_03');
// Before flipping the page.
console.info("Before page turning , the itemSizekey2.left value is " + JSON.stringify(itemSizekey2.left));
console.info("Before page turning , the itemSizekey2_01.left value is " + JSON.stringify(itemSizekey2_01.left));
expect(itemSizekey2.left).assertEqual(itemSizekey2_01.left);
expect(itemSizekey2.right).assertEqual(itemSizekey2_01.right);
expect(itemSizekey2.top).assertEqual(itemSizekey2_01.top);
expect(itemSizekey2.bottom).assertEqual(itemSizekey2_01.bottom);
// Flipping.
let driver = await Driver.create();
await driver.swipe(250, 230, 200, 230);
await CommonFunc.sleep(1000);
// After flipping the page.
itemSizekey2 = CommonFunc.getComponentRect('itemSizekey2');
itemSizekey2_01 = CommonFunc.getComponentRect('itemSizekey2_01');
itemSizekey2_02 = CommonFunc.getComponentRect('itemSizekey2_02');
itemSizekey2_03 = CommonFunc.getComponentRect('itemSizekey2_03');
console.info("After page turning , the itemSizekey2.left value is " + JSON.stringify(itemSizekey2.left));
console.info("After page turning , the itemSizekey2_02.left value is " + JSON.stringify(itemSizekey2_02.left));
expect(itemSizekey2.left).assertEqual(itemSizekey2_02.left);
expect(itemSizekey2.right).assertEqual(itemSizekey2_02.right);
expect(itemSizekey2.top).assertEqual(itemSizekey2_02.top);
expect(itemSizekey2.bottom).assertEqual(itemSizekey2_02.bottom);
console.info("The type value is " + JSON.stringify(obj.$type));
console.info("The loop value is " + JSON.stringify(obj.$attrs.loop));
console.info("The displayCount value is " + JSON.stringify(obj.$attrs.displayCount));
expect(obj.$type).assertEqual('Swiper');
expect(obj.$attrs.loop).assertEqual('true');
expect(obj.$attrs.displayCount).assertEqual(1);
console.info('new testSwiperItemSizeExceed2 END');
done();
});
})
}
\ No newline at end of file
arkui/ace_ets_layout_test/entry/src/main/resources/base/profile/main_pages.json
浏览文件 @
ac8b3249
...
@@ -301,6 +301,7 @@
...
@@ -301,6 +301,7 @@
"MainAbility/pages/Swiper/Swiper_ItemChange/swiperItemPadding"
,
"MainAbility/pages/Swiper/Swiper_ItemChange/swiperItemPadding"
,
"MainAbility/pages/Swiper/Swiper_ItemChange/swiperItemPadMar"
,
"MainAbility/pages/Swiper/Swiper_ItemChange/swiperItemPadMar"
,
"MainAbility/pages/Swiper/Swiper_ItemChange/swiperItemSize"
,
"MainAbility/pages/Swiper/Swiper_ItemChange/swiperItemSize"
,
"MainAbility/pages/Swiper/Swiper_ItemChange/swiperItemSize2"
,
"MainAbility/pages/Swiper/Swiper_ItemChange/swiperItemVisibility"
,
"MainAbility/pages/Swiper/Swiper_ItemChange/swiperItemVisibility"
,
"MainAbility/pages/Swiper/Swiper_ParmsChange/swiperAutoPlay_1"
,
"MainAbility/pages/Swiper/Swiper_ParmsChange/swiperAutoPlay_1"
,
"MainAbility/pages/Swiper/Swiper_ParmsChange/swiperAutoPlay_2"
,
"MainAbility/pages/Swiper/Swiper_ParmsChange/swiperAutoPlay_2"
,
...
...
鸿蒙社区
@harmonycommunity
mentioned in commit
d9ffbdac
·
5月 31, 2023
mentioned in commit
d9ffbdac
mentioned in commit d9ffbdacd5f33cb2bd4b98a66e9ea0ba1e06de61
开关提交列表
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录