Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
cb534b3a
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看板
提交
cb534b3a
编写于
3月 02, 2023
作者:
W
wmlih
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
test:add flex_alignContent_SpaceAround xts_acts testcase
Signed-off-by:
N
wmlih
<
wmlih@isoftstone.com
>
上级
780277de
变更
18
隐藏空白更改
内联
并排
Showing
18 changed file
with
1418 addition
and
1 deletion
+1418
-1
arkui/ace_ets_layout_test/entry/src/main/ets/MainAbility/pages/Flex/alignContent/SpaceAround/Flex_AlignContent_SpaceAround_FlexMar.ets
...ent/SpaceAround/Flex_AlignContent_SpaceAround_FlexMar.ets
+53
-0
arkui/ace_ets_layout_test/entry/src/main/ets/MainAbility/pages/Flex/alignContent/SpaceAround/Flex_AlignContent_SpaceAround_FlexMarPad.ets
.../SpaceAround/Flex_AlignContent_SpaceAround_FlexMarPad.ets
+57
-0
arkui/ace_ets_layout_test/entry/src/main/ets/MainAbility/pages/Flex/alignContent/SpaceAround/Flex_AlignContent_SpaceAround_FlexPad.ets
...ent/SpaceAround/Flex_AlignContent_SpaceAround_FlexPad.ets
+52
-0
arkui/ace_ets_layout_test/entry/src/main/ets/MainAbility/pages/Flex/alignContent/SpaceAround/Flex_AlignContent_SpaceAround_FlexSize.ets
...nt/SpaceAround/Flex_AlignContent_SpaceAround_FlexSize.ets
+55
-0
arkui/ace_ets_layout_test/entry/src/main/ets/MainAbility/pages/Flex/alignContent/SpaceAround/Flex_AlignContent_SpaceAround_TextMar.ets
...ent/SpaceAround/Flex_AlignContent_SpaceAround_TextMar.ets
+56
-0
arkui/ace_ets_layout_test/entry/src/main/ets/MainAbility/pages/Flex/alignContent/SpaceAround/Flex_AlignContent_SpaceAround_TextOffset.ets
.../SpaceAround/Flex_AlignContent_SpaceAround_TextOffset.ets
+56
-0
arkui/ace_ets_layout_test/entry/src/main/ets/MainAbility/pages/Flex/alignContent/SpaceAround/Flex_AlignContent_SpaceAround_TextSize.ets
...nt/SpaceAround/Flex_AlignContent_SpaceAround_TextSize.ets
+55
-0
arkui/ace_ets_layout_test/entry/src/main/ets/MainAbility/pages/Flex/alignContent/SpaceAround/Flex_AlignContent_SpaceAround_TextVisibility.ets
...ceAround/Flex_AlignContent_SpaceAround_TextVisibility.ets
+56
-0
arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/alignContent/SpaceAround/Flex_AlignContent_SpaceAround_FlexMar.test.ets
...paceAround/Flex_AlignContent_SpaceAround_FlexMar.test.ets
+88
-0
arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/alignContent/SpaceAround/Flex_AlignContent_SpaceAround_FlexMarPad.test.ets
...eAround/Flex_AlignContent_SpaceAround_FlexMarPad.test.ets
+129
-0
arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/alignContent/SpaceAround/Flex_AlignContent_SpaceAround_FlexPad.test.ets
...paceAround/Flex_AlignContent_SpaceAround_FlexPad.test.ets
+122
-0
arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/alignContent/SpaceAround/Flex_AlignContent_SpaceAround_FlexSize.test.ets
...aceAround/Flex_AlignContent_SpaceAround_FlexSize.test.ets
+126
-0
arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/alignContent/SpaceAround/Flex_AlignContent_SpaceAround_TextMar.test.ets
...paceAround/Flex_AlignContent_SpaceAround_TextMar.test.ets
+121
-0
arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/alignContent/SpaceAround/Flex_AlignContent_SpaceAround_TextOffset.test.ets
...eAround/Flex_AlignContent_SpaceAround_TextOffset.test.ets
+93
-0
arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/alignContent/SpaceAround/Flex_AlignContent_SpaceAround_TextSize.test.ets
...aceAround/Flex_AlignContent_SpaceAround_TextSize.test.ets
+126
-0
arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/alignContent/SpaceAround/Flex_AlignContent_SpaceAround_TextVisibility.test.ets
...und/Flex_AlignContent_SpaceAround_TextVisibility.test.ets
+124
-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
+32
-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
+17
-1
未找到文件。
arkui/ace_ets_layout_test/entry/src/main/ets/MainAbility/pages/Flex/alignContent/SpaceAround/Flex_AlignContent_SpaceAround_FlexMar.ets
0 → 100644
浏览文件 @
cb534b3a
/**
* 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 FlexAlignContent_SpaceAround_04{
@State testMargin: number = 0
messageManager:MessageManager = new MessageManager()
onPageShow() {
console.info('FlexAlignContent_SpaceAround_01 onPageShow');
globalThis.value = {
name:'messageManager',message:this.messageManager
}
let callback:Callback = (message:any) => {
console.error('message = ' + message.name + "--" + message.value);
if (message.name == 'margin') {
this.testMargin = message.value;
}
}
this.messageManager.registerCallback(callback);
}
build(){
Column({space:30}){
Flex({wrap:FlexWrap.Wrap, alignContent:FlexAlign.SpaceAround}){
Text('1').width(150).height(50).backgroundColor(0xD2B48C).key('AlignContent_SpaceAround_FlexMar01')
Text('2').width(150).height(100).backgroundColor(0xF5DEB3).key('AlignContent_SpaceAround_FlexMar02')
Text('3').width(150).height(50).backgroundColor(0xD2B48C).key('AlignContent_SpaceAround_FlexMar03')
Text('4').width(150).height(100).backgroundColor(0xF5DEB3).key('AlignContent_SpaceAround_FlexMar04')
}
.width(200)
.height(400)
.margin(this.testMargin)
.backgroundColor(0xAFEEEE)
.key('FlexAlign_SpaceAround_FlexMar_Container01')
}
.width('100%')
.height('100%')
.key('Column_Align_SpaceAround_FlexMar_Container01')
}
}
\ No newline at end of file
arkui/ace_ets_layout_test/entry/src/main/ets/MainAbility/pages/Flex/alignContent/SpaceAround/Flex_AlignContent_SpaceAround_FlexMarPad.ets
0 → 100644
浏览文件 @
cb534b3a
/**
* 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 FlexAlignContent_SpaceAround_03{
@State testPadding: number = 0;
@State testMargin: number = 0;
messageManager:MessageManager = new MessageManager();
onPageShow() {
console.info('FlexAlignContent_SpaceAround_01 onPageShow');
globalThis.value = {
name:'messageManager',message:this.messageManager
}
let callback:Callback = (message:any) => {
console.error('message = ' + message.name + "--" + message.value);
if (message.name == 'padding') {
this.testPadding = message.value;
}
if (message.name == 'margin') {
this.testMargin = message.value;
}
}
this.messageManager.registerCallback(callback);
}
build(){
Column({space:30}){
Flex({wrap:FlexWrap.Wrap, alignContent:FlexAlign.SpaceAround}){
Text('1').width(150).height(50).backgroundColor(0xD2B48C).key('AlignContent_SpaceAround_FlexMarPad01')
Text('2').width(150).height(100).backgroundColor(0xF5DEB3).key('AlignContent_SpaceAround_FlexMarPad02')
Text('3').width(150).height(150).backgroundColor(0xD2B48C).key('AlignContent_SpaceAround_FlexMarPad03')
Text('4').width(150).height(200).backgroundColor(0xF5DEB3).key('AlignContent_SpaceAround_FlexMarPad04')
}
.width(200)
.height(540)
.padding(this.testPadding)
.margin(this.testMargin)
.backgroundColor(0xAFEEEE)
.key('FlexAlign_SpaceAround_FlexMarPad_Container01')
}
.width('100%')
.height('100%')
.key('Column_Align_SpaceAround_FlexMarPad_Container01')
}
}
\ No newline at end of file
arkui/ace_ets_layout_test/entry/src/main/ets/MainAbility/pages/Flex/alignContent/SpaceAround/Flex_AlignContent_SpaceAround_FlexPad.ets
0 → 100644
浏览文件 @
cb534b3a
/**
* 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 FlexAlignContent_SpaceAround_02{
@State testPadding: number = 0
messageManager:MessageManager = new MessageManager()
onPageShow() {
console.info('FlexAlignContent_SpaceAround_02 onPageShow');
globalThis.value = {
name:'messageManager',message:this.messageManager
}
let callback:Callback = (message:any) => {
console.error('message = ' + message.name + "--" + message.value);
if (message.name == 'padding') {
this.testPadding = message.value;
}
}
this.messageManager.registerCallback(callback);
}
build(){
Column({space:30}){
Flex({wrap:FlexWrap.Wrap, alignContent:FlexAlign.SpaceAround}){
Text('1').width(150).height(50).backgroundColor(0xD2B48C).key('AlignContent_SpaceAround_FlexPad01')
Text('2').width(150).height(100).backgroundColor(0xF5DEB3).key('AlignContent_SpaceAround_FlexPad02')
Text('3').width(150).height(150).backgroundColor(0xD2B48C).key('AlignContent_SpaceAround_FlexPad03')
Text('4').width(150).height(200).backgroundColor(0xF5DEB3).key('AlignContent_SpaceAround_FlexPad04')
}
.width(200)
.height(540)
.padding(this.testPadding)
.backgroundColor(0xAFEEEE)
.key('FlexAlign_SpaceAround_FlexPad_Container01')
}
.width('100%')
.height('100%')
}
}
\ No newline at end of file
arkui/ace_ets_layout_test/entry/src/main/ets/MainAbility/pages/Flex/alignContent/SpaceAround/Flex_AlignContent_SpaceAround_FlexSize.ets
0 → 100644
浏览文件 @
cb534b3a
/**
* 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 FlexAlignContent_SpaceAround_01{
@State testWidth: number = 400
@State testHeight: number = 100
messageManager:MessageManager = new MessageManager()
onPageShow() {
console.info('FlexAlignContent_SpaceAround_01 onPageShow');
globalThis.value = {
name:'messageManager',message:this.messageManager
}
let callback:Callback = (message:any) => {
console.error('message = ' + message.name + "--" + message.value);
if (message.name == 'width') {
this.testWidth = message.value;
}
if (message.name == 'height') {
this.testHeight = message.value;
}
}
this.messageManager.registerCallback(callback);
}
build(){
Column({space:30}){
Flex({wrap:FlexWrap.Wrap, alignContent:FlexAlign.SpaceAround}){
Text('1').width(150).height(50).backgroundColor(0xD2B48C).key('AlignContent_SpaceAround_FlexSize01')
Text('2').width(150).height(100).backgroundColor(0xF5DEB3).key('AlignContent_SpaceAround_FlexSize02')
Text('3').width(150).height(50).backgroundColor(0xD2B48C).key('AlignContent_SpaceAround_FlexSize03')
Text('4').width(150).height(100).backgroundColor(0xF5DEB3).key('AlignContent_SpaceAround_FlexSize04')
}
.width(this.testWidth)
.height(this.testHeight)
.backgroundColor(0xAFEEEE)
.key('FlexAlign_SpaceAround_FlexSize_Container01')
}
.width('100%')
.height('100%')
}
}
\ No newline at end of file
arkui/ace_ets_layout_test/entry/src/main/ets/MainAbility/pages/Flex/alignContent/SpaceAround/Flex_AlignContent_SpaceAround_TextMar.ets
0 → 100644
浏览文件 @
cb534b3a
/**
* 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 FlexAlignContent_SpaceAround_04{
@State testMargin: number = 0
messageManager:MessageManager = new MessageManager()
onPageShow() {
console.info('FlexAlignContent_SpaceAround_01 onPageShow');
globalThis.value = {
name:'messageManager',message:this.messageManager
}
let callback:Callback = (message:any) => {
console.error('message = ' + message.name + "--" + message.value);
if (message.name == 'margin') {
this.testMargin = message.value;
}
}
this.messageManager.registerCallback(callback);
}
build(){
Column({space:30}){
Flex({wrap:FlexWrap.Wrap, alignContent:FlexAlign.SpaceAround}){
Text('1')
.width(150)
.height(50)
.backgroundColor(0xD2B48C)
.margin(this.testMargin)
.key('AlignContent_SpaceAround_TextMar01')
Text('2').width(150).height(100).backgroundColor(0xF5DEB3).key('AlignContent_SpaceAround_TextMar02')
Text('3').width(150).height(50).backgroundColor(0xD2B48C).key('AlignContent_SpaceAround_TextMar03')
Text('4').width(150).height(100).backgroundColor(0xF5DEB3).key('AlignContent_SpaceAround_TextMar04')
}
.width(200)
.height(400)
.backgroundColor(0xAFEEEE)
.key('FlexAlign_SpaceAround_TextMar_Container01')
}
.width('100%')
.height('100%')
}
}
\ No newline at end of file
arkui/ace_ets_layout_test/entry/src/main/ets/MainAbility/pages/Flex/alignContent/SpaceAround/Flex_AlignContent_SpaceAround_TextOffset.ets
0 → 100644
浏览文件 @
cb534b3a
/**
* 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 FlexAlignContent_SpaceAround_05{
@State testOffset: object = {x:0, y:0}
messageManager:MessageManager = new MessageManager()
onPageShow() {
console.info('FlexAlignContent_SpaceAround_01 onPageShow');
globalThis.value = {
name:'messageManager',message:this.messageManager
}
let callback:Callback = (message:any) => {
console.error('message = ' + message.name + "--" + message.value);
if (message.name == 'offset') {
this.testOffset = message.value;
}
}
this.messageManager.registerCallback(callback);
}
build(){
Column({space:30}){
Flex({wrap:FlexWrap.Wrap, alignContent:FlexAlign.SpaceAround}){
Text('1')
.width(150)
.height(50)
.backgroundColor(0xD2B48C)
.offset(this.testOffset)
.key('AlignContent_SpaceAround_TextOffset01')
Text('2').width(150).height(100).backgroundColor(0xF5DEB3).key('AlignContent_SpaceAround_TextOffset02')
Text('3').width(150).height(50).backgroundColor(0xD2B48C).key('AlignContent_SpaceAround_TextOffset03')
Text('4').width(150).height(100).backgroundColor(0xF5DEB3).key('AlignContent_SpaceAround_TextOffset04')
}
.width(200)
.height(400)
.backgroundColor(0xAFEEEE)
.key('FlexAlign_SpaceAround_TextOffset_Container01')
}
.width('100%')
.height('100%')
}
}
\ No newline at end of file
arkui/ace_ets_layout_test/entry/src/main/ets/MainAbility/pages/Flex/alignContent/SpaceAround/Flex_AlignContent_SpaceAround_TextSize.ets
0 → 100644
浏览文件 @
cb534b3a
/**
* 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 FlexAlignContent_SpaceAround_06{
@State testHeight: number = 50
messageManager:MessageManager = new MessageManager()
onPageShow() {
console.info('FlexAlignContent_SpaceAround_01 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;
}
}
this.messageManager.registerCallback(callback);
}
build(){
Column({space:30}){
Flex({wrap:FlexWrap.Wrap, alignContent:FlexAlign.SpaceAround}){
Text('1')
.width(150)
.height(this.testHeight)
.backgroundColor(0xD2B48C)
.key('AlignContent_SpaceAround_TextSize01')
Text('2').width(150).height(100).backgroundColor(0xF5DEB3).key('AlignContent_SpaceAround_TextSize02')
Text('3').width(150).height(50).backgroundColor(0xD2B48C).key('AlignContent_SpaceAround_TextSize03')
Text('4').width(150).height(100).backgroundColor(0xF5DEB3).key('AlignContent_SpaceAround_TextSize04')
}
.width(200)
.height(400)
.backgroundColor(0xAFEEEE)
.key('FlexAlign_SpaceAround_TextSize_Container01')
}
.width('100%')
.height('100%')
}
}
\ No newline at end of file
arkui/ace_ets_layout_test/entry/src/main/ets/MainAbility/pages/Flex/alignContent/SpaceAround/Flex_AlignContent_SpaceAround_TextVisibility.ets
0 → 100644
浏览文件 @
cb534b3a
/**
* 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 FlexAlignContent_SpaceAround_07{
@State testVisibility: number = Visibility.Visible
messageManager:MessageManager = new MessageManager()
onPageShow() {
console.info('FlexAlignContent_SpaceAround_01 onPageShow');
globalThis.value = {
name:'messageManager',message:this.messageManager
}
let callback:Callback = (message:any) => {
console.error('message = ' + message.name + "--" + message.value);
if (message.name == 'visibility') {
this.testVisibility = message.value;
}
}
this.messageManager.registerCallback(callback);
}
build(){
Column({space:30}){
Flex({wrap:FlexWrap.Wrap, alignContent:FlexAlign.SpaceAround}){
Text('1')
.width(150)
.height(50)
.backgroundColor(0xD2B48C)
.key('AlignContent_SpaceAround_TextVisibility01')
.visibility(this.testVisibility)
Text('2').width(150).height(100).backgroundColor(0xF5DEB3).key('AlignContent_SpaceAround_TextVisibility02')
Text('3').width(150).height(50).backgroundColor(0xD2B48C).key('AlignContent_SpaceAround_TextVisibility03')
Text('4').width(150).height(100).backgroundColor(0xF5DEB3).key('AlignContent_SpaceAround_TextVisibility04')
}
.width(200)
.height(400)
.backgroundColor(0xAFEEEE)
.key('FlexAlign_SpaceAround_TextVisibility_Container01')
}
.width('100%')
.height('100%')
}
}
\ No newline at end of file
arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/alignContent/SpaceAround/Flex_AlignContent_SpaceAround_FlexMar.test.ets
0 → 100644
浏览文件 @
cb534b3a
/**
* 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 flex_AlignContent_SpaceAround_FlexMarTest() {
describe('Flex_AlignContent_SpaceAround_FlexMarTest', function () {
beforeEach(async function (done) {
console.info("Flex_AlignContent_SpaceAround_FlexMar beforeEach start");
let options = {
url: 'MainAbility/pages/Flex/alignContent/SpaceAround/Flex_AlignContent_SpaceAround_FlexMar',
}
try {
router.clear();
let pages = router.getState();
console.info("get Flex_AlignContent_SpaceAround_FlexMar state pages:" + JSON.stringify(pages));
if (!("Flex_AlignContent_SpaceAround_FlexMar" == pages.name)) {
console.info("get Flex_AlignContent_SpaceAround_FlexMar state pages.name:" + JSON.stringify(pages.name));
let result = await router.push(options);
await CommonFunc.sleep(2000);
console.info("push Flex_AlignContent_SpaceAround_FlexMar page result:" + JSON.stringify(result));
}
} catch (err) {
console.error("push Flex_AlignContent_SpaceAround_FlexMar page error:" + err);
}
done();
});
afterEach(async function () {
await CommonFunc.sleep(1000);
console.info("Flex_AlignContent_SpaceAround_FlexMarTest after each called");
});
/**
* @tc.number SUB_ACE_FLEXALIGNCONTENT_SPACEAROUND_0100
* @tc.name alignContent_SpaceAround_FlexMargin
* @tc.desc The size of the parent component in the cross direction meets the layout
* of the child components when the height and width of parent component changed
*/
it('SUB_ACE_FLEXALIGNCONTENT_SPACEAROUND_0100', 0, async function (done) {
console.info('[SUB_ACE_FLEXALIGNCONTENT_SPACEAROUND_0100] START');
globalThis.value.message.notify({name:'margin', value:10})
await CommonFunc.sleep(3000);
let firstText = CommonFunc.getComponentRect('AlignContent_SpaceAround_FlexMar01');
let secondText = CommonFunc.getComponentRect('AlignContent_SpaceAround_FlexMar02');
let thirdText = CommonFunc.getComponentRect('AlignContent_SpaceAround_FlexMar03');
let fourthText = CommonFunc.getComponentRect('AlignContent_SpaceAround_FlexMar04');
let flexContainer = CommonFunc.getComponentRect('FlexAlign_SpaceAround_FlexMar_Container01');
let columnContainer = CommonFunc.getComponentRect('Column_Align_SpaceAround_FlexMar_Container01');
let flexContainerStrJson = getInspectorByKey('FlexAlign_SpaceAround_FlexMar_Container01');
let flexContainerObj = JSON.parse(flexContainerStrJson);
expect(flexContainerObj.$type).assertEqual('Flex');
expect(flexContainerObj.$attrs.constructor.wrap).assertEqual('FlexWrap.Wrap');
expect(flexContainerObj.$attrs.constructor.alignContent).assertEqual('FlexAlign.SpaceAround');
expect(firstText.bottom - firstText.top).assertEqual(vp2px(50));
expect(secondText.bottom - secondText.top).assertEqual(vp2px(100));
expect(thirdText.bottom - thirdText.top).assertEqual(vp2px(50));
expect(fourthText.bottom - fourthText.top).assertEqual(vp2px(100)); //四个子组件的高度分别为50、100、50、100
expect(flexContainer.top - columnContainer.top).assertEqual(vp2px(10)); //margin =10
expect(firstText.left).assertEqual(secondText.left);
expect(secondText.left).assertEqual(thirdText.left);
expect(thirdText.left).assertEqual(fourthText.left);
expect(fourthText.left).assertEqual(flexContainer.left);
expect(secondText.top - firstText.bottom).assertEqual(thirdText.top - secondText.bottom);
expect(thirdText.top - secondText.bottom).assertEqual(fourthText.top - thirdText.bottom); //行间距相等
expect(firstText.top - flexContainer.top).assertEqual(flexContainer.bottom - fourthText.bottom);
expect(firstText.top - flexContainer.top).assertEqual((secondText.top - firstText.bottom) / 2); //上下间距是组件间距的一半
console.info('[SUB_ACE_FLEXALIGNCONTENT_SPACEAROUND_0100] END');
done();
});
})
}
arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/alignContent/SpaceAround/Flex_AlignContent_SpaceAround_FlexMarPad.test.ets
0 → 100644
浏览文件 @
cb534b3a
/**
* 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 flex_AlignContent_SpaceAround_FlexMarPadTest() {
describe('Flex_AlignContent_SpaceAround_FlexMarPadTest', function () {
beforeEach(async function (done) {
console.info("Flex_AlignContent_SpaceAround_FlexMarPad beforeEach start");
let options = {
url: 'MainAbility/pages/Flex/alignContent/SpaceAround/Flex_AlignContent_SpaceAround_FlexMarPad',
}
try {
router.clear();
let pages = router.getState();
console.info("get Flex_AlignContent_SpaceAround_FlexMarPad state pages:" + JSON.stringify(pages));
if (!("Flex_AlignContent_SpaceAround_FlexMarPad" == pages.name)) {
console.info("get Flex_AlignContent_SpaceAround_FlexMarPad state pages.name:" + JSON.stringify(pages.name));
let result = await router.push(options);
await CommonFunc.sleep(2000);
console.info("push Flex_AlignContent_SpaceAround_FlexMarPad page result:" + JSON.stringify(result));
}
} catch (err) {
console.error("push Flex_AlignContent_SpaceAround_FlexMarPad page error:" + err);
}
done();
});
afterEach(async function () {
await CommonFunc.sleep(1000);
console.info("Flex_AlignContent_SpaceAround_FlexMarPadTest after each called");
});
/**
* @tc.number SUB_ACE_FLEXALIGNCONTENT_SPACEAROUND_0200
* @tc.name alignContent_SpaceAround_FlexMarPad
* @tc.desc The size of the parent component in the cross direction is not enough for the layout
* of the child components when the padding and margin of parent component was changed
*/
it('SUB_ACE_FLEXALIGNCONTENT_SPACEAROUND_0200', 0, async function (done) {
console.info('[SUB_ACE_FLEXALIGNCONTENT_SPACEAROUND_0200] START');
globalThis.value.message.notify({name:'padding', value:50});
globalThis.value.message.notify({name:'margin', value:20});
await CommonFunc.sleep(3000);
let firstText = CommonFunc.getComponentRect('AlignContent_SpaceAround_FlexMarPad01');
let secondText = CommonFunc.getComponentRect('AlignContent_SpaceAround_FlexMarPad02');
let thirdText = CommonFunc.getComponentRect('AlignContent_SpaceAround_FlexMarPad03');
let fourthText = CommonFunc.getComponentRect('AlignContent_SpaceAround_FlexMarPad04');
let flexContainer = CommonFunc.getComponentRect('FlexAlign_SpaceAround_FlexMarPad_Container01');
let columnContainer = CommonFunc.getComponentRect('Column_Align_SpaceAround_FlexMarPad_Container01');
let flexContainerStrJson = getInspectorByKey('FlexAlign_SpaceAround_FlexMarPad_Container01');
let flexContainerObj = JSON.parse(flexContainerStrJson);
expect(flexContainerObj.$type).assertEqual('Flex');
expect(flexContainerObj.$attrs.constructor.wrap).assertEqual('FlexWrap.Wrap');
expect(flexContainerObj.$attrs.constructor.alignContent).assertEqual('FlexAlign.SpaceAround');
expect(firstText.bottom - firstText.top).assertEqual(vp2px(50));
expect(secondText.bottom - secondText.top).assertEqual(vp2px(100));
expect(thirdText.bottom - thirdText.top).assertEqual(vp2px(150));
expect(fourthText.bottom - fourthText.top).assertEqual(vp2px(200)); //四个子组件的高度分别为50、100、150、200
expect(flexContainer.top - columnContainer.top).assertEqual(vp2px(20)); //margin =20
expect(firstText.top - flexContainer.top).assertEqual(vp2px(50));
expect(firstText.left - flexContainer.left).assertEqual(vp2px(50)); //padding =50
expect(firstText.left).assertEqual(secondText.left);
expect(secondText.left).assertEqual(thirdText.left);
expect(thirdText.left).assertEqual(fourthText.left);
expect(firstText.bottom).assertEqual(secondText.top);
expect(secondText.bottom).assertEqual(thirdText.top);
expect(thirdText.bottom).assertEqual(fourthText.top); //无行间距
expect(fourthText.bottom - flexContainer.bottom).assertEqual(vp2px(10)); //行首贴边行尾溢出
console.info('[SUB_ACE_FLEXALIGNCONTENT_SPACEAROUND_0200] END');
done();
});
/**
* @tc.number SUB_ACE_FLEXALIGNCONTENT_SPACEAROUND_0300
* @tc.name alignContent_SpaceAround_FlexMarPad
* @tc.desc The size of the parent component in the cross direction meets the layout
* of the child components when the padding and margin of parent component was changed
*/
it('SUB_ACE_FLEXALIGNCONTENT_SPACEAROUND_0300', 0, async function (done) {
console.info('[SUB_ACE_FLEXALIGNCONTENT_SPACEAROUND_0300] START');
globalThis.value.message.notify({name:'margin', value:30})
globalThis.value.message.notify({name:'padding', value:10})
await CommonFunc.sleep(3000);
let firstText = CommonFunc.getComponentRect('AlignContent_SpaceAround_FlexMarPad01');
let secondText = CommonFunc.getComponentRect('AlignContent_SpaceAround_FlexMarPad02');
let thirdText = CommonFunc.getComponentRect('AlignContent_SpaceAround_FlexMarPad03');
let fourthText = CommonFunc.getComponentRect('AlignContent_SpaceAround_FlexMarPad04');
let flexContainer = CommonFunc.getComponentRect('FlexAlign_SpaceAround_FlexMarPad_Container01');
let columnContainer = CommonFunc.getComponentRect('Column_Align_SpaceAround_FlexMarPad_Container01');
let flexContainerStrJson = getInspectorByKey('FlexAlign_SpaceAround_FlexMarPad_Container01');
let flexContainerObj = JSON.parse(flexContainerStrJson);
expect(flexContainerObj.$type).assertEqual('Flex');
expect(flexContainerObj.$attrs.constructor.wrap).assertEqual('FlexWrap.Wrap');
expect(flexContainerObj.$attrs.constructor.alignContent).assertEqual('FlexAlign.SpaceAround');
expect(firstText.bottom - firstText.top).assertEqual(vp2px(50));
expect(secondText.bottom - secondText.top).assertEqual(vp2px(100));
expect(thirdText.bottom - thirdText.top).assertEqual(vp2px(150));
expect(fourthText.bottom - fourthText.top).assertEqual(vp2px(200)); //四个子组件的高度分别为50、100、150、200
expect(firstText.left - flexContainer.left).assertEqual(vp2px(10)); //padding =10
expect(flexContainer.top - columnContainer.top).assertEqual(vp2px(30)); //margin =30
expect(firstText.left).assertEqual(secondText.left);
expect(secondText.left).assertEqual(thirdText.left);
expect(thirdText.left).assertEqual(fourthText.left);
expect(flexContainer.bottom - fourthText.bottom).assertEqual(firstText.top - flexContainer.top); //行首行尾间距相等
expect(secondText.top - firstText.bottom).assertEqual(thirdText.top - secondText.bottom);
expect(thirdText.top - secondText.bottom).assertEqual(fourthText.top - thirdText.bottom); //行间距相等
expect((thirdText.top - secondText.bottom) / 2).assertEqual(firstText.top - flexContainer.top - vp2px(10))
console.info('[SUB_ACE_FLEXALIGNCONTENT_SPACEAROUND_0300] END');
done();
});
})
}
arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/alignContent/SpaceAround/Flex_AlignContent_SpaceAround_FlexPad.test.ets
0 → 100644
浏览文件 @
cb534b3a
/**
* 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 flex_AlignContent_SpaceAround_FlexPadTest() {
describe('Flex_AlignContent_SpaceAround_FlexPadTest', function () {
beforeEach(async function (done) {
console.info("Flex_AlignContent_SpaceAround_FlexPad beforeEach start");
let options = {
url: 'MainAbility/pages/Flex/alignContent/SpaceAround/Flex_AlignContent_SpaceAround_FlexPad',
}
try {
router.clear();
let pages = router.getState();
console.info("get Flex_AlignContent_SpaceAround_FlexPad state pages:" + JSON.stringify(pages));
if (!("Flex_AlignContent_SpaceAround_FlexPad" == pages.name)) {
console.info("get Flex_AlignContent_SpaceAround_FlexPad state pages.name:" + JSON.stringify(pages.name));
let result = await router.push(options);
await CommonFunc.sleep(2000);
console.info("push Flex_AlignContent_SpaceAround_FlexPad page result:" + JSON.stringify(result));
}
} catch (err) {
console.error("push Flex_AlignContent_SpaceAround_FlexPad page error:" + err);
}
done();
});
afterEach(async function () {
await CommonFunc.sleep(1000);
console.info("Flex_AlignContent_SpaceAround_FlexPadTest after each called");
});
/**
* @tc.number SUB_ACE_FLEXALIGNCONTENT_SPACEAROUND_0400
* @tc.name alignContent_SpaceAround_FlexPad
* @tc.desc The size of the parent component in the cross direction is not enough for the layout
* of the child components when the padding and margin of parent component was changed
*/
it('SUB_ACE_FLEXALIGNCONTENT_SPACEAROUND_0400', 0, async function (done) {
console.info('[SUB_ACE_FLEXALIGNCONTENT_SPACEAROUND_0400] START');
globalThis.value.message.notify({name:'padding', value:50})
await CommonFunc.sleep(3000);
let firstText = CommonFunc.getComponentRect('AlignContent_SpaceAround_FlexPad01');
let secondText = CommonFunc.getComponentRect('AlignContent_SpaceAround_FlexPad02');
let thirdText = CommonFunc.getComponentRect('AlignContent_SpaceAround_FlexPad03');
let fourthText = CommonFunc.getComponentRect('AlignContent_SpaceAround_FlexPad04');
let flexContainer = CommonFunc.getComponentRect('FlexAlign_SpaceAround_FlexPad_Container01');
let flexContainerStrJson = getInspectorByKey('FlexAlign_SpaceAround_FlexPad_Container01');
let flexContainerObj = JSON.parse(flexContainerStrJson);
expect(flexContainerObj.$type).assertEqual('Flex');
expect(flexContainerObj.$attrs.constructor.wrap).assertEqual('FlexWrap.Wrap');
expect(flexContainerObj.$attrs.constructor.alignContent).assertEqual('FlexAlign.SpaceAround');
expect(firstText.bottom - firstText.top).assertEqual(vp2px(50));
expect(secondText.bottom - secondText.top).assertEqual(vp2px(100));
expect(thirdText.bottom - thirdText.top).assertEqual(vp2px(150));
expect(fourthText.bottom - fourthText.top).assertEqual(vp2px(200)); //四个子组件的高度分别为50、100、150、200
expect(firstText.left - flexContainer.left).assertEqual(vp2px(50)); //padding =50
expect(firstText.left).assertEqual(secondText.left);
expect(secondText.left).assertEqual(thirdText.left);
expect(thirdText.left).assertEqual(fourthText.left);
expect(firstText.bottom).assertEqual(secondText.top);
expect(secondText.bottom).assertEqual(thirdText.top);
expect(thirdText.bottom).assertEqual(fourthText.top); //无行间距
expect(fourthText.bottom - flexContainer.bottom).assertEqual(vp2px(10)); //行首贴边行尾溢出
console.info('[SUB_ACE_FLEXALIGNCONTENT_SPACEAROUND_0400] END');
done();
});
/**
* @tc.number SUB_ACE_FLEXALIGNCONTENT_SPACEAROUND_0500
* @tc.name alignContent_SpaceAround_FlexPad
* @tc.desc The size of the parent component in the cross direction meets the layout
* of the child components when the padding of parent component was changed
*/
it('SUB_ACE_FLEXALIGNCONTENT_SPACEAROUND_0500', 0, async function (done) {
console.info('[SUB_ACE_FLEXALIGNCONTENT_SPACEAROUND_0500] START');
globalThis.value.message.notify({name:'padding', value:10})
await CommonFunc.sleep(3000);
let firstText = CommonFunc.getComponentRect('AlignContent_SpaceAround_FlexPad01');
let secondText = CommonFunc.getComponentRect('AlignContent_SpaceAround_FlexPad02');
let thirdText = CommonFunc.getComponentRect('AlignContent_SpaceAround_FlexPad03');
let fourthText = CommonFunc.getComponentRect('AlignContent_SpaceAround_FlexPad04');
let flexContainer = CommonFunc.getComponentRect('FlexAlign_SpaceAround_FlexPad_Container01');
let flexContainerStrJson = getInspectorByKey('FlexAlign_SpaceAround_FlexPad_Container01');
let flexContainerObj = JSON.parse(flexContainerStrJson);
expect(flexContainerObj.$type).assertEqual('Flex');
expect(flexContainerObj.$attrs.constructor.wrap).assertEqual('FlexWrap.Wrap');
expect(flexContainerObj.$attrs.constructor.alignContent).assertEqual('FlexAlign.SpaceAround');
expect(firstText.bottom - firstText.top).assertEqual(vp2px(50));
expect(secondText.bottom - secondText.top).assertEqual(vp2px(100));
expect(thirdText.bottom - thirdText.top).assertEqual(vp2px(150));
expect(fourthText.bottom - fourthText.top).assertEqual(vp2px(200)); //四个子组件的高度分别为50、100、150、200
expect(firstText.left - flexContainer.left).assertEqual(vp2px(10)); //padding =10
expect(firstText.left).assertEqual(secondText.left);
expect(secondText.left).assertEqual(thirdText.left);
expect(thirdText.left).assertEqual(fourthText.left);
expect(flexContainer.bottom - fourthText.bottom).assertEqual(firstText.top - flexContainer.top); //行首行尾间距相等
expect(secondText.top - firstText.bottom).assertEqual(thirdText.top - secondText.bottom);
expect(thirdText.top - secondText.bottom).assertEqual(fourthText.top - thirdText.bottom); //行间距相等
expect((thirdText.top - secondText.bottom) / 2).assertEqual(firstText.top - flexContainer.top - vp2px(10));
console.info('[SUB_ACE_FLEXALIGNCONTENT_SPACEAROUND_0500] END');
done();
});
})
}
arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/alignContent/SpaceAround/Flex_AlignContent_SpaceAround_FlexSize.test.ets
0 → 100644
浏览文件 @
cb534b3a
/**
* 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 flex_AlignContent_SpaceAround_FlexSizeTest() {
describe('Flex_AlignContent_SpaceAround_FlexSizeTest', function () {
beforeEach(async function (done) {
console.info("Flex_AlignContent_SpaceAround_FlexSize beforeEach start");
let options = {
url: 'MainAbility/pages/Flex/alignContent/SpaceAround/Flex_AlignContent_SpaceAround_FlexSize',
}
try {
router.clear();
let pages = router.getState();
console.info("get Flex_AlignContent_SpaceAround_FlexSize state pages:" + JSON.stringify(pages));
if (!("Flex_AlignContent_SpaceAround_FlexSize" == pages.name)) {
console.info("get Flex_AlignContent_SpaceAround_FlexSize state pages.name:" + JSON.stringify(pages.name));
let result = await router.push(options);
await CommonFunc.sleep(2000);
console.info("push Flex_AlignContent_SpaceAround_FlexSize page result:" + JSON.stringify(result));
}
} catch (err) {
console.error("push Flex_AlignContent_SpaceAround_FlexSize page error:" + err);
}
done();
});
afterEach(async function () {
await CommonFunc.sleep(1000);
console.info("Flex_AlignContent_SpaceAround_FlexSizeTest after each called");
});
/**
* @tc.number SUB_ACE_FLEXALIGNCONTENT_SPACEAROUND_0600
* @tc.name alignContent_SpaceAround_FlexSize
* @tc.desc The size of the parent component in the cross direction meets the layout
* of the child components when the height and width of parent component changed
*/
it('SUB_ACE_FLEXALIGNCONTENT_SPACEAROUND_0600', 0, async function (done) {
console.info('[SUB_ACE_FLEXALIGNCONTENT_SPACEAROUND_0600] START');
globalThis.value.message.notify({name:'width', value:200})
globalThis.value.message.notify({name:'height', value:400})
await CommonFunc.sleep(3000);
let firstText = CommonFunc.getComponentRect('AlignContent_SpaceAround_FlexSize01');
let secondText = CommonFunc.getComponentRect('AlignContent_SpaceAround_FlexSize02');
let thirdText = CommonFunc.getComponentRect('AlignContent_SpaceAround_FlexSize03');
let fourthText = CommonFunc.getComponentRect('AlignContent_SpaceAround_FlexSize04');
let flexContainer = CommonFunc.getComponentRect('FlexAlign_SpaceAround_FlexSize_Container01');
let flexContainerStrJson = getInspectorByKey('FlexAlign_SpaceAround_FlexSize_Container01');
let flexContainerObj = JSON.parse(flexContainerStrJson);
expect(flexContainerObj.$type).assertEqual('Flex');
expect(flexContainerObj.$attrs.constructor.wrap).assertEqual('FlexWrap.Wrap');
expect(flexContainerObj.$attrs.constructor.alignContent).assertEqual('FlexAlign.SpaceAround');
expect(firstText.bottom - firstText.top).assertEqual(vp2px(50));
expect(secondText.bottom - secondText.top).assertEqual(vp2px(100));
expect(thirdText.bottom - thirdText.top).assertEqual(vp2px(50));
expect(fourthText.bottom - fourthText.top).assertEqual(vp2px(100)); //四个子组件的高度分别为50、100、50、100
expect(firstText.left).assertEqual(secondText.left);
expect(secondText.left).assertEqual(thirdText.left);
expect(thirdText.left).assertEqual(fourthText.left);
expect(fourthText.left).assertEqual(flexContainer.left);
expect(secondText.top - firstText.bottom).assertEqual(thirdText.top - secondText.bottom);
expect(thirdText.top - secondText.bottom).assertEqual(fourthText.top - thirdText.bottom); //行间距相等
expect(firstText.top - flexContainer.top).assertEqual(flexContainer.bottom - fourthText.bottom);
expect(firstText.top - flexContainer.top).assertEqual((secondText.top - firstText.bottom) / 2); //上下间距是组件间距的一半
console.info('[SUB_ACE_FLEXALIGNCONTENT_SPACEAROUND_0600] END');
done();
});
/**
* @tc.number SUB_ACE_FLEXALIGNCONTENT_SPACEAROUND_0700
* @tc.name alignContent_SpaceAround_FlexSize
* @tc.desc The size of the parent component in the cross direction is not enough for the layout
* of the child components when the height and width of parent component changed
*/
it('SUB_ACE_FLEXALIGNCONTENT_SPACEAROUND_0700', 0, async function (done) {
console.info('[SUB_ACE_FLEXALIGNCONTENT_SPACEAROUND_0700] START');
globalThis.value.message.notify({name:'width', value:200})
globalThis.value.message.notify({name:'height', value:250})
await CommonFunc.sleep(3000);
let firstText = CommonFunc.getComponentRect('AlignContent_SpaceAround_FlexSize01');
let secondText = CommonFunc.getComponentRect('AlignContent_SpaceAround_FlexSize02');
let thirdText = CommonFunc.getComponentRect('AlignContent_SpaceAround_FlexSize03');
let fourthText = CommonFunc.getComponentRect('AlignContent_SpaceAround_FlexSize04');
let flexContainer = CommonFunc.getComponentRect('FlexAlign_SpaceAround_FlexSize_Container01');
let flexContainerStrJson = getInspectorByKey('FlexAlign_SpaceAround_FlexSize_Container01');
let flexContainerObj = JSON.parse(flexContainerStrJson);
expect(flexContainerObj.$type).assertEqual('Flex');
expect(flexContainerObj.$attrs.constructor.wrap).assertEqual('FlexWrap.Wrap');
expect(flexContainerObj.$attrs.constructor.alignContent).assertEqual('FlexAlign.SpaceAround');
expect(firstText.bottom - firstText.top).assertEqual(vp2px(50));
expect(secondText.bottom - secondText.top).assertEqual(vp2px(100));
expect(thirdText.bottom - thirdText.top).assertEqual(vp2px(50));
expect(fourthText.bottom - fourthText.top).assertEqual(vp2px(100)); //四个子组件的高度分别为50、100、50、100
expect(firstText.bottom).assertEqual(secondText.top);
expect(secondText.bottom).assertEqual(thirdText.top);
expect(thirdText.bottom).assertEqual(fourthText.top); //无行间距
expect(firstText.left).assertEqual(secondText.left);
expect(secondText.left).assertEqual(thirdText.left);
expect(thirdText.left).assertEqual(fourthText.left);
expect(fourthText.left).assertEqual(flexContainer.left);
expect(firstText.top).assertEqual(flexContainer.top);
expect(fourthText.bottom - flexContainer.bottom).assertEqual(vp2px(50)); //行首贴边行尾溢出
console.info('[SUB_ACE_FLEXALIGNCONTENT_SPACEAROUND_0700] END');
done();
});
})
}
arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/alignContent/SpaceAround/Flex_AlignContent_SpaceAround_TextMar.test.ets
0 → 100644
浏览文件 @
cb534b3a
/**
* 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 flex_AlignContent_SpaceAround_TextMarTest() {
describe('Flex_AlignContent_SpaceAround_TextMarTest', function () {
beforeEach(async function (done) {
console.info("Flex_AlignContent_SpaceAround_TextMar beforeEach start");
let options = {
url: 'MainAbility/pages/Flex/alignContent/SpaceAround/Flex_AlignContent_SpaceAround_TextMar',
}
try {
router.clear();
let pages = router.getState();
console.info("get Flex_AlignContent_SpaceAround_TextMar state pages:" + JSON.stringify(pages));
if (!("Flex_AlignContent_SpaceAround_TextMar" == pages.name)) {
console.info("get Flex_AlignContent_SpaceAround_TextMar state pages.name:" + JSON.stringify(pages.name));
let result = await router.push(options);
await CommonFunc.sleep(2000);
console.info("push Flex_AlignContent_SpaceAround_TextMar page result:" + JSON.stringify(result));
}
} catch (err) {
console.error("push Flex_AlignContent_SpaceAround_TextMar page error:" + err);
}
done();
});
afterEach(async function () {
await CommonFunc.sleep(1000);
console.info("Flex_AlignContent_SpaceAround_TextMarTest after each called");
});
/**
* @tc.number SUB_ACE_FLEXALIGNCONTENT_SPACEAROUND_0800
* @tc.name alignContent_SpaceAround_TextMargin
* @tc.desc The size of the parent component in the cross direction is not enough for the layout
* of the child components when the padding and margin of parent component was changed
*/
it('SUB_ACE_FLEXALIGNCONTENT_SPACEAROUND_0800', 0, async function (done) {
console.info('[SUB_ACE_FLEXALIGNCONTENT_SPACEAROUND_0800] START');
globalThis.value.message.notify({name:'margin', value:65})
await CommonFunc.sleep(3000);
let firstText = CommonFunc.getComponentRect('AlignContent_SpaceAround_TextMar01');
let secondText = CommonFunc.getComponentRect('AlignContent_SpaceAround_TextMar02');
let thirdText = CommonFunc.getComponentRect('AlignContent_SpaceAround_TextMar03');
let fourthText = CommonFunc.getComponentRect('AlignContent_SpaceAround_TextMar04');
let flexContainer = CommonFunc.getComponentRect('FlexAlign_SpaceAround_TextMar_Container01');
let flexContainerStrJson = getInspectorByKey('FlexAlign_SpaceAround_TextMar_Container01');
let flexContainerObj = JSON.parse(flexContainerStrJson);
expect(flexContainerObj.$type).assertEqual('Flex');
expect(flexContainerObj.$attrs.constructor.wrap).assertEqual('FlexWrap.Wrap');
expect(flexContainerObj.$attrs.constructor.alignContent).assertEqual('FlexAlign.SpaceAround');
expect(firstText.bottom - firstText.top).assertEqual(vp2px(50));
expect(secondText.bottom - secondText.top).assertEqual(vp2px(100));
expect(thirdText.bottom - thirdText.top).assertEqual(vp2px(50));
expect(fourthText.bottom - fourthText.top).assertEqual(vp2px(100)); //四个子组件的高度分别为50、100、50、100
expect(firstText.left - flexContainer.left).assertEqual(vp2px(65)); //margin =65
expect(flexContainer.left).assertEqual(secondText.left);
expect(secondText.left).assertEqual(thirdText.left);
expect(thirdText.left).assertEqual(fourthText.left);
expect(secondText.top - firstText.bottom).assertEqual(vp2px(65));
expect(secondText.bottom).assertEqual(thirdText.top);
expect(thirdText.bottom).assertEqual(fourthText.top); //无行间距
expect(fourthText.bottom - flexContainer.bottom).assertEqual(vp2px(30)); //行首贴边行尾溢出
console.info('[SUB_ACE_FLEXALIGNCONTENT_SPACEAROUND_0800] END');
done();
});
/**
* @tc.number SUB_ACE_FLEXALIGNCONTENT_SPACEAROUND_0900
* @tc.name alignContent_SpaceAround_TextMargin
* @tc.desc The size of the parent component in the cross direction meets the layout
* of the child components when the padding of parent component was changed
*/
it('SUB_ACE_FLEXALIGNCONTENT_SPACEAROUND_0900', 0, async function (done) {
console.info('[SUB_ACE_FLEXALIGNCONTENT_SPACEAROUND_0900] START');
globalThis.value.message.notify({name:'margin', value:10})
await CommonFunc.sleep(3000);
let firstText = CommonFunc.getComponentRect('AlignContent_SpaceAround_TextMar01');
let secondText = CommonFunc.getComponentRect('AlignContent_SpaceAround_TextMar02');
let thirdText = CommonFunc.getComponentRect('AlignContent_SpaceAround_TextMar03');
let fourthText = CommonFunc.getComponentRect('AlignContent_SpaceAround_TextMar04');
let flexContainer = CommonFunc.getComponentRect('FlexAlign_SpaceAround_TextMar_Container01');
let flexContainerStrJson = getInspectorByKey('FlexAlign_SpaceAround_TextMar_Container01');
let flexContainerObj = JSON.parse(flexContainerStrJson);
expect(flexContainerObj.$type).assertEqual('Flex');
expect(flexContainerObj.$attrs.constructor.wrap).assertEqual('FlexWrap.Wrap');
expect(flexContainerObj.$attrs.constructor.alignContent).assertEqual('FlexAlign.SpaceAround');
expect(firstText.bottom - firstText.top).assertEqual(vp2px(50));
expect(secondText.bottom - secondText.top).assertEqual(vp2px(100));
expect(thirdText.bottom - thirdText.top).assertEqual(vp2px(50));
expect(fourthText.bottom - fourthText.top).assertEqual(vp2px(100)); //四个子组件的高度分别为50、100、50、100
expect(firstText.left - flexContainer.left).assertEqual(vp2px(10)); //margin =10
expect(secondText.left).assertEqual(thirdText.left);
expect(thirdText.left).assertEqual(fourthText.left);
expect(firstText.top - flexContainer.top - vp2px(10)).assertEqual(flexContainer.bottom - fourthText.bottom);
expect(secondText.top - firstText.bottom - vp2px(10)).assertEqual(thirdText.top - secondText.bottom);
expect(thirdText.top - secondText.bottom).assertEqual(fourthText.top - thirdText.bottom); //行间距相等
expect(flexContainer.bottom - fourthText.bottom).assertEqual((fourthText.top - thirdText.bottom) / 2); //行首行尾距离是组件间距的一半
console.info('[SUB_ACE_FLEXALIGNCONTENT_SPACEAROUND_0900] END');
done();
});
})
}
arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/alignContent/SpaceAround/Flex_AlignContent_SpaceAround_TextOffset.test.ets
0 → 100644
浏览文件 @
cb534b3a
/**
* 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 flex_AlignContent_SpaceAround_TextOffsetTest() {
describe('Flex_AlignContent_SpaceAround_TextOffsetTest', function () {
beforeEach(async function (done) {
console.info("Flex_AlignContent_SpaceAround_TextOffset beforeEach start");
let options = {
url: 'MainAbility/pages/Flex/alignContent/SpaceAround/Flex_AlignContent_SpaceAround_TextOffset',
}
try {
router.clear();
let pages = router.getState();
console.info("get Flex_AlignContent_SpaceAround_TextOffset state pages:" + JSON.stringify(pages));
if (!("Flex_AlignContent_SpaceAround_TextOffset" == pages.name)) {
console.info("get Flex_AlignContent_SpaceAround_TextOffset state pages.name:" + JSON.stringify(pages.name));
let result = await router.push(options);
await CommonFunc.sleep(2000);
console.info("push Flex_AlignContent_SpaceAround_TextOffset page result:" + JSON.stringify(result));
}
} catch (err) {
console.error("push Flex_AlignContent_SpaceAround_TextOffset page error:" + err);
}
done();
});
afterEach(async function () {
await CommonFunc.sleep(1000);
console.info("Flex_AlignContent_SpaceAround_TextOffsetTest after each called");
});
/**
* @tc.number SUB_ACE_FLEXALIGNCONTENT_SPACEAROUND_1000
* @tc.name alignContent_SpaceAround_TextOffset
* @tc.desc The size of the parent component in the cross direction is not enough for the layout
* of the child components when position of first child component was changed
*/
it('SUB_ACE_FLEXALIGNCONTENT_SPACEAROUND_1000', 0, async function (done) {
console.info('[SUB_ACE_FLEXALIGNCONTENT_SPACEAROUND_1000] START');
let firstText = CommonFunc.getComponentRect('AlignContent_SpaceAround_TextOffset01');
let secondText = CommonFunc.getComponentRect('AlignContent_SpaceAround_TextOffset02');
let distanceBefore = secondText.top - firstText.bottom;
let secondTextTop = secondText.top;
let firstTextTop = firstText.top;
let firstTextLeft = firstText.left;
globalThis.value.message.notify({name:'offset', value:{x:10, y:10}})
await CommonFunc.sleep(3000);
firstText = CommonFunc.getComponentRect('AlignContent_SpaceAround_TextOffset01');
secondText = CommonFunc.getComponentRect('AlignContent_SpaceAround_TextOffset02');
let thirdText = CommonFunc.getComponentRect('AlignContent_SpaceAround_TextOffset03');
let fourthText = CommonFunc.getComponentRect('AlignContent_SpaceAround_TextOffset04');
let flexContainer = CommonFunc.getComponentRect('FlexAlign_SpaceAround_TextOffset_Container01');
let flexContainerStrJson = getInspectorByKey('FlexAlign_SpaceAround_TextOffset_Container01');
let flexContainerObj = JSON.parse(flexContainerStrJson);
expect(flexContainerObj.$type).assertEqual('Flex');
expect(flexContainerObj.$attrs.constructor.wrap).assertEqual('FlexWrap.Wrap');
expect(flexContainerObj.$attrs.constructor.alignContent).assertEqual('FlexAlign.SpaceAround');
expect(firstText.bottom - firstText.top).assertEqual(vp2px(50));
expect(secondText.bottom - secondText.top).assertEqual(vp2px(100));
expect(thirdText.bottom - thirdText.top).assertEqual(vp2px(50));
expect(fourthText.bottom - fourthText.top).assertEqual(vp2px(100)); //四个子组件的高度分别为50、100、50、100
expect(firstText.top - firstTextTop).assertEqual(vp2px(10));
expect(firstText.left - firstTextLeft).assertEqual(vp2px(10)); //offset =10
expect(secondText.top).assertEqual(secondTextTop);
expect(flexContainer.left).assertEqual(secondText.left);
expect(secondText.left).assertEqual(thirdText.left);
expect(thirdText.left).assertEqual(fourthText.left);
expect(thirdText.top - secondText.bottom).assertEqual(fourthText.top - thirdText.bottom);
expect(thirdText.top - secondText.bottom).assertEqual(distanceBefore);
expect(flexContainer.bottom - fourthText.bottom).assertEqual(distanceBefore / 2); //其余组件行间距相等,未改变
console.info('[SUB_ACE_FLEXALIGNCONTENT_SPACEAROUND_1000] END');
done();
});
})
}
arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/alignContent/SpaceAround/Flex_AlignContent_SpaceAround_TextSize.test.ets
0 → 100644
浏览文件 @
cb534b3a
/**
* 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 flex_AlignContent_SpaceAround_TextSizeTest() {
describe('Flex_AlignContent_SpaceAround_TextSizeTest', function () {
beforeEach(async function (done) {
console.info("Flex_AlignContent_SpaceAround_TextSize beforeEach start");
let options = {
url: 'MainAbility/pages/Flex/alignContent/SpaceAround/Flex_AlignContent_SpaceAround_TextSize',
}
try {
router.clear();
let pages = router.getState();
console.info("get Flex_AlignContent_SpaceAround_TextSize state pages:" + JSON.stringify(pages));
if (!("Flex_AlignContent_SpaceAround_TextSize" == pages.name)) {
console.info("get Flex_AlignContent_SpaceAround_TextSize state pages.name:" + JSON.stringify(pages.name));
let result = await router.push(options);
await CommonFunc.sleep(2000);
console.info("push Flex_AlignContent_SpaceAround_TextSize page result:" + JSON.stringify(result));
}
} catch (err) {
console.error("push Flex_AlignContent_SpaceAround_TextSize page error:" + err);
}
done();
});
afterEach(async function () {
await CommonFunc.sleep(1000);
console.info("Flex_AlignContent_SpaceAround_TextSizeTest after each called");
});
/**
* @tc.number SUB_ACE_FLEXALIGNCONTENT_SPACEAROUND_1100
* @tc.name alignContent_SpaceAround_TextSize
* @tc.desc The size of the parent component in the cross direction meets the layout
* of the child components when the height and width of parent component changed
*/
it('SUB_ACE_FLEXALIGNCONTENT_SPACEAROUND_1100', 0, async function (done) {
console.info('[SUB_ACE_FLEXALIGNCONTENT_SPACEAROUND_1100] START');
globalThis.value.message.notify({name:'height', value:70})
await CommonFunc.sleep(3000);
let firstText = CommonFunc.getComponentRect('AlignContent_SpaceAround_TextSize01');
let secondText = CommonFunc.getComponentRect('AlignContent_SpaceAround_TextSize02');
let thirdText = CommonFunc.getComponentRect('AlignContent_SpaceAround_TextSize03');
let fourthText = CommonFunc.getComponentRect('AlignContent_SpaceAround_TextSize04');
let flexContainer = CommonFunc.getComponentRect('FlexAlign_SpaceAround_TextSize_Container01');
let flexContainerStrJson = getInspectorByKey('FlexAlign_SpaceAround_TextSize_Container01');
let flexContainerObj = JSON.parse(flexContainerStrJson);
expect(flexContainerObj.$type).assertEqual('Flex');
expect(flexContainerObj.$attrs.constructor.wrap).assertEqual('FlexWrap.Wrap');
expect(flexContainerObj.$attrs.constructor.alignContent).assertEqual('FlexAlign.SpaceAround');
expect(firstText.bottom - firstText.top).assertEqual(vp2px(70));
expect(secondText.bottom - secondText.top).assertEqual(vp2px(100));
expect(thirdText.bottom - thirdText.top).assertEqual(vp2px(50));
expect(fourthText.bottom - fourthText.top).assertEqual(vp2px(100)); //四个子组件的高度分别为70、100、50、100
expect(firstText.left).assertEqual(secondText.left);
expect(secondText.left).assertEqual(thirdText.left);
expect(thirdText.left).assertEqual(fourthText.left);
expect(fourthText.left).assertEqual(flexContainer.left);
expect(secondText.top - firstText.bottom).assertEqual(thirdText.top - secondText.bottom);
expect(thirdText.top - secondText.bottom).assertEqual(fourthText.top - thirdText.bottom); //行间距相等
expect(firstText.top - flexContainer.top).assertEqual(flexContainer.bottom - fourthText.bottom);
expect(firstText.top - flexContainer.top).assertEqual((secondText.top - firstText.bottom) / 2);
console.info('[SUB_ACE_FLEXALIGNCONTENT_SPACEAROUND_1100] END');
done();
});
/**
* @tc.number SUB_ACE_FLEXALIGNCONTENT_SPACEAROUND_1200
* @tc.name alignContent_SpaceAround_TextSize
* @tc.desc The size of the parent component in the cross direction is not enough for the layout
* of the child components when the height and width of parent component changed
*/
it('SUB_ACE_FLEXALIGNCONTENT_SPACEAROUND_1200', 0, async function (done) {
console.info('[SUB_ACE_FLEXALIGNCONTENT_SPACEAROUND_1200] START');
globalThis.value.message.notify({name:'height', value:200})
await CommonFunc.sleep(3000);
let firstText = CommonFunc.getComponentRect('AlignContent_SpaceAround_TextSize01');
let secondText = CommonFunc.getComponentRect('AlignContent_SpaceAround_TextSize02');
let thirdText = CommonFunc.getComponentRect('AlignContent_SpaceAround_TextSize03');
let fourthText = CommonFunc.getComponentRect('AlignContent_SpaceAround_TextSize04');
let flexContainer = CommonFunc.getComponentRect('FlexAlign_SpaceAround_TextSize_Container01');
let flexContainerStrJson = getInspectorByKey('FlexAlign_SpaceAround_TextSize_Container01');
let flexContainerObj = JSON.parse(flexContainerStrJson);
expect(flexContainerObj.$type).assertEqual('Flex');
expect(flexContainerObj.$attrs.constructor.wrap).assertEqual('FlexWrap.Wrap');
expect(flexContainerObj.$attrs.constructor.alignContent).assertEqual('FlexAlign.SpaceAround');
expect(firstText.bottom - firstText.top).assertEqual(vp2px(200));
expect(secondText.bottom - secondText.top).assertEqual(vp2px(100));
expect(thirdText.bottom - thirdText.top).assertEqual(vp2px(50));
expect(fourthText.bottom - fourthText.top).assertEqual(vp2px(100)); //四个子组件的高度分别为200、100、50、100
expect(firstText.bottom).assertEqual(secondText.top);
expect(secondText.bottom).assertEqual(thirdText.top);
expect(thirdText.bottom).assertEqual(fourthText.top); //无行间距
expect(firstText.left).assertEqual(secondText.left);
expect(secondText.left).assertEqual(thirdText.left);
expect(thirdText.left).assertEqual(fourthText.left);
expect(fourthText.left).assertEqual(flexContainer.left); //子组件靠左
expect(firstText.top).assertEqual(flexContainer.top);
expect(fourthText.bottom - flexContainer.bottom).assertEqual(vp2px(50)); //行首贴边行尾溢出
console.info('[SUB_ACE_FLEXALIGNCONTENT_SPACEAROUND_1200] END');
done();
});
})
}
arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/alignContent/SpaceAround/Flex_AlignContent_SpaceAround_TextVisibility.test.ets
0 → 100644
浏览文件 @
cb534b3a
/**
* 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 flex_AlignContent_SpaceAround_TextVisibilityTest() {
describe('Flex_AlignContent_SpaceAround_TextVisibilityTest', function () {
beforeEach(async function (done) {
console.info("Flex_AlignContent_SpaceAround_TextVisibility beforeEach start");
let options = {
url: 'MainAbility/pages/Flex/alignContent/SpaceAround/Flex_AlignContent_SpaceAround_TextVisibility',
}
try {
router.clear();
let pages = router.getState();
console.info("get Flex_AlignContent_SpaceAround_TextVisibility state pages:" + JSON.stringify(pages));
if (!("Flex_AlignContent_SpaceAround_TextVisibility" == pages.name)) {
console.info("get Flex_AlignContent_SpaceAround_TextVisibility state pages.name:" + JSON.stringify(pages.name));
let result = await router.push(options);
await CommonFunc.sleep(2000);
console.info("push Flex_AlignContent_SpaceAround_TextVisibility page result:" + JSON.stringify(result));
}
} catch (err) {
console.error("push Flex_AlignContent_SpaceAround_TextVisibility page error:" + err);
}
done();
});
afterEach(async function () {
await CommonFunc.sleep(1000);
globalThis.value.message.notify({name:'visibility', value:Visibility.Visible});
console.info("Flex_AlignContent_SpaceAround_TextVisibilityTest after each called");
});
/**
* @tc.number SUB_ACE_FLEXALIGNCONTENT_SPACEAROUND_1300
* @tc.name alignContent_SpaceAround_TextVisibility
* @tc.desc The size of the parent component in the cross direction meets the layout
* of the child components when the visibility of parent component was changed
*/
it('SUB_ACE_FLEXALIGNCONTENT_SPACEAROUND_1300', 0, async function (done) {
console.info('[SUB_ACE_FLEXALIGNCONTENT_SPACEAROUND_1300] START');
let firstText = CommonFunc.getComponentRect('AlignContent_SpaceAround_TextVisibility01');
let secondText = CommonFunc.getComponentRect('AlignContent_SpaceAround_TextVisibility02');
let distanceBefore = secondText.top - firstText.bottom;
globalThis.value.message.notify({name:'visibility', value:Visibility.Hidden});
await CommonFunc.sleep(3000);
secondText = CommonFunc.getComponentRect('AlignContent_SpaceAround_TextVisibility02');
let thirdText = CommonFunc.getComponentRect('AlignContent_SpaceAround_TextVisibility03');
let fourthText = CommonFunc.getComponentRect('AlignContent_SpaceAround_TextVisibility04');
let flexContainer = CommonFunc.getComponentRect('FlexAlign_SpaceAround_TextVisibility_Container01');
let flexContainerStrJson = getInspectorByKey('FlexAlign_SpaceAround_TextVisibility_Container01');
let flexContainerObj = JSON.parse(flexContainerStrJson);
expect(flexContainerObj.$type).assertEqual('Flex');
expect(flexContainerObj.$attrs.constructor.wrap).assertEqual('FlexWrap.Wrap');
expect(flexContainerObj.$attrs.constructor.alignContent).assertEqual('FlexAlign.SpaceAround');
expect(secondText.bottom - secondText.top).assertEqual(vp2px(100));
expect(thirdText.bottom - thirdText.top).assertEqual(vp2px(50));
expect(fourthText.bottom - fourthText.top).assertEqual(vp2px(100)); //三个子组件的高度分别为100、50、100
expect(secondText.left).assertEqual(thirdText.left);
expect(thirdText.left).assertEqual(fourthText.left);
expect(fourthText.left).assertEqual(flexContainer.left);
expect(secondText.top - flexContainer.top).assertEqual(distanceBefore * 1.5 + vp2px(50)); //text1占位
expect(thirdText.top - secondText.bottom).assertEqual(fourthText.top - thirdText.bottom); //剩余子组件行间距相等
expect(thirdText.top - secondText.bottom).assertEqual(distanceBefore); //子组件距离不变
expect(flexContainer.bottom -fourthText.bottom).assertEqual(distanceBefore / 2); //行首距离为子组件距离一半
console.info('[SUB_ACE_FLEXALIGNCONTENT_SPACEAROUND_1300] END');
done();
});
/**
* @tc.number SUB_ACE_FLEXALIGNCONTENT_SPACEAROUND_1400
* @tc.name alignContent_SpaceAround_TextVisibility
* @tc.desc The size of the parent component in the cross direction meets the layout
* of the child components when the visibility of parent component was changed
*/
it('SUB_ACE_FLEXALIGNCONTENT_SPACEAROUND_1400', 0, async function (done) {
console.info('[SUB_ACE_FLEXALIGNCONTENT_SPACEAROUND_1400] START');
let firstText = CommonFunc.getComponentRect('AlignContent_SpaceAround_TextVisibility01');
let secondText = CommonFunc.getComponentRect('AlignContent_SpaceAround_TextVisibility02');
let distanceBefore = secondText.top - firstText.bottom;
globalThis.value.message.notify({name:'visibility', value:Visibility.None})
await CommonFunc.sleep(3000);
secondText = CommonFunc.getComponentRect('AlignContent_SpaceAround_TextVisibility02');
let thirdText = CommonFunc.getComponentRect('AlignContent_SpaceAround_TextVisibility03');
let fourthText = CommonFunc.getComponentRect('AlignContent_SpaceAround_TextVisibility04');
let flexContainer = CommonFunc.getComponentRect('FlexAlign_SpaceAround_TextVisibility_Container01');
let flexContainerStrJson = getInspectorByKey('FlexAlign_SpaceAround_TextVisibility_Container01');
let flexContainerObj = JSON.parse(flexContainerStrJson);
expect(flexContainerObj.$type).assertEqual('Flex');
expect(flexContainerObj.$attrs.constructor.wrap).assertEqual('FlexWrap.Wrap');
expect(flexContainerObj.$attrs.constructor.alignContent).assertEqual('FlexAlign.SpaceAround');
expect(secondText.bottom - secondText.top).assertEqual(vp2px(100));
expect(thirdText.bottom - thirdText.top).assertEqual(vp2px(50));
expect(fourthText.bottom - fourthText.top).assertEqual(vp2px(100)); //三个子组件的高度分别为100、50、100
expect(secondText.left).assertEqual(thirdText.left);
expect(thirdText.left).assertEqual(fourthText.left);
expect(fourthText.left).assertEqual(flexContainer.left);
expect(thirdText.top - secondText.bottom).assertEqual(fourthText.top - thirdText.bottom); //剩余子组件行间距相等
expect(thirdText.top - secondText.bottom).assertLarger(distanceBefore); //行距大于设置前
expect(secondText.top - flexContainer.top).assertEqual(flexContainer.bottom - fourthText.bottom); //text1不参与占位
expect(secondText.top - flexContainer.top).assertEqual((thirdText.top - secondText.bottom) / 2); //行首行尾间距为子组件间距一半
console.info('[SUB_ACE_FLEXALIGNCONTENT_SPACEAROUND_1400] END');
done();
});
})
}
arkui/ace_ets_layout_test/entry/src/main/ets/test/List.test.ets
浏览文件 @
cb534b3a
...
...
@@ -70,6 +70,22 @@
import AlignEnd_AddLayoutWeight from './Flex/justifyContent/End/AlignEnd_AddLayoutWeight.test.ets';
import AlignEnd_AddOneWidth from './Flex/justifyContent/End/AlignEnd_AddOneWidth.test.ets';
import AlignEnd_AddOneMargin from './Flex/justifyContent/End/AlignEnd_AddOneMargin.test.ets';
import flex_AlignContent_SpaceBetween_FlexSizeTest from './Flex/alignContent/SpaceBeTween/Flex_AlignContent_SpaceBetween_FlexSize.test';
import flex_AlignContent_SpaceBetween_FlexPadTest from './Flex/alignContent/SpaceBeTween/Flex_AlignContent_SpaceBetween_FlexPad.test';
import flex_AlignContent_SpaceBetween_FlexMarTest from './Flex/alignContent/SpaceBeTween/Flex_AlignContent_SpaceBetween_FlexMar.test';
import flex_AlignContent_SpaceBetween_FlexMarPadTest from './Flex/alignContent/SpaceBeTween/Flex_AlignContent_SpaceBetween_FlexMarPad.test';
import flex_AlignContent_SpaceBetween_TextSizeTest from './Flex/alignContent/SpaceBeTween/Flex_AlignContent_SpaceBetween_TextSize.test';
import flex_AlignContent_SpaceBetween_TextMarTest from './Flex/alignContent/SpaceBeTween/Flex_AlignContent_SpaceBetween_TextMar.test';
import flex_AlignContent_SpaceBetween_TextOffsetTest from './Flex/alignContent/SpaceBeTween/Flex_AlignContent_SpaceBetween_TextOffset.test';
import flex_AlignContent_SpaceBetween_TextVisibilityTest from './Flex/alignContent/SpaceBeTween/Flex_AlignContent_SpaceBetween_TextVisibility.test';
import flex_AlignContent_SpaceAround_FlexSizeTest from './Flex/alignContent/SpaceAround/Flex_AlignContent_SpaceAround_FlexSize.test';
import flex_AlignContent_SpaceAround_FlexPadTest from './Flex/alignContent/SpaceAround/Flex_AlignContent_SpaceAround_FlexPad.test';
import flex_AlignContent_SpaceAround_FlexMarTest from './Flex/alignContent/SpaceAround/Flex_AlignContent_SpaceAround_FlexMar.test';
import flex_AlignContent_SpaceAround_FlexMarPadTest from './Flex/alignContent/SpaceAround/Flex_AlignContent_SpaceAround_FlexMarPad.test';
import flex_AlignContent_SpaceAround_TextSizeTest from './Flex/alignContent/SpaceAround/Flex_AlignContent_SpaceAround_TextSize.test';
import flex_AlignContent_SpaceAround_TextMarTest from './Flex/alignContent/SpaceAround/Flex_AlignContent_SpaceAround_TextMar.test';
import flex_AlignContent_SpaceAround_TextOffsetTest from './Flex/alignContent/SpaceAround/Flex_AlignContent_SpaceAround_TextOffset.test';
import flex_AlignContent_SpaceAround_TextVisibilityTest from './Flex/alignContent/SpaceAround/Flex_AlignContent_SpaceAround_TextVisibility.test';
export default function testsuite() {
flexBase_AutoJsunit()
flexPadding_AutoJsunit()
...
...
@@ -129,4 +145,20 @@ export default function testsuite() {
AlignEnd_AddLayoutWeight()
AlignEnd_AddOneWidth()
AlignEnd_AddOneMargin()
flex_AlignContent_SpaceBetween_FlexSizeTest();
flex_AlignContent_SpaceBetween_FlexPadTest();
flex_AlignContent_SpaceBetween_FlexMarTest();
flex_AlignContent_SpaceBetween_FlexMarPadTest();
flex_AlignContent_SpaceBetween_TextSizeTest();
flex_AlignContent_SpaceBetween_TextMarTest();
flex_AlignContent_SpaceBetween_TextOffsetTest();
flex_AlignContent_SpaceBetween_TextVisibilityTest();
flex_AlignContent_SpaceAround_FlexSizeTest();
flex_AlignContent_SpaceAround_FlexPadTest();
flex_AlignContent_SpaceAround_FlexMarTest();
flex_AlignContent_SpaceAround_FlexMarPadTest();
flex_AlignContent_SpaceAround_TextSizeTest();
flex_AlignContent_SpaceAround_TextMarTest();
flex_AlignContent_SpaceAround_TextOffsetTest();
flex_AlignContent_SpaceAround_TextVisibilityTest();
}
\ No newline at end of file
arkui/ace_ets_layout_test/entry/src/main/resources/base/profile/main_pages.json
浏览文件 @
cb534b3a
...
...
@@ -58,6 +58,22 @@
"MainAbility/pages/Flex/justifyContent/End/AlignEnd_AddVisibility"
,
"MainAbility/pages/Flex/justifyContent/End/AlignEnd_AddLayoutWeight"
,
"MainAbility/pages/Flex/justifyContent/End/AlignEnd_AddOneWidth"
,
"MainAbility/pages/Flex/justifyContent/End/AlignEnd_AddOneMargin"
"MainAbility/pages/Flex/justifyContent/End/AlignEnd_AddOneMargin"
,
"MainAbility/pages/Flex/alignContent/SpaceBetween/Flex_AlignContent_SpaceBetween_FlexSize"
,
"MainAbility/pages/Flex/alignContent/SpaceBetween/Flex_AlignContent_SpaceBetween_FlexPad"
,
"MainAbility/pages/Flex/alignContent/SpaceBetween/Flex_AlignContent_SpaceBetween_FlexMar"
,
"MainAbility/pages/Flex/alignContent/SpaceBetween/Flex_AlignContent_SpaceBetween_FlexMarPad"
,
"MainAbility/pages/Flex/alignContent/SpaceBetween/Flex_AlignContent_SpaceBetween_TextSize"
,
"MainAbility/pages/Flex/alignContent/SpaceBetween/Flex_AlignContent_SpaceBetween_TextMar"
,
"MainAbility/pages/Flex/alignContent/SpaceBetween/Flex_AlignContent_SpaceBetween_TextOffset"
,
"MainAbility/pages/Flex/alignContent/SpaceBetween/Flex_AlignContent_SpaceBetween_TextVisibility"
,
"MainAbility/pages/Flex/alignContent/SpaceAround/Flex_AlignContent_SpaceAround_FlexSize"
,
"MainAbility/pages/Flex/alignContent/SpaceAround/Flex_AlignContent_SpaceAround_FlexPad"
,
"MainAbility/pages/Flex/alignContent/SpaceAround/Flex_AlignContent_SpaceAround_FlexMar"
,
"MainAbility/pages/Flex/alignContent/SpaceAround/Flex_AlignContent_SpaceAround_FlexMarPad"
,
"MainAbility/pages/Flex/alignContent/SpaceAround/Flex_AlignContent_SpaceAround_TextSize"
,
"MainAbility/pages/Flex/alignContent/SpaceAround/Flex_AlignContent_SpaceAround_TextMar"
,
"MainAbility/pages/Flex/alignContent/SpaceAround/Flex_AlignContent_SpaceAround_TextOffset"
,
"MainAbility/pages/Flex/alignContent/SpaceAround/Flex_AlignContent_SpaceAround_TextVisibility"
]
}
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录