Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
f6050292
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看板
提交
f6050292
编写于
2月 07, 2023
作者:
E
e
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
提交column&Row的space用例
Signed-off-by:
N
e
<
qianwangdq@isoftstone.com
>
上级
00bec899
变更
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
浏览文件 @
f6050292
/*
* 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_Sapace_011')
Column(){Text('2')}.width(300).height(100).backgroundColor(0xD2B48C).key('Column_Sapace_012')
Column(){Text('3')}.width(300).height(150).backgroundColor(0xF5DEB3).key('Column_Sapace_013')
}.key('Column_Sapace_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
浏览文件 @
f6050292
/**
* 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_Sapace_011')
Text('2').width(100).height(100).backgroundColor(0xD2B48C).key('Row_Sapace_012')
Text('3').width(100).height(150).backgroundColor(0xF5DEB3).key('Row_Sapace_013')
}
.width(350)
.height(200)
.key('Row_Sapace_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
浏览文件 @
f6050292
/**
* 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 aceColumnSpaceTest
*/
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_Sapace_011 = CommonFunc.getComponentRect('Column_Sapace_011');
let Column_Sapace_012 = CommonFunc.getComponentRect('Column_Sapace_012');
let Column_Sapace_013 = CommonFunc.getComponentRect('Column_Sapace_013');
let Column_Sapace_01 = CommonFunc.getComponentRect('Column_Sapace_01');
expect(Column_Sapace_011.left - Column_Sapace_01.left).assertEqual(Column_Sapace_01.right - Column_Sapace_011.right);
expect(Column_Sapace_012.left - Column_Sapace_01.left).assertEqual(Column_Sapace_01.right - Column_Sapace_012.right);
expect(Column_Sapace_013.left - Column_Sapace_01.left).assertEqual(Column_Sapace_01.right - Column_Sapace_013.right);
expect(Column_Sapace_012.top - Column_Sapace_011.bottom).assertEqual(Column_Sapace_013.top - Column_Sapace_012.bottom)
expect(Column_Sapace_012.top - Column_Sapace_011.bottom).assertEqual(vp2px(30));
expect(Column_Sapace_01.top).assertEqual(Column_Sapace_011.top);
expect(Column_Sapace_013.bottom).assertLess(Column_Sapace_01.bottom);
expect(Column_Sapace_011.bottom - Column_Sapace_011.top).assertEqual(vp2px(50));
expect(Column_Sapace_012.bottom - Column_Sapace_012.top).assertEqual(vp2px(100));
expect(Column_Sapace_013.bottom - Column_Sapace_013.top).assertEqual(vp2px(150));
expect(Column_Sapace_011.right - Column_Sapace_011.left).assertEqual(vp2px(300));
expect(Column_Sapace_012.right - Column_Sapace_012.left).assertEqual(vp2px(300));
expect(Column_Sapace_013.right - Column_Sapace_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 aceColumnSpaceTest
*/
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_Sapace_011 = CommonFunc.getComponentRect('Column_Sapace_011');
let Column_Sapace_012 = CommonFunc.getComponentRect('Column_Sapace_012');
let Column_Sapace_013 = CommonFunc.getComponentRect('Column_Sapace_013');
let Column_Sapace_01 = CommonFunc.getComponentRect('Column_Sapace_01');
expect(Column_Sapace_011.left - Column_Sapace_01.left).assertEqual(Column_Sapace_01.right - Column_Sapace_011.right);
expect(Column_Sapace_012.left - Column_Sapace_01.left).assertEqual(Column_Sapace_01.right - Column_Sapace_012.right);
expect(Column_Sapace_013.left - Column_Sapace_01.left).assertEqual(Column_Sapace_01.right - Column_Sapace_013.right);
expect(Column_Sapace_012.top - Column_Sapace_011.bottom).assertEqual(Column_Sapace_013.top - Column_Sapace_012.bottom);
expect(Column_Sapace_012.top - Column_Sapace_011.bottom).assertEqual(vp2px(50));
expect(Column_Sapace_01.top).assertEqual(Column_Sapace_011.top);
expect(Column_Sapace_013.bottom).assertEqual(Column_Sapace_01.bottom);
expect(Column_Sapace_011.bottom - Column_Sapace_011.top).assertEqual(vp2px(50));
expect(Column_Sapace_012.bottom - Column_Sapace_012.top).assertEqual(vp2px(100));
expect(Column_Sapace_013.bottom - Column_Sapace_013.top).assertEqual(vp2px(150));
expect(Column_Sapace_011.right - Column_Sapace_011.left).assertEqual(vp2px(300));
expect(Column_Sapace_012.right - Column_Sapace_012.left).assertEqual(vp2px(300));
expect(Column_Sapace_013.right - Column_Sapace_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 aceColumnSpaceTest
*/
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_Sapace_011 = CommonFunc.getComponentRect('Column_Sapace_011');
let Column_Sapace_012 = CommonFunc.getComponentRect('Column_Sapace_012');
let Column_Sapace_013 = CommonFunc.getComponentRect('Column_Sapace_013');
let Column_Sapace_01 = CommonFunc.getComponentRect('Column_Sapace_01');
expect(Column_Sapace_011.left - Column_Sapace_01.left).assertEqual(Column_Sapace_01.right - Column_Sapace_011.right);
expect(Column_Sapace_012.left - Column_Sapace_01.left).assertEqual(Column_Sapace_01.right - Column_Sapace_012.right);
expect(Column_Sapace_013.left - Column_Sapace_01.left).assertEqual(Column_Sapace_01.right - Column_Sapace_013.right);
expect(Column_Sapace_012.top - Column_Sapace_011.bottom).assertEqual(Column_Sapace_013.top - Column_Sapace_012.bottom);
expect(Column_Sapace_012.top - Column_Sapace_011.bottom).assertEqual(vp2px(70));
expect(Column_Sapace_01.top).assertEqual(Column_Sapace_011.top);
expect(Column_Sapace_013.bottom).assertLarger(Column_Sapace_01.bottom);
expect(Column_Sapace_011.bottom - Column_Sapace_011.top).assertEqual(vp2px(50));
expect(Column_Sapace_012.bottom - Column_Sapace_012.top).assertEqual(vp2px(100));
expect(Column_Sapace_013.bottom - Column_Sapace_013.top).assertEqual(vp2px(150));
expect(Column_Sapace_011.right - Column_Sapace_011.left).assertEqual(vp2px(300));
expect(Column_Sapace_012.right - Column_Sapace_012.left).assertEqual(vp2px(300));
expect(Column_Sapace_013.right - Column_Sapace_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
浏览文件 @
f6050292
/**
* 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 aceRowSpaceTest
*/
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_Sapace_011 = CommonFunc.getComponentRect('Row_Sapace_011');
let Row_Sapace_012 = CommonFunc.getComponentRect('Row_Sapace_012');
let Row_Sapace_013 = CommonFunc.getComponentRect('Row_Sapace_013');
let Row_Sapace_01 = CommonFunc.getComponentRect('Row_Sapace_01');
expect(Row_Sapace_011.top - Row_Sapace_01.top).assertEqual(Row_Sapace_01.bottom - Row_Sapace_011.bottom);
expect(Row_Sapace_012.top - Row_Sapace_01.top).assertEqual(Row_Sapace_01.bottom - Row_Sapace_012.bottom);
expect(Row_Sapace_013.top - Row_Sapace_01.top).assertEqual(Row_Sapace_01.bottom - Row_Sapace_013.bottom);
expect(Row_Sapace_012.left - Row_Sapace_011.right).assertEqual(Row_Sapace_013.left - Row_Sapace_012.right);
expect(Row_Sapace_012.left - Row_Sapace_011.right).assertEqual(vp2px(10))
expect(Row_Sapace_01.left).assertEqual(Row_Sapace_011.left);
expect(Row_Sapace_013.right).assertLess(Row_Sapace_01.right);
expect(Row_Sapace_011.bottom - Row_Sapace_011.top).assertEqual(vp2px(50));
expect(Row_Sapace_012.bottom - Row_Sapace_012.top).assertEqual(vp2px(100));
expect(Row_Sapace_013.bottom - Row_Sapace_013.top).assertEqual(vp2px(150));
expect(Row_Sapace_011.right - Row_Sapace_011.left).assertEqual(vp2px(100));
expect(Row_Sapace_012.right - Row_Sapace_012.left).assertEqual(vp2px(100));
expect(Row_Sapace_013.right - Row_Sapace_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 aceRowSpaceTest
*/
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_Sapace_011 = CommonFunc.getComponentRect('Row_Sapace_011');
let Row_Sapace_012 = CommonFunc.getComponentRect('Row_Sapace_012');
let Row_Sapace_013 = CommonFunc.getComponentRect('Row_Sapace_013');
let Row_Sapace_01 = CommonFunc.getComponentRect('Row_Sapace_01');
expect(Row_Sapace_011.top - Row_Sapace_01.top).assertEqual(Row_Sapace_01.bottom - Row_Sapace_011.bottom);
expect(Row_Sapace_012.top - Row_Sapace_01.top).assertEqual(Row_Sapace_01.bottom - Row_Sapace_012.bottom);
expect(Row_Sapace_013.top - Row_Sapace_01.top).assertEqual(Row_Sapace_01.bottom - Row_Sapace_013.bottom);
expect(Row_Sapace_012.left - Row_Sapace_011.right).assertEqual(Row_Sapace_013.left - Row_Sapace_012.right);
expect(Row_Sapace_012.left - Row_Sapace_011.right).assertEqual(vp2px(25));
expect(Row_Sapace_01.left).assertEqual(Row_Sapace_011.left);
expect(Row_Sapace_013.right).assertEqual(Row_Sapace_01.right);
expect(Row_Sapace_011.bottom - Row_Sapace_011.top).assertEqual(vp2px(50));
expect(Row_Sapace_012.bottom - Row_Sapace_012.top).assertEqual(vp2px(100));
expect(Row_Sapace_013.bottom - Row_Sapace_013.top).assertEqual(vp2px(150));
expect(Row_Sapace_011.right - Row_Sapace_011.left).assertEqual(vp2px(100));
expect(Row_Sapace_012.right - Row_Sapace_012.left).assertEqual(vp2px(100));
expect(Row_Sapace_013.right - Row_Sapace_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 aceRowSpaceTest
*/
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_Sapace_011 = CommonFunc.getComponentRect('Row_Sapace_011');
let Row_Sapace_012 = CommonFunc.getComponentRect('Row_Sapace_012');
let Row_Sapace_013 = CommonFunc.getComponentRect('Row_Sapace_013');
let Row_Sapace_01 = CommonFunc.getComponentRect('Row_Sapace_01');
expect(Row_Sapace_011.top - Row_Sapace_01.top).assertEqual(Row_Sapace_01.bottom - Row_Sapace_011.bottom);
expect(Row_Sapace_012.top - Row_Sapace_01.top).assertEqual(Row_Sapace_01.bottom - Row_Sapace_012.bottom);
expect(Row_Sapace_013.top - Row_Sapace_01.top).assertEqual(Row_Sapace_01.bottom - Row_Sapace_013.bottom);
expect(Row_Sapace_012.left - Row_Sapace_011.right).assertEqual(Row_Sapace_013.left - Row_Sapace_012.right);
expect(Row_Sapace_012.left - Row_Sapace_011.right).assertEqual(vp2px(30))
expect(Row_Sapace_01.left).assertEqual(Row_Sapace_011.left);
expect(Row_Sapace_013.right).assertLarger(Row_Sapace_01.right);
expect(Row_Sapace_011.bottom - Row_Sapace_011.top).assertEqual(vp2px(50));
expect(Row_Sapace_012.bottom - Row_Sapace_012.top).assertEqual(vp2px(100));
expect(Row_Sapace_013.bottom - Row_Sapace_013.top).assertEqual(vp2px(150));
expect(Row_Sapace_011.right - Row_Sapace_011.left).assertEqual(vp2px(100));
expect(Row_Sapace_012.right - Row_Sapace_012.left).assertEqual(vp2px(100));
expect(Row_Sapace_013.right - Row_Sapace_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.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录