Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
5d968d34
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,发现更多精彩内容 >>
未验证
提交
5d968d34
编写于
2月 15, 2023
作者:
O
openharmony_ci
提交者:
Gitee
2月 15, 2023
浏览文件
操作
浏览文件
下载
差异文件
!7448 test:Add column&row_space xts_acts test
Merge pull request !7448 from 王倩/column_row
上级
c86cf35c
70930484
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
357 addition
and
0 deletion
+357
-0
arkui/ace_ets_layout_test/entry/src/main/ets/MainAbility/pages/Column/spaceChanged/Column_Space.ets
...ts/MainAbility/pages/Column/spaceChanged/Column_Space.ets
+42
-0
arkui/ace_ets_layout_test/entry/src/main/ets/MainAbility/pages/Row/spaceChanged/Row_Space.ets
...main/ets/MainAbility/pages/Row/spaceChanged/Row_Space.ets
+45
-0
arkui/ace_ets_layout_test/entry/src/main/ets/test/Column/spaceChanged/Column_Space.test.ets
...c/main/ets/test/Column/spaceChanged/Column_Space.test.ets
+135
-0
arkui/ace_ets_layout_test/entry/src/main/ets/test/Row/spaceChanged/Row_Space.test.ets
...try/src/main/ets/test/Row/spaceChanged/Row_Space.test.ets
+135
-0
未找到文件。
arkui/ace_ets_layout_test/entry/src/main/ets/MainAbility/pages/Column/spaceChanged/Column_Space.ets
0 → 100644
浏览文件 @
5d968d34
/*
* Copyright (c) 2023-2030 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 AlignStart_AddAlign {
@State addSpace: number = 10
messageManager:MessageManager = new MessageManager()
onPageShow() {
console.info('AlignSpaceEvenly_NoSpace onPageShow');
globalThis.value = {
name:'messageManager',message:this.messageManager
}
let callback:Callback = (message:any) => {
console.error('message = ' + message.name + "--" + message.value);
if (message.name == 'addSpace') {
this.addSpace = message.value;
}
}
this.messageManager.registerCallback(callback);
}
build() {
Column({space:this.addSpace}) {
Column(){Text('1')}.width(300).height(50).backgroundColor(0xF5DEB3).key('Column_Space_011')
Column(){Text('2')}.width(300).height(100).backgroundColor(0xD2B48C).key('Column_Space_012')
Column(){Text('3')}.width(300).height(150).backgroundColor(0xF5DEB3).key('Column_Space_013')
}.key('Column_Space_01').width(350).height(400).backgroundColor(0xAFEEEE)
}
}
arkui/ace_ets_layout_test/entry/src/main/ets/MainAbility/pages/Row/spaceChanged/Row_Space.ets
0 → 100644
浏览文件 @
5d968d34
/**
* Copyright (c) 2023-2030 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 Row_FlexPad_TextMarPad{
@State addSpace: number = 5
messageManager:MessageManager = new MessageManager()
onPageShow() {
console.info('AlignSpaceEvenly_NoSpace onPageShow');
globalThis.value = {
name:'messageManager',message:this.messageManager
}
let callback:Callback = (message:any) => {
console.error('message = ' + message.name + "--" + message.value);
if (message.name == 'addSpace') {
this.addSpace = message.value;
}
}
this.messageManager.registerCallback(callback);
}
build(){
Row({space:this.addSpace}){
Text('1').width(100).height(50).backgroundColor(0xF5DEB3).key('Row_Space_011')
Text('2').width(100).height(100).backgroundColor(0xD2B48C).key('Row_Space_012')
Text('3').width(100).height(150).backgroundColor(0xF5DEB3).key('Row_Space_013')
}
.width(350)
.height(200)
.key('Row_Space_01')
.backgroundColor(0xAFEEEE)
}
}
\ No newline at end of file
arkui/ace_ets_layout_test/entry/src/main/ets/test/Column/spaceChanged/Column_Space.test.ets
0 → 100644
浏览文件 @
5d968d34
/**
* Copyright (c) 2023-2030 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 '@ohos.router';
import CommonFunc from '../../../MainAbility/common/Common';
import {MessageManager,Callback} from '../../../MainAbility/common/MessageManager';
export default function Column_Space() {
describe('column_SpaceTest', function () {
beforeEach(async function (done) {
console.info("Column_Space beforeEach start");
let options = {
url: "MainAbility/pages/Column/spaceChanged/Column_Space",
}
try {
router.clear();
let pages = router.getState();
console.info("get Column_Space state pages:" + JSON.stringify(pages));
if (!("Column_Space" == pages.name)) {
console.info("get Column_Space pages.name:" + JSON.stringify(pages.name));
let result = await router.push(options);
await CommonFunc.sleep(2000);
console.info("push Column_Space page result:" + JSON.stringify(result));
}
} catch (err) {
console.error("push Column_Space page error " + JSON.stringify(err));
expect().assertFail();
}
done();
});
afterEach(async function () {
await CommonFunc.sleep(2000);
console.info("Column_Space after each called")
});
/**
* @tc.number SUB_ACE_COLUMN_SPACE_TEST_0100
* @tc.name Column_Space
* @tc.desc The value of space changes, and the layout size of the parent and child components is fixed
*/
it('SUB_ACE_COLUMN_SPACE_TEST_0100', 0, async function (done) {
console.info('[SUB_ACE_COLUMN_SPACE_TEST_0100] START');
globalThis.value.message.notify({name:'addSpace', value:30});
await CommonFunc.sleep(3000);
let Column_Space_011 = CommonFunc.getComponentRect('Column_Space_011');
let Column_Space_012 = CommonFunc.getComponentRect('Column_Space_012');
let Column_Space_013 = CommonFunc.getComponentRect('Column_Space_013');
let Column_Space_01 = CommonFunc.getComponentRect('Column_Space_01');
expect(Column_Space_011.left - Column_Space_01.left).assertEqual(Column_Space_01.right - Column_Space_011.right);
expect(Column_Space_012.left - Column_Space_01.left).assertEqual(Column_Space_01.right - Column_Space_012.right);
expect(Column_Space_013.left - Column_Space_01.left).assertEqual(Column_Space_01.right - Column_Space_013.right);
expect(Column_Space_012.top - Column_Space_011.bottom).assertEqual(Column_Space_013.top - Column_Space_012.bottom)
expect(Column_Space_012.top - Column_Space_011.bottom).assertEqual(vp2px(30));
expect(Column_Space_01.top).assertEqual(Column_Space_011.top);
expect(Column_Space_013.bottom).assertLess(Column_Space_01.bottom);
expect(Column_Space_011.bottom - Column_Space_011.top).assertEqual(vp2px(50));
expect(Column_Space_012.bottom - Column_Space_012.top).assertEqual(vp2px(100));
expect(Column_Space_013.bottom - Column_Space_013.top).assertEqual(vp2px(150));
expect(Column_Space_011.right - Column_Space_011.left).assertEqual(vp2px(300));
expect(Column_Space_012.right - Column_Space_012.left).assertEqual(vp2px(300));
expect(Column_Space_013.right - Column_Space_013.left).assertEqual(vp2px(300));
console.info('[SUB_ACE_COLUMN_SPACE_TEST_0100] END');
done();
});
/**
* @tc.number SUB_ACE_COLUMN_SPACE_TEST_0200
* @tc.name Column_Space
* @tc.desc The value of space changes, and the layout size of the parent and child components is fixed
*/
it('SUB_ACE_COLUMN_SPACE_TEST_0200', 0, async function (done) {
console.info('[SUB_ACE_COLUMN_SPACE_TEST_0200] START');
globalThis.value.message.notify({name:'addSpace', value:50});
await CommonFunc.sleep(3000);
let Column_Space_011 = CommonFunc.getComponentRect('Column_Space_011');
let Column_Space_012 = CommonFunc.getComponentRect('Column_Space_012');
let Column_Space_013 = CommonFunc.getComponentRect('Column_Space_013');
let Column_Space_01 = CommonFunc.getComponentRect('Column_Space_01');
expect(Column_Space_011.left - Column_Space_01.left).assertEqual(Column_Space_01.right - Column_Space_011.right);
expect(Column_Space_012.left - Column_Space_01.left).assertEqual(Column_Space_01.right - Column_Space_012.right);
expect(Column_Space_013.left - Column_Space_01.left).assertEqual(Column_Space_01.right - Column_Space_013.right);
expect(Column_Space_012.top - Column_Space_011.bottom).assertEqual(Column_Space_013.top - Column_Space_012.bottom);
expect(Column_Space_012.top - Column_Space_011.bottom).assertEqual(vp2px(50));
expect(Column_Space_01.top).assertEqual(Column_Space_011.top);
expect(Column_Space_013.bottom).assertEqual(Column_Space_01.bottom);
expect(Column_Space_011.bottom - Column_Space_011.top).assertEqual(vp2px(50));
expect(Column_Space_012.bottom - Column_Space_012.top).assertEqual(vp2px(100));
expect(Column_Space_013.bottom - Column_Space_013.top).assertEqual(vp2px(150));
expect(Column_Space_011.right - Column_Space_011.left).assertEqual(vp2px(300));
expect(Column_Space_012.right - Column_Space_012.left).assertEqual(vp2px(300));
expect(Column_Space_013.right - Column_Space_013.left).assertEqual(vp2px(300));
console.info('[SUB_ACE_COLUMN_SPACE_TEST_0200] END');
done();
});
/**
* @tc.number SUB_ACE_COLUMN_SPACE_TEST_0300
* @tc.name Column_Space
* @tc.desc The value of space changes, and the layout size of the parent and child components is fixed
*/
it('SUB_ACE_COLUMN_SPACE_TEST_0300', 0, async function (done) {
console.info('[SUB_ACE_COLUMN_SPACE_TEST_0300] START');
globalThis.value.message.notify({name:'addSpace', value:70});
await CommonFunc.sleep(3000);
let Column_Space_011 = CommonFunc.getComponentRect('Column_Space_011');
let Column_Space_012 = CommonFunc.getComponentRect('Column_Space_012');
let Column_Space_013 = CommonFunc.getComponentRect('Column_Space_013');
let Column_Space_01 = CommonFunc.getComponentRect('Column_Space_01');
expect(Column_Space_011.left - Column_Space_01.left).assertEqual(Column_Space_01.right - Column_Space_011.right);
expect(Column_Space_012.left - Column_Space_01.left).assertEqual(Column_Space_01.right - Column_Space_012.right);
expect(Column_Space_013.left - Column_Space_01.left).assertEqual(Column_Space_01.right - Column_Space_013.right);
expect(Column_Space_012.top - Column_Space_011.bottom).assertEqual(Column_Space_013.top - Column_Space_012.bottom);
expect(Column_Space_012.top - Column_Space_011.bottom).assertEqual(vp2px(70));
expect(Column_Space_01.top).assertEqual(Column_Space_011.top);
expect(Column_Space_013.bottom).assertLarger(Column_Space_01.bottom);
expect(Column_Space_011.bottom - Column_Space_011.top).assertEqual(vp2px(50));
expect(Column_Space_012.bottom - Column_Space_012.top).assertEqual(vp2px(100));
expect(Column_Space_013.bottom - Column_Space_013.top).assertEqual(vp2px(150));
expect(Column_Space_011.right - Column_Space_011.left).assertEqual(vp2px(300));
expect(Column_Space_012.right - Column_Space_012.left).assertEqual(vp2px(300));
expect(Column_Space_013.right - Column_Space_013.left).assertEqual(vp2px(300));
console.info('[SUB_ACE_COLUMN_SPACE_TEST_0300] END');
done();
});
})
}
arkui/ace_ets_layout_test/entry/src/main/ets/test/Row/spaceChanged/Row_Space.test.ets
0 → 100644
浏览文件 @
5d968d34
/**
* Copyright (c) 2023-2030 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 '@ohos.router';
import CommonFunc from '../../../MainAbility/common/Common';
import {MessageManager,Callback} from '../../../MainAbility/common/MessageManager';
export default function Row_Space() {
describe('row_SpaceTest', function () {
beforeEach(async function (done) {
console.info("Row_Space beforeEach start");
let options = {
url: "MainAbility/pages/Row/spaceChanged/Row_Space",
}
try {
router.clear();
let pages = router.getState();
console.info("get Row_Space state pages:" + JSON.stringify(pages));
if (!("Row_Space" == pages.name)) {
console.info("get Row_Space pages.name:" + JSON.stringify(pages.name));
let result = await router.push(options);
await CommonFunc.sleep(2000);
console.info("push Row_Space page result:" + JSON.stringify(result));
}
} catch (err) {
console.error("push Row_Space page error " + JSON.stringify(err));
expect().assertFail();
}
done();
});
afterEach(async function () {
await CommonFunc.sleep(2000);
console.info("Row_Space after each called")
});
/**
* @tc.number SUB_ACE_ROW_SPACE_TEST_0100
* @tc.name Row_Space
* @tc.desc The value of space changes, and the layout size of the parent and child components is fixed
*/
it('SUB_ACE_ROW_SPACE_0100', 0, async function (done) {
console.info('[SUB_ACE_ROW_SPACE_TEST_0100] START');
globalThis.value.message.notify({name:'addSpace', value:10});
await CommonFunc.sleep(3000);
let Row_Space_011 = CommonFunc.getComponentRect('Row_Space_011');
let Row_Space_012 = CommonFunc.getComponentRect('Row_Space_012');
let Row_Space_013 = CommonFunc.getComponentRect('Row_Space_013');
let Row_Space_01 = CommonFunc.getComponentRect('Row_Space_01');
expect(Row_Space_011.top - Row_Space_01.top).assertEqual(Row_Space_01.bottom - Row_Space_011.bottom);
expect(Row_Space_012.top - Row_Space_01.top).assertEqual(Row_Space_01.bottom - Row_Space_012.bottom);
expect(Row_Space_013.top - Row_Space_01.top).assertEqual(Row_Space_01.bottom - Row_Space_013.bottom);
expect(Row_Space_012.left - Row_Space_011.right).assertEqual(Row_Space_013.left - Row_Space_012.right);
expect(Row_Space_012.left - Row_Space_011.right).assertEqual(vp2px(10))
expect(Row_Space_01.left).assertEqual(Row_Space_011.left);
expect(Row_Space_013.right).assertLess(Row_Space_01.right);
expect(Row_Space_011.bottom - Row_Space_011.top).assertEqual(vp2px(50));
expect(Row_Space_012.bottom - Row_Space_012.top).assertEqual(vp2px(100));
expect(Row_Space_013.bottom - Row_Space_013.top).assertEqual(vp2px(150));
expect(Row_Space_011.right - Row_Space_011.left).assertEqual(vp2px(100));
expect(Row_Space_012.right - Row_Space_012.left).assertEqual(vp2px(100));
expect(Row_Space_013.right - Row_Space_013.left).assertEqual(vp2px(100));
console.info('[SUB_ACE_ROW_SPACE_TEST_0100] END');
done();
});
/**
* @tc.number SUB_ACE_ROW_SPACE_TEST_0200
* @tc.name Row_Space
* @tc.desc The value of space changes, and the layout size of the parent and child components is fixed
*/
it('SUB_ACE_ROW_SPACE_TEST_0200', 0, async function (done) {
console.info('[SUB_ACE_ROW_SPACE_TEST_0200] START');
globalThis.value.message.notify({name:'addSpace', value:25});
await CommonFunc.sleep(3000);
let Row_Space_011 = CommonFunc.getComponentRect('Row_Space_011');
let Row_Space_012 = CommonFunc.getComponentRect('Row_Space_012');
let Row_Space_013 = CommonFunc.getComponentRect('Row_Space_013');
let Row_Space_01 = CommonFunc.getComponentRect('Row_Space_01');
expect(Row_Space_011.top - Row_Space_01.top).assertEqual(Row_Space_01.bottom - Row_Space_011.bottom);
expect(Row_Space_012.top - Row_Space_01.top).assertEqual(Row_Space_01.bottom - Row_Space_012.bottom);
expect(Row_Space_013.top - Row_Space_01.top).assertEqual(Row_Space_01.bottom - Row_Space_013.bottom);
expect(Row_Space_012.left - Row_Space_011.right).assertEqual(Row_Space_013.left - Row_Space_012.right);
expect(Row_Space_012.left - Row_Space_011.right).assertEqual(vp2px(25));
expect(Row_Space_01.left).assertEqual(Row_Space_011.left);
expect(Row_Space_013.right).assertEqual(Row_Space_01.right);
expect(Row_Space_011.bottom - Row_Space_011.top).assertEqual(vp2px(50));
expect(Row_Space_012.bottom - Row_Space_012.top).assertEqual(vp2px(100));
expect(Row_Space_013.bottom - Row_Space_013.top).assertEqual(vp2px(150));
expect(Row_Space_011.right - Row_Space_011.left).assertEqual(vp2px(100));
expect(Row_Space_012.right - Row_Space_012.left).assertEqual(vp2px(100));
expect(Row_Space_013.right - Row_Space_013.left).assertEqual(vp2px(100));
console.info('[SUB_ACE_ROW_SPACE_TEST_0200] END');
done();
});
/**
* @tc.number SUB_ACE_ROW_SPACE_TEST_0300
* @tc.name Row_Space
* @tc.desc The value of space changes, and the layout size of the parent and child components is fixed
*/
it('SUB_ACE_ROW_SPACE_TEST_0300', 0, async function (done) {
console.info('[SUB_ACE_ROW_SPACE_TEST_0300] START');
globalThis.value.message.notify({name:'addSpace', value:30});
await CommonFunc.sleep(3000);
let Row_Space_011 = CommonFunc.getComponentRect('Row_Space_011');
let Row_Space_012 = CommonFunc.getComponentRect('Row_Space_012');
let Row_Space_013 = CommonFunc.getComponentRect('Row_Space_013');
let Row_Space_01 = CommonFunc.getComponentRect('Row_Space_01');
expect(Row_Space_011.top - Row_Space_01.top).assertEqual(Row_Space_01.bottom - Row_Space_011.bottom);
expect(Row_Space_012.top - Row_Space_01.top).assertEqual(Row_Space_01.bottom - Row_Space_012.bottom);
expect(Row_Space_013.top - Row_Space_01.top).assertEqual(Row_Space_01.bottom - Row_Space_013.bottom);
expect(Row_Space_012.left - Row_Space_011.right).assertEqual(Row_Space_013.left - Row_Space_012.right);
expect(Row_Space_012.left - Row_Space_011.right).assertEqual(vp2px(30))
expect(Row_Space_01.left).assertEqual(Row_Space_011.left);
expect(Row_Space_013.right).assertLarger(Row_Space_01.right);
expect(Row_Space_011.bottom - Row_Space_011.top).assertEqual(vp2px(50));
expect(Row_Space_012.bottom - Row_Space_012.top).assertEqual(vp2px(100));
expect(Row_Space_013.bottom - Row_Space_013.top).assertEqual(vp2px(150));
expect(Row_Space_011.right - Row_Space_011.left).assertEqual(vp2px(100));
expect(Row_Space_012.right - Row_Space_012.left).assertEqual(vp2px(100));
expect(Row_Space_013.right - Row_Space_013.left).assertEqual(vp2px(100));
console.info('[SUB_ACE_ROW_SPACE_TEST_0300] END');
done();
});
})
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录