Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
8175aaa3
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看板
未验证
提交
8175aaa3
编写于
4月 26, 2023
作者:
O
openharmony_ci
提交者:
Gitee
4月 26, 2023
浏览文件
操作
浏览文件
下载
差异文件
!7453 add justifyContent_SpaceAround xts_acts testcase & pages
Merge pull request !7453 from 王闻天/justifyContent_SpaceAround
上级
9bdce29e
c53f2e18
变更
20
显示空白变更内容
内联
并排
Showing
20 changed file
with
1771 addition
and
0 deletion
+1771
-0
arkui/ace_ets_layout_test/entry/src/main/ets/MainAbility/pages/Flex/justifyContent/SpaceAround/FlexAlign_SpaceAround_fixedChild.ets
...yContent/SpaceAround/FlexAlign_SpaceAround_fixedChild.ets
+60
-0
arkui/ace_ets_layout_test/entry/src/main/ets/MainAbility/pages/Flex/justifyContent/SpaceAround/FlexAlign_SpaceAround_fixedChildParentItemAlignEnd.ets
...nd/FlexAlign_SpaceAround_fixedChildParentItemAlignEnd.ets
+61
-0
arkui/ace_ets_layout_test/entry/src/main/ets/MainAbility/pages/Flex/justifyContent/SpaceAround/FlexAlign_SpaceAround_fixedChildParentMarPad.ets
...ceAround/FlexAlign_SpaceAround_fixedChildParentMarPad.ets
+62
-0
arkui/ace_ets_layout_test/entry/src/main/ets/MainAbility/pages/Flex/justifyContent/SpaceAround/FlexAlign_SpaceAround_fixedChildParentMargin.ets
...ceAround/FlexAlign_SpaceAround_fixedChildParentMargin.ets
+57
-0
arkui/ace_ets_layout_test/entry/src/main/ets/MainAbility/pages/Flex/justifyContent/SpaceAround/FlexAlign_SpaceAround_fixedChildParentPadding.ets
...eAround/FlexAlign_SpaceAround_fixedChildParentPadding.ets
+57
-0
arkui/ace_ets_layout_test/entry/src/main/ets/MainAbility/pages/Flex/justifyContent/SpaceAround/FlexAlign_SpaceAround_fixedParent.ets
...Content/SpaceAround/FlexAlign_SpaceAround_fixedParent.ets
+61
-0
arkui/ace_ets_layout_test/entry/src/main/ets/MainAbility/pages/Flex/justifyContent/SpaceAround/FlexAlign_SpaceAround_fixedParentChangeFirst.ets
...ceAround/FlexAlign_SpaceAround_fixedParentChangeFirst.ets
+67
-0
arkui/ace_ets_layout_test/entry/src/main/ets/MainAbility/pages/Flex/justifyContent/SpaceAround/FlexAlign_SpaceAround_fixedParentChangeFirstWidth.ets
...und/FlexAlign_SpaceAround_fixedParentChangeFirstWidth.ets
+56
-0
arkui/ace_ets_layout_test/entry/src/main/ets/MainAbility/pages/Flex/justifyContent/SpaceAround/FlexAlign_SpaceAround_fixedParentMarginFirst.ets
...ceAround/FlexAlign_SpaceAround_fixedParentMarginFirst.ets
+56
-0
arkui/ace_ets_layout_test/entry/src/main/ets/MainAbility/pages/Flex/justifyContent/SpaceAround/FlexAlign_SpaceAround_fixedParentVisibility.ets
...aceAround/FlexAlign_SpaceAround_fixedParentVisibility.ets
+56
-0
arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/SpaceAround/FlexAlign_SpaceAround_fixedChild.test.ets
...ent/SpaceAround/FlexAlign_SpaceAround_fixedChild.test.ets
+136
-0
arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/SpaceAround/FlexAlign_SpaceAround_fixedChildParentItemAlignEnd.test.ets
...exAlign_SpaceAround_fixedChildParentItemAlignEnd.test.ets
+94
-0
arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/SpaceAround/FlexAlign_SpaceAround_fixedChildParentMarPad.test.ets
...und/FlexAlign_SpaceAround_fixedChildParentMarPad.test.ets
+136
-0
arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/SpaceAround/FlexAlign_SpaceAround_fixedChildParentMargin.test.ets
...und/FlexAlign_SpaceAround_fixedChildParentMargin.test.ets
+93
-0
arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/SpaceAround/FlexAlign_SpaceAround_fixedChildParentPadding.test.ets
...nd/FlexAlign_SpaceAround_fixedChildParentPadding.test.ets
+135
-0
arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/SpaceAround/FlexAlign_SpaceAround_fixedParent.test.ets
...nt/SpaceAround/FlexAlign_SpaceAround_fixedParent.test.ets
+97
-0
arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/SpaceAround/FlexAlign_SpaceAround_fixedParentChangeFirst.test.ets
...und/FlexAlign_SpaceAround_fixedParentChangeFirst.test.ets
+128
-0
arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/SpaceAround/FlexAlign_SpaceAround_fixedParentChangeFirstWidth.test.ets
...lexAlign_SpaceAround_fixedParentChangeFirstWidth.test.ets
+92
-0
arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/SpaceAround/FlexAlign_SpaceAround_fixedParentMarginFirst.test.ets
...und/FlexAlign_SpaceAround_fixedParentMarginFirst.test.ets
+130
-0
arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/SpaceAround/FlexAlign_SpaceAround_fixedParentVisibility.test.ets
...ound/FlexAlign_SpaceAround_fixedParentVisibility.test.ets
+137
-0
未找到文件。
arkui/ace_ets_layout_test/entry/src/main/ets/MainAbility/pages/Flex/justifyContent/SpaceAround/FlexAlign_SpaceAround_fixedChild.ets
0 → 100644
浏览文件 @
8175aaa3
/**
* Copyright (c) 2023 iSoftStone Information Technology (Group) Co.,Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { MessageManager, Callback } from '../../../../common/MessageManager';
@Entry
@Component
struct FlexAlign_SpaceAround_fixedChild {
@State testHeight: number = 150
@State testWidth: number = 450
messageManager:MessageManager = new MessageManager()
private content: string = "FlexAlign_SpaceAround_fixedChild Page"
onPageShow() {
console.info('FlexAlign_SpaceAround_fixedChild page show called');
globalThis.value = {
name:'messageManager',message:this.messageManager
}
let callback:Callback = (message:any) => {
console.log('message = ' + message.name + "--" + message.value);
if (message.name == 'height') {
this.testHeight = message.value;
}
if (message.name == 'width') {
this.testWidth = message.value;
}
}
this.messageManager.registerCallback(callback);
}
onBuildDone() {
console.info('FlexAlign_SpaceAround_fixedChild page build done called');
}
build() {
Column() {
Text('justifyContent:Align_SpaceAround1').fontSize(9).fontColor(0xCCCCCC).width('90%')
Flex({ direction: FlexDirection.Row, wrap: FlexWrap.NoWrap, justifyContent: FlexAlign.SpaceAround }) {
Text('1').width(150).height(50).backgroundColor(0xF5DEB3).key('AlignSpaceAround1')
Text('2').width(150).height(100).backgroundColor(0xD2B48C).key('AlignSpaceAround2')
Text('3').width(150).height(150).backgroundColor(0xffa500).key('AlignSpaceAround3')
}
.key('FlexAlignSpaceAround1')
.height(this.testHeight)
.width(this.testWidth)
.backgroundColor(0xAFEEEE)
}.width('100%')
}
}
\ No newline at end of file
arkui/ace_ets_layout_test/entry/src/main/ets/MainAbility/pages/Flex/justifyContent/SpaceAround/FlexAlign_SpaceAround_fixedChildParentItemAlignEnd.ets
0 → 100644
浏览文件 @
8175aaa3
/**
* Copyright (c) 2023 iSoftStone Information Technology (Group) Co.,Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { MessageManager, Callback } from '../../../../common/MessageManager';
@Entry
@Component
struct FlexAlign_SpaceAround_fixedChildParentItemAlignEnd {
@State testHeight: number = 150
@State testWidth: number = 450
messageManager:MessageManager = new MessageManager()
private content: string = "FlexAlign_SpaceAround_fixedChildParentItemAlignEnd Page"
onPageShow() {
console.info('FlexAlign_SpaceAround_fixedChildParentItemAlignEnd page show called');
globalThis.value = {
name:'messageManager',message:this.messageManager
}
let callback:Callback = (message:any) => {
console.log('message = ' + message.name + "--" + message.value);
if (message.name == 'height') {
this.testHeight = message.value;
}
if (message.name == 'width') {
this.testWidth = message.value;
}
}
this.messageManager.registerCallback(callback);
}
onBuildDone() {
console.info('FlexAlign_SpaceAround_fixedChildParentItemAlignEnd page build done called');
}
build() {
Column() {
Text('justifyContent:Align_SpaceAround8').fontSize(9).fontColor(0xCCCCCC).width('90%')
Flex({ direction: FlexDirection.Row, wrap: FlexWrap.NoWrap, justifyContent: FlexAlign.SpaceAround }) {
Text('1').width(150).height(50).backgroundColor(0xF5DEB3).key('AlignSpaceAround22')
Text('2').width(150).height(100).backgroundColor(0xD2B48C).key('AlignSpaceAround23')
Text('3').width(150).height(150).backgroundColor(0xffa500).key('AlignSpaceAround24')
}
.key('FlexAlignSpaceAround8')
.height(this.testHeight)
.width(this.testWidth)
.align(Alignment.BottomEnd)
.backgroundColor(0xAFEEEE)
}.width('100%')
}
}
\ No newline at end of file
arkui/ace_ets_layout_test/entry/src/main/ets/MainAbility/pages/Flex/justifyContent/SpaceAround/FlexAlign_SpaceAround_fixedChildParentMarPad.ets
0 → 100644
浏览文件 @
8175aaa3
/**
* Copyright (c) 2023 iSoftStone Information Technology (Group) Co.,Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { MessageManager, Callback } from '../../../../common/MessageManager';
@Entry
@Component
struct FlexAlign_SpaceAround_fixedChildParentMarPad {
@State testPadding: number = 10
@State testMargin: number = 10
messageManager:MessageManager = new MessageManager()
private content: string = "FlexAlign_SpaceAround_fixedChildParentMarPad Page"
onPageShow() {
console.info('FlexAlign_SpaceAround_fixedChildParentMarPad page show called');
globalThis.value = {
name:'messageManager',message:this.messageManager
}
let callback:Callback = (message:any) => {
console.log('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);
}
onBuildDone() {
console.info('FlexAlign_SpaceAround_fixedChildParentMarPad page build done called');
}
build() {
Column() {
Text('justifyContent:Align_SpaceAround6').fontSize(9).fontColor(0xCCCCCC).width('90%')
Flex({ direction: FlexDirection.Row, wrap: FlexWrap.NoWrap, justifyContent: FlexAlign.SpaceAround }) {
Text('1').width(150).height(50).backgroundColor(0xF5DEB3).key('AlignSpaceAround16')
Text('2').width(150).height(100).backgroundColor(0xD2B48C).key('AlignSpaceAround17')
Text('3').width(150).height(150).backgroundColor(0xffa500).key('AlignSpaceAround18')
}
.key('FlexAlignSpaceAround6')
.height(200)
.width(500)
.margin(this.testMargin)
.padding(this.testPadding)
.backgroundColor(0xAFEEEE)
}.width('100%')
}
}
\ No newline at end of file
arkui/ace_ets_layout_test/entry/src/main/ets/MainAbility/pages/Flex/justifyContent/SpaceAround/FlexAlign_SpaceAround_fixedChildParentMargin.ets
0 → 100644
浏览文件 @
8175aaa3
/**
* Copyright (c) 2023 iSoftStone Information Technology (Group) Co.,Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { MessageManager, Callback } from '../../../../common/MessageManager';
@Entry
@Component
struct FlexAlign_SpaceAround_fixedChildParentMargin {
@State testMargin: number = 0
messageManager:MessageManager = new MessageManager()
private content: string = "FlexAlign_SpaceAround_fixedChildParentMargin Page"
onPageShow() {
console.info('FlexAlign_SpaceAround_fixedChildParentMargin page show called');
globalThis.value = {
name:'messageManager',message:this.messageManager
}
let callback:Callback = (message:any) => {
console.log('message = ' + message.name + "--" + message.value);
if (message.name == 'margin') {
this.testMargin = message.value;
}
}
this.messageManager.registerCallback(callback);
}
onBuildDone() {
console.info('FlexAlign_SpaceAround_fixedChildParentMargin page build done called');
}
build() {
Column() {
Text('justifyContent:Align_SpaceAround5').fontSize(9).fontColor(0xCCCCCC).width('90%')
Flex({ direction: FlexDirection.Row, wrap: FlexWrap.NoWrap, justifyContent: FlexAlign.SpaceAround }) {
Text('1').width(150).height(50).backgroundColor(0xF5DEB3).key('AlignSpaceAround13')
Text('2').width(150).height(100).backgroundColor(0xD2B48C).key('AlignSpaceAround14')
Text('3').width(150).height(150).backgroundColor(0xffa500).key('AlignSpaceAround15')
}
.key('FlexAlignSpaceAround5')
.height(200)
.width(500)
.margin(this.testMargin)
.backgroundColor(0xAFEEEE)
}.width('100%')
}
}
\ No newline at end of file
arkui/ace_ets_layout_test/entry/src/main/ets/MainAbility/pages/Flex/justifyContent/SpaceAround/FlexAlign_SpaceAround_fixedChildParentPadding.ets
0 → 100644
浏览文件 @
8175aaa3
/**
* Copyright (c) 2023 iSoftStone Information Technology (Group) Co.,Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { MessageManager, Callback } from '../../../../common/MessageManager';
@Entry
@Component
struct FlexAlign_SpaceAround_fixedChildParentPadding {
@State testPadding: number = 0
messageManager:MessageManager = new MessageManager()
private content: string = "FlexAlign_SpaceAround_fixedChildParentPadding Page"
onPageShow() {
console.info('FlexAlign_SpaceAround_fixedChildParentPadding page show called');
globalThis.value = {
name:'messageManager',message:this.messageManager
}
let callback:Callback = (message:any) => {
console.log('message = ' + message.name + "--" + message.value);
if (message.name == 'padding') {
this.testPadding = message.value;
}
}
this.messageManager.registerCallback(callback);
}
onBuildDone() {
console.info('FlexAlign_SpaceAround_fixedChildParentPadding page build done called');
}
build() {
Column() {
Text('justifyContent:Align_SpaceAround3').fontSize(9).fontColor(0xCCCCCC).width('90%')
Flex({ direction: FlexDirection.Row, wrap: FlexWrap.NoWrap, justifyContent: FlexAlign.SpaceAround }) {
Text('1').width(150).height(50).backgroundColor(0xF5DEB3).key('AlignSpaceAround7')
Text('2').width(150).height(100).backgroundColor(0xD2B48C).key('AlignSpaceAround8')
Text('3').width(150).height(150).backgroundColor(0xffa500).key('AlignSpaceAround9')
}
.key('FlexAlignSpaceAround3')
.height(200)
.width(500)
.padding(this.testPadding)
.backgroundColor(0xAFEEEE)
}.width('100%')
}
}
\ No newline at end of file
arkui/ace_ets_layout_test/entry/src/main/ets/MainAbility/pages/Flex/justifyContent/SpaceAround/FlexAlign_SpaceAround_fixedParent.ets
0 → 100644
浏览文件 @
8175aaa3
/**
* Copyright (c) 2023 iSoftStone Information Technology (Group) Co.,Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { MessageManager, Callback } from '../../../../common/MessageManager';
@Entry
@Component
struct FlexAlign_SpaceAround_fixedParent {
@State testOffsetX: number = 0
@State testOffsetY: number = 0
messageManager:MessageManager = new MessageManager()
private content: string = "FlexAlign_SpaceAround_fixedParent Page"
onPageShow() {
console.info('FlexAlign_SpaceAround_fixedParent page show called');
globalThis.value = {
name:'messageManager',message:this.messageManager
}
let callback:Callback = (message:any) => {
console.error('message = ' + message.name + "--" + message.value);
if (message.name == 'x') {
this.testOffsetX = message.value;
}
if (message.name == 'y') {
this.testOffsetY = message.value;
}
}
this.messageManager.registerCallback(callback);
}
onBuildDone() {
console.info('FlexAlign_SpaceAround_fixedParent page build done called');
}
build() {
Column() {
Text('justifyContent:Align_SpaceAround9').fontSize(9).fontColor(0xCCCCCC).width('90%')
Flex({ justifyContent: FlexAlign.SpaceAround }) {
Text('1').width(150).height(50).backgroundColor(0xF5DEB3).key('AlignSpaceAround25')
.offset({ x: this.testOffsetX, y: this.testOffsetY })
Text('2').width(150).height(100).backgroundColor(0xD2B48C).key('AlignSpaceAround26')
Text('3').width(150).height(150).backgroundColor(0xffa500).key('AlignSpaceAround27')
}
.key('FlexAlignSpaceAround9')
.height(200)
.width(500)
.backgroundColor(0xAFEEEE)
}.width('100%')
}
}
\ No newline at end of file
arkui/ace_ets_layout_test/entry/src/main/ets/MainAbility/pages/Flex/justifyContent/SpaceAround/FlexAlign_SpaceAround_fixedParentChangeFirst.ets
0 → 100644
浏览文件 @
8175aaa3
/**
* Copyright (c) 2023 iSoftStone Information Technology (Group) Co.,Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { MessageManager, Callback } from '../../../../common/MessageManager';
@Entry
@Component
struct FlexAlign_SpaceAround_fixedParentChangeFirst {
@State testFirstlayoutWeight: number = 0
@State testSecondlayoutWeight: number = 0
@State testThirdlayoutWeight: number = 0
messageManager:MessageManager = new MessageManager()
private content: string = "FlexAlign_SpaceAround_fixedParentChangeFirst Page"
onPageShow() {
console.info('FlexAlign_SpaceAround_fixedParentChangeFirst page show called');
globalThis.value = {
name:'messageManager',message:this.messageManager
}
let callback:Callback = (message:any) => {
console.log('message = ' + message.name + "--" + message.value);
if (message.name == 'testFirstlayoutWeight') {
this.testFirstlayoutWeight = message.value;
}
if (message.name == 'testSecondlayoutWeight') {
this.testSecondlayoutWeight = message.value;
}
if (message.name == 'testThirdlayoutWeight') {
this.testThirdlayoutWeight = message.value;
}
}
this.messageManager.registerCallback(callback);
}
onBuildDone() {
console.info('FlexAlign_SpaceAround_fixedParentChangeFirst page build done called');
}
build() {
Column() {
Text('justifyContent:Align_SpaceAround12').fontSize(9).fontColor(0xCCCCCC).width('90%')
Flex({ justifyContent: FlexAlign.SpaceAround }) {
Text('1').width(150).height(50).backgroundColor(0xF5DEB3).key('AlignSpaceAround34')
.layoutWeight(this.testFirstlayoutWeight)
Text('2').width(150).height(100).backgroundColor(0xD2B48C).key('AlignSpaceAround35')
.layoutWeight(this.testSecondlayoutWeight)
Text('3').width(150).height(150).backgroundColor(0xffa500).key('AlignSpaceAround36')
.layoutWeight(this.testThirdlayoutWeight)
}
.key('FlexAlignSpaceAround12')
.height(200)
.width(500)
.backgroundColor(0xAFEEEE)
}.width('100%')
}
}
\ No newline at end of file
arkui/ace_ets_layout_test/entry/src/main/ets/MainAbility/pages/Flex/justifyContent/SpaceAround/FlexAlign_SpaceAround_fixedParentChangeFirstWidth.ets
0 → 100644
浏览文件 @
8175aaa3
/**
* Copyright (c) 2023 iSoftStone Information Technology (Group) Co.,Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { MessageManager, Callback } from '../../../../common/MessageManager';
@Entry
@Component
struct FlexAlign_SpaceAround_fixedParentChangeFirstWidth {
@State testWidth: number = 150
messageManager:MessageManager = new MessageManager()
private content: string = "FlexAlign_SpaceAround_fixedParentChangeFirstWidth Page"
onPageShow() {
console.info('FlexAlign_SpaceAround_fixedParentChangeFirstWidth page show called');
globalThis.value = {
name:'messageManager',message:this.messageManager
}
let callback:Callback = (message:any) => {
console.log('message = ' + message.name + "--" + message.value);
if (message.name == 'width') {
this.testWidth = message.value;
}
}
this.messageManager.registerCallback(callback);
}
onBuildDone() {
console.info('FlexAlign_SpaceAround_fixedParentChangeFirstWidth page build done called');
}
build() {
Column() {
Text('justifyContent:Align_SpaceAround13').fontSize(9).fontColor(0xCCCCCC).width('90%')
Flex({ justifyContent: FlexAlign.SpaceAround }) {
Text('1').width(this.testWidth).height(50).backgroundColor(0xF5DEB3).key('AlignSpaceAround37')
Text('2').width(150).height(100).backgroundColor(0xD2B48C).key('AlignSpaceAround38')
Text('3').width(150).height(150).backgroundColor(0xffa500).key('AlignSpaceAround39')
}
.key('FlexAlignSpaceAround13')
.height(200)
.width(500)
.backgroundColor(0xAFEEEE)
}.width('100%')
}
}
\ No newline at end of file
arkui/ace_ets_layout_test/entry/src/main/ets/MainAbility/pages/Flex/justifyContent/SpaceAround/FlexAlign_SpaceAround_fixedParentMarginFirst.ets
0 → 100644
浏览文件 @
8175aaa3
/**
* Copyright (c) 2023 iSoftStone Information Technology (Group) Co.,Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { MessageManager, Callback } from '../../../../common/MessageManager';
@Entry
@Component
struct FlexAlign_SpaceAround_fixedParentMarginFirst {
@State testMargin: number = 0
messageManager:MessageManager = new MessageManager()
private content: string = "FlexAlign_SpaceAround_fixedParentMarginFirst Page"
onPageShow() {
console.info('FlexAlign_SpaceAround_fixedParentMarginFirst page show called');
globalThis.value = {
name:'messageManager',message:this.messageManager
}
let callback:Callback = (message:any) => {
console.log('message = ' + message.name + "--" + message.value);
if (message.name == 'margin') {
this.testMargin = message.value;
}
}
this.messageManager.registerCallback(callback);
}
onBuildDone() {
console.info('FlexAlign_SpaceAround_fixedParentMarginFirst page build done called');
}
build() {
Column() {
Text('justifyContent:Align_SpaceAround14').fontSize(9).fontColor(0xCCCCCC).width('90%')
Flex({ justifyContent: FlexAlign.SpaceAround }) {
Text('1').width(150).height(50).backgroundColor(0xF5DEB3).key('AlignSpaceAround40').margin(this.testMargin)
Text('2').width(150).height(100).backgroundColor(0xD2B48C).key('AlignSpaceAround41')
Text('3').width(150).height(150).backgroundColor(0xffa500).key('AlignSpaceAround42')
}
.key('FlexAlignSpaceAround14')
.height(200)
.width(500)
.backgroundColor(0xAFEEEE)
}.width('100%')
}
}
\ No newline at end of file
arkui/ace_ets_layout_test/entry/src/main/ets/MainAbility/pages/Flex/justifyContent/SpaceAround/FlexAlign_SpaceAround_fixedParentVisibility.ets
0 → 100644
浏览文件 @
8175aaa3
/**
* Copyright (c) 2023 iSoftStone Information Technology (Group) Co.,Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { MessageManager, Callback } from '../../../../common/MessageManager';
@Entry
@Component
struct FlexAlign_SpaceAround_fixedParentVisibility {
@State testVisibility: number = Visibility.Visible
messageManager:MessageManager = new MessageManager()
private content: string = "FlexAlign_SpaceAround_fixedParentVisibility Page"
onPageShow() {
console.info('FlexAlign_SpaceAround_fixedParentVisibility page show called');
globalThis.value = {
name:'messageManager',message:this.messageManager
}
let callback:Callback = (message:any) => {
console.log('message = ' + message.name + "--" + message.value);
if (message.name == 'visibility') {
this.testVisibility = message.value;
}
}
this.messageManager.registerCallback(callback);
}
onBuildDone() {
console.info('FlexAlign_SpaceAround_fixedParentVisibility page build done called');
}
build() {
Column() {
Text('justifyContent:Align_SpaceAround10').fontSize(9).fontColor(0xCCCCCC).width('90%')
Flex({ justifyContent: FlexAlign.SpaceAround }) {
Text('1').width(150).height(50).backgroundColor(0xF5DEB3).key('AlignSpaceAround28').visibility(this.testVisibility)
Text('2').width(150).height(100).backgroundColor(0xD2B48C).key('AlignSpaceAround29')
Text('3').width(150).height(150).backgroundColor(0xffa500).key('AlignSpaceAround30')
}
.key('FlexAlignSpaceAround10')
.height(200)
.width(500)
.backgroundColor(0xAFEEEE)
}.width('100%')
}
}
\ No newline at end of file
arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/SpaceAround/FlexAlign_SpaceAround_fixedChild.test.ets
0 → 100644
浏览文件 @
8175aaa3
/*
* Copyright (c) 2023 iSoftStone Information Technology (Group) Co.,Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from "@ohos/hypium";
import router from '@system.router';
import CommonFunc from '../../../../MainAbility/common/Common';
import { MessageManager, Callback } from '../../../../MainAbility/common/MessageManager';
export default function flexAlign_SpaceAround_fixedChild() {
describe('FlexAlign_SpaceAround_fixedChild', function () {
beforeEach(async function (done) {
console.info("FlexAlign_SpaceAround_fixedChild beforeEach called");
let options = {
uri: 'MainAbility/pages/Flex/justifyContent/SpaceAround/FlexAlign_SpaceAround_fixedChild',
}
try {
router.clear();
await CommonFunc.sleep(1000);
let pages = router.getState();
console.info("get FlexAlign_SpaceAround_fixedChild state pages:" + JSON.stringify(pages));
if (!("FlexAlign_SpaceAround_fixedChild" == pages.name)) {
console.info("get FlexAlign_SpaceAround_fixedChild state pages.name:" + JSON.stringify(pages.name));
let result = await router.push(options);
console.info("push FlexAlign_SpaceAround_fixedChild page result:" + JSON.stringify(result));
}
} catch (err) {
console.error("push FlexAlign_SpaceAround_fixedChild page error:" + JSON.stringify(err));
}
await CommonFunc.sleep(2000);
done()
});
afterEach(async function () {
await CommonFunc.sleep(1000);
console.info("FlexAlign_SpaceAround_fixedChild afterEach called");
});
/**
* @tc.number SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_SPACEAROUND_TEST_0100
* @tc.name testAlignSpaceAroundRowNoWrapOutRange
* @tc.desc The child component is fixed, and parent component is bound with width and height attributes,
* the layout space of parent is insufficient to meet the spindle layout requirements of child
*/
it('testAlignSpaceAroundRowNoWrapOutRange', 0, async function (done) {
console.info('new testAlignSpaceAroundRowNoWrapOutRange START');
globalThis.value.message.notify({name:'height', value:200})
globalThis.value.message.notify({name:'width', value:400})
await CommonFunc.sleep(3000);
let strJson = getInspectorByKey('FlexAlignSpaceAround1');
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('Flex');
expect(obj.$attrs.constructor.direction).assertEqual('FlexDirection.Row');
expect(obj.$attrs.constructor.wrap).assertEqual('FlexWrap.NoWrap');
expect(obj.$attrs.constructor.justifyContent).assertEqual('FlexAlign.SpaceAround');
let locationText1 = CommonFunc.getComponentRect('AlignSpaceAround1');
let locationText2 = CommonFunc.getComponentRect('AlignSpaceAround2');
let locationText3 = CommonFunc.getComponentRect('AlignSpaceAround3');
let locationFlex = CommonFunc.getComponentRect('FlexAlignSpaceAround1');
expect(locationText1.top).assertEqual(locationText2.top);
expect(locationText2.top).assertEqual(locationText3.top);
expect(locationText1.top).assertEqual(locationFlex.top);
expect(Math.round(locationText1.bottom - locationText1.top)).assertEqual(vp2px(50));
expect(Math.round(locationText2.bottom - locationText2.top)).assertEqual(vp2px(100));
expect(Math.round(locationText3.bottom - locationText3.top)).assertEqual(vp2px(150));
expect(Math.round(locationFlex.bottom - locationText3.bottom)).assertEqual(vp2px(50));
expect(locationText1.left).assertEqual(locationFlex.left);
expect(locationText1.right).assertEqual(locationText2.left);
expect(locationText2.right).assertEqual(locationText3.left);
expect(locationText3.right).assertEqual(locationFlex.right);
expect(Math.round(locationText1.right - locationText1.left))
.assertEqual(Math.round(locationText2.right - locationText2.left));
expect(Math.round(locationText3.right - locationText3.left))
.assertEqual(Math.round(locationText2.right - locationText2.left));
expect(Math.round(locationText2.right - locationText2.left)).assertEqual(Math.round(vp2px(400/3)));
console.info('new testAlignSpaceAroundRowNoWrapOutRange END');
done();
});
/**
* @tc.number SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_SPACEAROUND_TEST_0200
* @tc.name testAlignSpaceAroundRowNoWrapInRange
* @tc.desc The child component is fixed, and parent component is bound with width and height attributes,
* the layout space of parent meets the spindle layout requirements of child
*/
it('testAlignSpaceAroundRowNoWrapInRange', 0, async function (done) {
console.info('new testAlignSpaceAroundRowNoWrapInRange START');
globalThis.value.message.notify({name:'height', value:200})
globalThis.value.message.notify({name:'width', value:500})
await CommonFunc.sleep(3000);
let strJson = getInspectorByKey('FlexAlignSpaceAround1');
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('Flex');
expect(obj.$attrs.constructor.direction).assertEqual('FlexDirection.Row');
expect(obj.$attrs.constructor.wrap).assertEqual('FlexWrap.NoWrap');
expect(obj.$attrs.constructor.justifyContent).assertEqual('FlexAlign.SpaceAround');
let locationText1 = CommonFunc.getComponentRect('AlignSpaceAround1');
let locationText2 = CommonFunc.getComponentRect('AlignSpaceAround2');
let locationText3 = CommonFunc.getComponentRect('AlignSpaceAround3');
let locationFlex = CommonFunc.getComponentRect('FlexAlignSpaceAround1');
expect(locationText1.top).assertEqual(locationText2.top);
expect(locationText2.top).assertEqual(locationText3.top);
expect(locationText1.top).assertEqual(locationFlex.top);
expect(Math.round(locationText1.bottom - locationText1.top)).assertEqual(vp2px(50));
expect(Math.round(locationText2.bottom - locationText2.top)).assertEqual(vp2px(100));
expect(Math.round(locationText3.bottom - locationText3.top)).assertEqual(vp2px(150));
expect(Math.round(locationFlex.bottom - locationText3.bottom)).assertEqual(vp2px(50));
expect(Math.round(locationText1.right - locationText1.left))
.assertEqual(Math.round(locationText2.right - locationText2.left));
expect(Math.round(locationText3.right - locationText3.left))
.assertEqual(Math.round(locationText2.right - locationText2.left));
expect(Math.round(locationText2.right - locationText2.left)).assertEqual(vp2px(150));
expect(Math.round(locationText2.left - locationText1.right))
.assertEqual(Math.round(locationText3.left - locationText2.right));
expect(Math.round(locationText2.left - locationText1.right)).assertEqual(Math.round(vp2px(50/3)));
expect(Math.round(locationText1.left - locationFlex.left))
.assertEqual(Math.round(locationFlex.right - locationText3.right));
expect(Math.round((locationText1.left - locationFlex.left)*10)/10).assertEqual(Math.round(vp2px(25/3)*10)/10);
expect(Math.round(locationText2.left - locationText1.right))
.assertEqual(Math.round(2*(locationFlex.right - locationText3.right)));
console.info('new testAlignSpaceAroundRowNoWrapInRange END');
done();
});
})
}
\ No newline at end of file
arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/SpaceAround/FlexAlign_SpaceAround_fixedChildParentItemAlignEnd.test.ets
0 → 100644
浏览文件 @
8175aaa3
/*
* Copyright (c) 2023 iSoftStone Information Technology (Group) Co.,Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from "@ohos/hypium";
import router from '@system.router';
import CommonFunc from '../../../../MainAbility/common/Common';
import { MessageManager, Callback } from '../../../../MainAbility/common/MessageManager';
export default function flexAlign_SpaceAround_fixedChildParentItemAlignEnd() {
describe('FlexAlign_SpaceAround_fixedChildParentItemAlignEnd', function () {
beforeEach(async function (done) {
console.info("FlexAlign_SpaceAround_fixedChildParentItemAlignEnd beforeEach called");
let options = {
uri: 'MainAbility/pages/Flex/justifyContent/SpaceAround/FlexAlign_SpaceAround_fixedChildParentItemAlignEnd',
}
try {
router.clear();
await CommonFunc.sleep(1000);
let pages = router.getState();
console.info("get FlexAlign_SpaceAround_fixedChildParentItemAlignEnd state pages:" + JSON.stringify(pages));
if (!("FlexAlign_SpaceAround_fixedChildParentItemAlignEnd" == pages.name)) {
console.info("get FlexAlign_SpaceAround_fixedChildParentItemAlignEnd pages.name:" + JSON.stringify(pages.name));
let result = await router.push(options);
console.info("push FlexAlign_SpaceAround_fixedChildParentItemAlignEnd page result:" + JSON.stringify(result));
}
} catch (err) {
console.error("push FlexAlign_SpaceAround_fixedChildParentItemAlignEnd page error:" + JSON.stringify(err));
}
await CommonFunc.sleep(2000);
done()
});
afterEach(async function () {
await CommonFunc.sleep(1000);
console.info("FlexAlign_SpaceAround_fixedChildParentItemAlignEnd afterEach called");
});
/**
* @tc.number SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_SPACEAROUND_TEST_0800
* @tc.name testAlignSpaceAroundRowNoWrapAlignmentBottomEnd
* @tc.desc The child component is fixed, and the parent component is bound with Alignment.BottomEnd attributes
*/
it('testAlignSpaceAroundRowNoWrapAlignmentBottomEnd', 0, async function (done) {
console.info('new testAlignSpaceAroundRowNoWrapAlignmentBottomEnd START');
globalThis.value.message.notify({name:'height', value:200})
globalThis.value.message.notify({name:'width', value:500})
await CommonFunc.sleep(3000);
let strJson = getInspectorByKey('FlexAlignSpaceAround8');
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('Flex');
expect(obj.$attrs.constructor.direction).assertEqual('FlexDirection.Row');
expect(obj.$attrs.constructor.wrap).assertEqual('FlexWrap.NoWrap');
expect(obj.$attrs.constructor.justifyContent).assertEqual('FlexAlign.SpaceAround');
let locationText1 = CommonFunc.getComponentRect('AlignSpaceAround22');
let locationText2 = CommonFunc.getComponentRect('AlignSpaceAround23');
let locationText3 = CommonFunc.getComponentRect('AlignSpaceAround24');
let locationFlex = CommonFunc.getComponentRect('FlexAlignSpaceAround8');
expect(locationText1.top).assertEqual(locationText2.top);
expect(locationText2.top).assertEqual(locationText3.top);
expect(Math.round(locationText1.top - locationFlex.top)).assertEqual(vp2px(0));
expect(Math.round(locationText1.bottom - locationText1.top)).assertEqual(vp2px(50));
expect(Math.round(locationText2.bottom - locationText2.top)).assertEqual(vp2px(100));
expect(Math.round(locationText3.bottom - locationText3.top)).assertEqual(vp2px(150));
expect(Math.round(locationFlex.bottom - locationText3.bottom)).assertEqual(vp2px(50));
expect(Math.round(locationText1.right - locationText1.left))
.assertEqual(Math.round(locationText2.right - locationText2.left));
expect(Math.round(locationText3.right - locationText3.left))
.assertEqual(Math.round(locationText2.right - locationText2.left));
expect(Math.round(locationText2.right - locationText2.left)).assertEqual(vp2px(150));
expect(Math.round(locationText2.left - locationText1.right))
.assertEqual(Math.round(locationText3.left - locationText2.right));
expect(Math.round(locationText2.left - locationText1.right)).assertEqual(Math.round(vp2px(50/3)));
expect(Math.round(locationText1.left - locationFlex.left))
.assertEqual(Math.round(locationFlex.right - locationText3.right));
expect(Math.round((locationText1.left - locationFlex.left)*10)/10).assertEqual(Math.round(vp2px(25/3)*10)/10);
expect(Math.round(locationText2.left - locationText1.right))
.assertEqual(Math.round(2*(locationFlex.right - locationText3.right)));
console.info('new testAlignSpaceAroundRowNoWrapAlignmentBottomEnd END');
done();
});
})
}
\ No newline at end of file
arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/SpaceAround/FlexAlign_SpaceAround_fixedChildParentMarPad.test.ets
0 → 100644
浏览文件 @
8175aaa3
/*
* Copyright (c) 2023 iSoftStone Information Technology (Group) Co.,Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from "@ohos/hypium";
import router from '@system.router';
import CommonFunc from '../../../../MainAbility/common/Common';
import { MessageManager, Callback } from '../../../../MainAbility/common/MessageManager';
export default function flexAlign_SpaceAround_fixedChildParentMarPad() {
describe('FlexAlign_SpaceAround_fixedChildParentMarPad', function () {
beforeEach(async function (done) {
console.info("FlexAlign_SpaceAround_fixedChildParentMarPad beforeEach called");
let options = {
uri: 'MainAbility/pages/Flex/justifyContent/SpaceAround/FlexAlign_SpaceAround_fixedChildParentMarPad',
}
try {
router.clear();
await CommonFunc.sleep(1000);
let pages = router.getState();
console.info("get FlexAlign_SpaceAround_fixedChildParentMarPad state pages:" + JSON.stringify(pages));
if (!("FlexAlign_SpaceAround_fixedChildParentMarPad" == pages.name)) {
console.info("get FlexAlign_SpaceAround_fixedChildParentMarPad pages.name:" + JSON.stringify(pages.name));
let result = await router.push(options);
console.info("push FlexAlign_SpaceAround_fixedChildParentMarPad page result:" + JSON.stringify(result));
}
} catch (err) {
console.error("push FlexAlign_SpaceAround_fixedChildParentMarPad page error:" + JSON.stringify(err));
}
await CommonFunc.sleep(2000);
done()
});
afterEach(async function () {
await CommonFunc.sleep(1000);
console.info("FlexAlign_SpaceAround_fixedChildParentMarPad afterEach called");
});
/**
* @tc.number SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_SPACEAROUND_TEST_0600
* @tc.name testAlignSpaceAroundRowNoWrapMarPadOutRange
* @tc.desc The child component is fixed, and parent component is bound with padding and margin attributes,
* the layout space of parent is insufficient to meet the spindle layout requirements of child
*/
it('testAlignSpaceAroundRowNoWrapMarPadOutRange', 0, async function (done) {
console.info('new testAlignSpaceAroundRowNoWrapMarPadOutRange START');
globalThis.value.message.notify({name:'margin', value:20})
globalThis.value.message.notify({name:'padding', value:50})
await CommonFunc.sleep(3000);
let strJson = getInspectorByKey('FlexAlignSpaceAround6');
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('Flex');
expect(obj.$attrs.constructor.direction).assertEqual('FlexDirection.Row');
expect(obj.$attrs.constructor.wrap).assertEqual('FlexWrap.NoWrap');
expect(obj.$attrs.constructor.justifyContent).assertEqual('FlexAlign.SpaceAround');
let locationText1 = CommonFunc.getComponentRect('AlignSpaceAround16');
let locationText2 = CommonFunc.getComponentRect('AlignSpaceAround17');
let locationText3 = CommonFunc.getComponentRect('AlignSpaceAround18');
let locationFlex = CommonFunc.getComponentRect('FlexAlignSpaceAround6');
expect(locationText1.top).assertEqual(locationText2.top);
expect(locationText2.top).assertEqual(locationText3.top);
expect(Math.round(locationText1.top - locationFlex.top)).assertEqual(vp2px(50));
expect(Math.round(locationText1.bottom - locationText1.top)).assertEqual(vp2px(50));
expect(Math.round(locationText2.bottom - locationText2.top)).assertEqual(vp2px(100));
expect(Math.round(locationText3.bottom - locationText3.top)).assertEqual(vp2px(150));
expect(locationFlex.bottom).assertEqual(locationText3.bottom);
expect(Math.round(locationText1.left - locationFlex.left)).assertEqual(vp2px(50));
expect(locationText1.right).assertEqual(locationText2.left);
expect(locationText2.right).assertEqual(locationText3.left);
expect(locationText3.right).assertEqual(Math.round(locationFlex.right - vp2px(50)));
expect(Math.round(locationText1.right - locationText1.left))
.assertEqual(Math.round(locationText2.right - locationText2.left));
expect(Math.round(locationText3.right - locationText3.left))
.assertEqual(Math.round(locationText2.right - locationText2.left));
expect(Math.round(locationText2.right - locationText2.left)).assertEqual(Math.round(vp2px(400/3)));
console.info('new testAlignSpaceAroundRowNoWrapMarPadOutRange END');
done();
});
/**
* @tc.number SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_SPACEAROUND_TEST_0700
* @tc.name testAlignSpaceAroundRowNoWrapMarPadInRange
* @tc.desc The child component is fixed, and parent component is bound with padding and margin attributes,
* the layout space of parent component meets the spindle layout requirements of child component
*/
it('testAlignSpaceAroundRowNoWrapMarPadInRange', 0, async function (done) {
console.info('new testAlignSpaceAroundRowNoWrapMarPadInRange START');
globalThis.value.message.notify({name:'margin', value:20})
globalThis.value.message.notify({name:'padding', value:5})
await CommonFunc.sleep(3000);
let strJson = getInspectorByKey('FlexAlignSpaceAround6');
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('Flex');
expect(obj.$attrs.constructor.direction).assertEqual('FlexDirection.Row');
expect(obj.$attrs.constructor.wrap).assertEqual('FlexWrap.NoWrap');
expect(obj.$attrs.constructor.justifyContent).assertEqual('FlexAlign.SpaceAround');
let locationText1 = CommonFunc.getComponentRect('AlignSpaceAround16');
let locationText2 = CommonFunc.getComponentRect('AlignSpaceAround17');
let locationText3 = CommonFunc.getComponentRect('AlignSpaceAround18');
let locationFlex = CommonFunc.getComponentRect('FlexAlignSpaceAround6');
expect(locationText1.top).assertEqual(locationText2.top);
expect(locationText2.top).assertEqual(locationText3.top);
expect(Math.round((locationText1.top - locationFlex.top)*10)/10).assertEqual(Math.round(vp2px(5)*10)/10);
expect(Math.round(locationText1.bottom - locationText1.top)).assertEqual(vp2px(50));
expect(Math.round(locationText2.bottom - locationText2.top)).assertEqual(vp2px(100));
expect(Math.round(locationText3.bottom - locationText3.top)).assertEqual(vp2px(150));
expect(Math.round((locationFlex.bottom - locationText3.bottom)*10)/10).assertEqual(Math.round(vp2px(45)*10)/10);
expect(Math.round(locationText1.right - locationText1.left))
.assertEqual(Math.round(locationText2.right - locationText2.left));
expect(Math.round(locationText3.right - locationText3.left))
.assertEqual(Math.round(locationText2.right - locationText2.left));
expect(Math.round(locationText2.right - locationText2.left)).assertEqual(vp2px(150));
expect(Math.round(locationText2.left - locationText1.right))
.assertEqual(Math.round(locationText3.left - locationText2.right));
expect(Math.round(locationText2.left - locationText1.right)).assertEqual(Math.round(vp2px(40/3)));
expect(Math.round(locationText1.left - locationFlex.left))
.assertEqual(Math.round(locationFlex.right - locationText3.right));
expect(Math.round((locationText1.left - locationFlex.left)*10)/10).assertEqual(Math.round(vp2px(35/3)*10)/10);
expect(Math.round((locationText2.left - locationText1.right)*10)/10)
.assertEqual(Math.round(20*(locationFlex.right - locationText3.right - vp2px(5)))/10);
console.info('new testAlignSpaceAroundRowNoWrapMarPadInRange END');
done();
});
})
}
\ No newline at end of file
arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/SpaceAround/FlexAlign_SpaceAround_fixedChildParentMargin.test.ets
0 → 100644
浏览文件 @
8175aaa3
/*
* Copyright (c) 2023 iSoftStone Information Technology (Group) Co.,Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from "@ohos/hypium";
import router from '@system.router';
import CommonFunc from '../../../../MainAbility/common/Common';
import { MessageManager, Callback } from '../../../../MainAbility/common/MessageManager';
export default function flexAlign_SpaceAround_fixedChildParentMargin() {
describe('FlexAlign_SpaceAround_fixedChildParentMargin', function () {
beforeEach(async function (done) {
console.info("FlexAlign_SpaceAround_fixedChildParentMargin beforeEach called");
let options = {
uri: 'MainAbility/pages/Flex/justifyContent/SpaceAround/FlexAlign_SpaceAround_fixedChildParentMargin',
}
try {
router.clear();
await CommonFunc.sleep(1000);
let pages = router.getState();
console.info("get FlexAlign_SpaceAround_fixedChildParentMargin state pages:" + JSON.stringify(pages));
if (!("FlexAlign_SpaceAround_fixedChildParentMargin" == pages.name)) {
console.info("get FlexAlign_SpaceAround_fixedChildParentMargin pages.name:" + JSON.stringify(pages.name));
let result = await router.push(options);
console.info("push FlexAlign_SpaceAround_fixedChildParentMargin page result:" + JSON.stringify(result));
}
} catch (err) {
console.error("push FlexAlign_SpaceAround_fixedChildParentMargin page error:" + JSON.stringify(err));
}
await CommonFunc.sleep(2000);
done()
});
afterEach(async function () {
await CommonFunc.sleep(1000);
console.info("FlexAlign_SpaceAround_fixedChildParentMargin afterEach called");
});
/**
* @tc.number SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_SPACEAROUND_TEST_0500
* @tc.name testAlignSpaceAroundRowNoWrapMargin
* @tc.desc The child component is fixed, and the parent component is bound with margin attributes
*/
it('testAlignSpaceAroundRowNoWrapMargin', 0, async function (done) {
console.info('new testAlignSpaceAroundRowNoWrapMargin START');
globalThis.value.message.notify({name:'margin', value:20})
await CommonFunc.sleep(3000);
let strJson = getInspectorByKey('FlexAlignSpaceAround5');
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('Flex');
expect(obj.$attrs.constructor.direction).assertEqual('FlexDirection.Row');
expect(obj.$attrs.constructor.wrap).assertEqual('FlexWrap.NoWrap');
expect(obj.$attrs.constructor.justifyContent).assertEqual('FlexAlign.SpaceAround');
let locationText1 = CommonFunc.getComponentRect('AlignSpaceAround13');
let locationText2 = CommonFunc.getComponentRect('AlignSpaceAround14');
let locationText3 = CommonFunc.getComponentRect('AlignSpaceAround15');
let locationFlex = CommonFunc.getComponentRect('FlexAlignSpaceAround5');
expect(locationText1.top).assertEqual(locationText2.top);
expect(locationText2.top).assertEqual(locationText3.top);
expect(locationText1.top).assertEqual(locationFlex.top);
expect(Math.round(locationText1.bottom - locationText1.top)).assertEqual(vp2px(50));
expect(Math.round(locationText2.bottom - locationText2.top)).assertEqual(vp2px(100));
expect(Math.round(locationText3.bottom - locationText3.top)).assertEqual(vp2px(150));
expect(Math.round(locationFlex.bottom - locationText3.bottom)).assertEqual(vp2px(50));
expect(Math.round(locationText1.right - locationText1.left))
.assertEqual(Math.round(locationText2.right - locationText2.left));
expect(Math.round(locationText3.right - locationText3.left))
.assertEqual(Math.round(locationText2.right - locationText2.left));
expect(Math.round(locationText2.right - locationText2.left)).assertEqual(vp2px(150));
expect(Math.round(locationText2.left - locationText1.right))
.assertEqual(Math.round(locationText3.left - locationText2.right));
expect(Math.round(locationText2.left - locationText1.right)).assertEqual(Math.round(vp2px(50/3)));
expect(Math.round(locationText1.left - locationFlex.left))
.assertEqual(Math.round(locationFlex.right - locationText3.right));
expect(Math.round((locationText1.left - locationFlex.left)*10)/10).assertEqual(Math.round(vp2px(25/3)*10)/10);
expect(Math.round(locationText2.left - locationText1.right))
.assertEqual(Math.round(2*(locationFlex.right - locationText3.right)));
console.info('new testAlignSpaceAroundRowNoWrapMargin END');
done();
});
})
}
\ No newline at end of file
arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/SpaceAround/FlexAlign_SpaceAround_fixedChildParentPadding.test.ets
0 → 100644
浏览文件 @
8175aaa3
/*
* Copyright (c) 2023 iSoftStone Information Technology (Group) Co.,Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from "@ohos/hypium";
import router from '@system.router';
import CommonFunc from '../../../../MainAbility/common/Common';
import { MessageManager, Callback } from '../../../../MainAbility/common/MessageManager';
export default function flexAlign_SpaceAround_fixedChildParentPadding() {
describe('FlexAlign_SpaceAround_fixedChildParentPadding', function () {
beforeEach(async function (done) {
console.info("FlexAlign_SpaceAround_fixedChildParentPadding beforeEach called");
let options = {
uri: 'MainAbility/pages/Flex/justifyContent/SpaceAround/FlexAlign_SpaceAround_fixedChildParentPadding',
}
try {
router.clear();
await CommonFunc.sleep(1000);
let pages = router.getState();
console.info("get FlexAlign_SpaceAround_fixedChildParentPadding state pages:" + JSON.stringify(pages));
if (!("FlexAlign_SpaceAround_fixedChildParentPadding" == pages.name)) {
console.info("get FlexAlign_SpaceAround_fixedChildParentPadding pages.name:" + JSON.stringify(pages.name));
let result = await router.push(options);
console.info("push FlexAlign_SpaceAround_fixedChildParentPadding page result:" + JSON.stringify(result));
}
} catch (err) {
console.error("push FlexAlign_SpaceAround_fixedChildParentPadding page error:" + JSON.stringify(err));
}
await CommonFunc.sleep(2000);
done()
});
afterEach(async function () {
await CommonFunc.sleep(1000);
console.info("FlexAlign_SpaceAround_fixedChildParentPadding afterEach called");
});
/**
* @tc.number SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_SPACEAROUND_TEST_0300
* @tc.name testAlignSpaceAroundRowNoWrapPaddingOutRange
* @tc.desc The child component is fixed, and parent component is bound with padding attributes, the layout
* space of parent is insufficient to meet the spindle layout requirements of child component
*/
it('testAlignSpaceAroundRowNoWrapPaddingOutRange', 0, async function (done) {
console.info('new testAlignSpaceAroundRowNoWrapPaddingOutRange START');
globalThis.value.message.notify({name:'padding', value:50})
await CommonFunc.sleep(3000);
let strJson = getInspectorByKey('FlexAlignSpaceAround3');
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('Flex');
expect(obj.$attrs.constructor.direction).assertEqual('FlexDirection.Row');
expect(obj.$attrs.constructor.wrap).assertEqual('FlexWrap.NoWrap');
expect(obj.$attrs.constructor.justifyContent).assertEqual('FlexAlign.SpaceAround');
let locationText1 = CommonFunc.getComponentRect('AlignSpaceAround7');
let locationText2 = CommonFunc.getComponentRect('AlignSpaceAround8');
let locationText3 = CommonFunc.getComponentRect('AlignSpaceAround9');
let locationFlex = CommonFunc.getComponentRect('FlexAlignSpaceAround3');
expect(locationText1.top).assertEqual(locationText2.top);
expect(locationText2.top).assertEqual(locationText3.top);
expect(Math.round(locationText1.top - locationFlex.top)).assertEqual(vp2px(50));
expect(Math.round(locationText1.bottom - locationText1.top)).assertEqual(vp2px(50));
expect(Math.round(locationText2.bottom - locationText2.top)).assertEqual(vp2px(100));
expect(Math.round(locationText3.bottom - locationText3.top)).assertEqual(vp2px(150));
expect(locationFlex.bottom).assertEqual(locationText3.bottom);
expect(Math.round(locationText1.left - locationFlex.left)).assertEqual(vp2px(50));
expect(locationText1.right).assertEqual(locationText2.left);
expect(locationText2.right).assertEqual(locationText3.left);
expect(locationText3.right).assertEqual(Math.round(locationFlex.right - vp2px(50)));
expect(Math.round(locationText1.right - locationText1.left))
.assertEqual(Math.round(locationText2.right - locationText2.left));
expect(Math.round(locationText3.right - locationText3.left))
.assertEqual(Math.round(locationText2.right - locationText2.left));
expect(Math.round(locationText2.right - locationText2.left)).assertEqual(Math.round(vp2px(400/3)));
console.info('new testAlignSpaceAroundRowNoWrapPaddingOutRange END');
done();
});
/**
* @tc.number SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_SPACEAROUND_TEST_0400
* @tc.name testAlignSpaceAroundRowNoWrapPaddingInRange
* @tc.desc The child component is fixed, and parent component is bound with padding attributes, the layout
* space of parent component meets the spindle layout requirements of the child component
*/
it('testAlignSpaceAroundRowNoWrapPaddingInRange', 0, async function (done) {
console.info('new testAlignSpaceAroundRowNoWrapPaddingInRange START');
globalThis.value.message.notify({name:'padding', value:5})
await CommonFunc.sleep(3000);
let strJson = getInspectorByKey('FlexAlignSpaceAround3');
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('Flex');
expect(obj.$attrs.constructor.direction).assertEqual('FlexDirection.Row');
expect(obj.$attrs.constructor.wrap).assertEqual('FlexWrap.NoWrap');
expect(obj.$attrs.constructor.justifyContent).assertEqual('FlexAlign.SpaceAround');
let locationText1 = CommonFunc.getComponentRect('AlignSpaceAround7');
let locationText2 = CommonFunc.getComponentRect('AlignSpaceAround8');
let locationText3 = CommonFunc.getComponentRect('AlignSpaceAround9');
let locationFlex = CommonFunc.getComponentRect('FlexAlignSpaceAround3');
expect(locationText1.top).assertEqual(locationText2.top);
expect(locationText2.top).assertEqual(locationText3.top);
expect(Math.round((locationText1.top - locationFlex.top)*10)/10).assertEqual(Math.round(vp2px(5)*10)/10);
expect(Math.round(locationText1.bottom - locationText1.top)).assertEqual(vp2px(50));
expect(Math.round(locationText2.bottom - locationText2.top)).assertEqual(vp2px(100));
expect(Math.round(locationText3.bottom - locationText3.top)).assertEqual(vp2px(150));
expect(Math.round((locationFlex.bottom - locationText3.bottom)*10)/10)
.assertEqual(Math.round(vp2px(45)*10)/10);
expect(Math.round(locationText1.right - locationText1.left))
.assertEqual(Math.round(locationText2.right - locationText2.left));
expect(Math.round(locationText3.right - locationText3.left))
.assertEqual(Math.round(locationText2.right - locationText2.left));
expect(Math.round(locationText2.right - locationText2.left)).assertEqual(vp2px(150));
expect(Math.round(locationText2.left - locationText1.right))
.assertEqual(Math.round(locationText3.left - locationText2.right));
expect(Math.round(locationText2.left - locationText1.right)).assertEqual(Math.round(vp2px(40/3)));
expect(Math.round(locationText1.left - locationFlex.left))
.assertEqual(Math.round(locationFlex.right - locationText3.right));
expect(Math.round((locationText1.left - locationFlex.left)*10)/10).assertEqual(Math.round(vp2px(35/3)*10)/10);
expect(Math.round((locationText2.left - locationText1.right)*10)/10)
.assertEqual(Math.round(20*(locationFlex.right - locationText3.right - vp2px(5)))/10);
console.info('new testAlignSpaceAroundRowNoWrapPaddingInRange END');
done();
});
})
}
\ No newline at end of file
arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/SpaceAround/FlexAlign_SpaceAround_fixedParent.test.ets
0 → 100644
浏览文件 @
8175aaa3
/*
* Copyright (c) 2023 iSoftStone Information Technology (Group) Co.,Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from "@ohos/hypium";
import router from '@system.router';
import CommonFunc from '../../../../MainAbility/common/Common';
import { MessageManager, Callback } from '../../../../MainAbility/common/MessageManager';
export default function flexAlign_SpaceAround_fixedParent() {
describe('FlexAlign_SpaceAround_fixedParent', function () {
beforeEach(async function (done) {
console.info("FlexAlign_SpaceAround_fixedParent beforeEach called");
let options = {
uri: 'MainAbility/pages/Flex/justifyContent/SpaceAround/FlexAlign_SpaceAround_fixedParent',
}
try {
router.clear();
await CommonFunc.sleep(1000);
let pages = router.getState();
console.info("get FlexAlign_SpaceAround_fixedParent state pages:" + JSON.stringify(pages));
if (!("FlexAlign_SpaceAround_fixedParent" == pages.name)) {
console.info("get FlexAlign_SpaceAround_fixedParent state pages.name:" + JSON.stringify(pages.name));
let result = await router.push(options);
console.info("push FlexAlign_SpaceAround_fixedParent page result:" + JSON.stringify(result));
}
} catch (err) {
console.error("push FlexAlign_SpaceAround_fixedParent page error:" + JSON.stringify(err));
}
await CommonFunc.sleep(2000);
done()
});
afterEach(async function () {
await CommonFunc.sleep(1000);
console.info("FlexAlign_SpaceAround_fixedParent afterEach called");
});
/**
* @tc.number SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_SPACEAROUND_TEST_0900
* @tc.name testAlignSpaceAroundRowNoWrapOffset
* @tc.desc Parent component fixed, child component binding offset properties
*/
it('testAlignSpaceAroundRowNoWrapOffset', 0, async function (done) {
console.info('new testAlignSpaceAroundRowNoWrapOffset START');
globalThis.value.message.notify({name:'x', value:15})
globalThis.value.message.notify({name:'y', value:30})
globalThis.value.message.notify({name:'visibility', value:Visibility.Visible})
await CommonFunc.sleep(3000);
let strJson = getInspectorByKey('FlexAlignSpaceAround9');
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('Flex');
expect(obj.$attrs.constructor.direction).assertEqual('FlexDirection.Row');
expect(obj.$attrs.constructor.wrap).assertEqual('FlexWrap.NoWrap');
expect(obj.$attrs.constructor.justifyContent).assertEqual('FlexAlign.SpaceAround');
let strJson2 = getInspectorByKey('AlignSpaceAround25');
let obj2 = JSON.parse(strJson2);
expect(obj2.$attrs.visibility).assertEqual('Visibility.Visible');
let locationText1 = CommonFunc.getComponentRect('AlignSpaceAround25');
let locationText2 = CommonFunc.getComponentRect('AlignSpaceAround26');
let locationText3 = CommonFunc.getComponentRect('AlignSpaceAround27');
let locationFlex = CommonFunc.getComponentRect('FlexAlignSpaceAround9');
expect(Math.round(locationText1.top - locationFlex.top)).assertEqual(vp2px(30))
expect(Math.round((locationText1.left - locationFlex.left)*10)/10).assertEqual(Math.round((vp2px(15) + (locationFlex.right - locationText3.right))*10)/10)
expect(locationText2.top).assertEqual(locationText3.top);
expect(locationText3.top).assertEqual(locationFlex.top);
expect(Math.round(locationText1.bottom - locationText1.top)).assertEqual(vp2px(50));
expect(Math.round(locationText2.bottom - locationText2.top)).assertEqual(vp2px(100));
expect(Math.round(locationText3.bottom - locationText3.top)).assertEqual(vp2px(150));
expect(Math.round(locationFlex.bottom - locationText3.bottom)).assertEqual(vp2px(50));
expect(Math.round(locationText1.right - locationText1.left))
.assertEqual(Math.round(locationText2.right - locationText2.left));
expect(Math.round(locationText3.right - locationText3.left))
.assertEqual(Math.round(locationText2.right - locationText2.left));
expect(Math.round(locationText2.right - locationText2.left)).assertEqual(vp2px(150));
expect(Math.round((locationText2.left - locationText1.right + vp2px(15))*10)/10)
.assertEqual(Math.round((locationText3.left - locationText2.right)*10)/10);
expect(Math.round((locationText1.left - locationFlex.left - vp2px(15))*10)/10)
.assertEqual(Math.round((locationFlex.right - locationText3.right)*10)/10);
expect(Math.round((locationText3.left - locationText2.right)*10)/10)
.assertEqual(Math.round(20*(locationFlex.right - locationText3.right))/10);
console.info('new testAlignSpaceAroundRowNoWrapOffset END');
done();
});
})
}
\ No newline at end of file
arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/SpaceAround/FlexAlign_SpaceAround_fixedParentChangeFirst.test.ets
0 → 100644
浏览文件 @
8175aaa3
/*
* Copyright (c) 2023 iSoftStone Information Technology (Group) Co.,Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from "@ohos/hypium";
import router from '@system.router';
import CommonFunc from '../../../../MainAbility/common/Common';
import { MessageManager, Callback } from '../../../../MainAbility/common/MessageManager';
export default function flexAlign_SpaceAround_fixedParentChangeFirst() {
describe('FlexAlign_SpaceAround_fixedParentChangeFirst', function () {
beforeEach(async function (done) {
console.info("FlexAlign_SpaceAround_fixedParentChangeFirst beforeEach called");
let options = {
uri: 'MainAbility/pages/Flex/justifyContent/SpaceAround/FlexAlign_SpaceAround_fixedParentChangeFirst',
}
try {
router.clear();
await CommonFunc.sleep(1000);
let pages = router.getState();
console.info("get FlexAlign_SpaceAround_fixedParentChangeFirst state pages:" + JSON.stringify(pages));
if (!("FlexAlign_SpaceAround_fixedParentChangeFirst" == pages.name)) {
console.info("get FlexAlign_SpaceAround_fixedParentChangeFirst pages.name:" + JSON.stringify(pages.name));
let result = await router.push(options);
console.info("push FlexAlign_SpaceAround_fixedParentChangeFirst page result:" + JSON.stringify(result));
}
} catch (err) {
console.error("push FlexAlign_SpaceAround_fixedParentChangeFirst page error:" + JSON.stringify(err));
}
await CommonFunc.sleep(2000);
done()
});
afterEach(async function () {
await CommonFunc.sleep(1000);
console.info("FlexAlign_SpaceAround_fixedParentChangeFirst afterEach called");
});
/**
* @tc.number SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_SPACEAROUND_TEST_1200
* @tc.name testAlignSpaceAroundRowNoWrapChangeFirstLayoutWeight122
* @tc.desc Parent component fixed, child component binding layoutWeight first1 second2 third2 properties
*/
it('testAlignSpaceAroundRowNoWrapChangeFirstLayoutWeight122', 0, async function (done) {
console.info('new testAlignSpaceAroundRowNoWrapChangeFirstLayoutWeight122 START');
globalThis.value.message.notify({name:'testFirstlayoutWeight', value:1})
globalThis.value.message.notify({name:'testSecondlayoutWeight', value:2})
globalThis.value.message.notify({name:'testThirdlayoutWeight', value:2})
await CommonFunc.sleep(3000);
let strJson = getInspectorByKey('FlexAlignSpaceAround12');
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('Flex');
expect(obj.$attrs.constructor.direction).assertEqual('FlexDirection.Row');
expect(obj.$attrs.constructor.wrap).assertEqual('FlexWrap.NoWrap');
expect(obj.$attrs.constructor.justifyContent).assertEqual('FlexAlign.SpaceAround');
let locationText1 = CommonFunc.getComponentRect('AlignSpaceAround34');
let locationText2 = CommonFunc.getComponentRect('AlignSpaceAround35');
let locationText3 = CommonFunc.getComponentRect('AlignSpaceAround36');
let locationFlex = CommonFunc.getComponentRect('FlexAlignSpaceAround12');
expect(locationText1.top).assertEqual(locationText2.top);
expect(locationText2.top).assertEqual(locationText3.top);
expect(locationText1.top).assertEqual(locationFlex.top);
expect(Math.round(locationText1.bottom - locationText1.top)).assertEqual(vp2px(50));
expect(Math.round(locationText2.bottom - locationText2.top)).assertEqual(vp2px(100));
expect(Math.round(locationText3.bottom - locationText3.top)).assertEqual(vp2px(150));
expect(Math.round(locationFlex.bottom - locationText3.bottom)).assertEqual(vp2px(50));
expect(locationText1.left).assertEqual(locationFlex.left);
expect(locationText1.right).assertEqual(locationText2.left);
expect(locationText2.right).assertEqual(locationText3.left);
expect(locationText3.right).assertEqual(locationFlex.right);
expect(Math.round(locationText1.right - locationText1.left)).assertEqual(vp2px(100));
expect(Math.round(locationText3.right - locationText3.left)).assertEqual(vp2px(200));
expect(Math.round(locationText2.right - locationText2.left)).assertEqual(vp2px(200));
console.info('new testAlignSpaceAroundRowNoWrapChangeFirstLayoutWeight122 END');
done();
});
/**
* @tc.number SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_SPACEAROUND_TEST_1600
* @tc.name testAlignSpaceAroundRowNoWrapChangeFirstLayoutWeight120
* @tc.desc Parent component fixed, child component binding layoutWeight first1 second2 third0 properties
*/
it('testAlignSpaceAroundRowNoWrapChangeFirstLayoutWeight120', 0, async function (done) {
console.info('new testAlignSpaceAroundRowNoWrapChangeFirstLayoutWeight120 START');
globalThis.value.message.notify({name:'testFirstlayoutWeight', value:1})
globalThis.value.message.notify({name:'testSecondlayoutWeight', value:2})
globalThis.value.message.notify({name:'testThirdlayoutWeight', value:0})
await CommonFunc.sleep(3000);
let strJson = getInspectorByKey('FlexAlignSpaceAround12');
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('Flex');
expect(obj.$attrs.constructor.direction).assertEqual('FlexDirection.Row');
expect(obj.$attrs.constructor.wrap).assertEqual('FlexWrap.NoWrap');
expect(obj.$attrs.constructor.justifyContent).assertEqual('FlexAlign.SpaceAround');
let locationText1 = CommonFunc.getComponentRect('AlignSpaceAround34');
let locationText2 = CommonFunc.getComponentRect('AlignSpaceAround35');
let locationText3 = CommonFunc.getComponentRect('AlignSpaceAround36');
let locationFlex = CommonFunc.getComponentRect('FlexAlignSpaceAround12');
expect(locationText1.top).assertEqual(locationText2.top);
expect(locationText2.top).assertEqual(locationText3.top);
expect(locationText1.top).assertEqual(locationFlex.top);
expect(Math.round(locationText1.bottom - locationText1.top)).assertEqual(vp2px(50));
expect(Math.round(locationText2.bottom - locationText2.top)).assertEqual(vp2px(100));
expect(Math.round(locationText3.bottom - locationText3.top)).assertEqual(vp2px(150));
expect(Math.round(locationFlex.bottom - locationText3.bottom)).assertEqual(vp2px(50));
expect(locationText1.left).assertEqual(locationFlex.left);
expect(locationText1.right).assertEqual(locationText2.left);
expect(locationText2.right).assertEqual(locationText3.left);
expect(locationText3.right).assertEqual(locationFlex.right);
expect(Math.round(locationText1.right - locationText1.left)).assertEqual(Math.round(vp2px(350/3)));
expect(Math.round(locationText2.right - locationText2.left)).assertEqual(Math.round(vp2px(700/3)));
expect(Math.round(locationText3.right - locationText3.left)).assertEqual(vp2px(150));
console.info('new testAlignSpaceAroundRowNoWrapChangeFirstLayoutWeight120 END');
done();
});
})
}
\ No newline at end of file
arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/SpaceAround/FlexAlign_SpaceAround_fixedParentChangeFirstWidth.test.ets
0 → 100644
浏览文件 @
8175aaa3
/*
* Copyright (c) 2023 iSoftStone Information Technology (Group) Co.,Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from "@ohos/hypium";
import router from '@system.router';
import CommonFunc from '../../../../MainAbility/common/Common';
import { MessageManager, Callback } from '../../../../MainAbility/common/MessageManager';
export default function flexAlign_SpaceAround_fixedParentChangeFirstWidth() {
describe('FlexAlign_SpaceAround_fixedParentChangeFirstWidth', function () {
beforeEach(async function (done) {
console.info("FlexAlign_SpaceAround_fixedParentChangeFirstWidth beforeEach called");
let options = {
uri: 'MainAbility/pages/Flex/justifyContent/SpaceAround/FlexAlign_SpaceAround_fixedParentChangeFirstWidth',
}
try {
router.clear();
await CommonFunc.sleep(1000);
let pages = router.getState();
console.info("get FlexAlign_SpaceAround_fixedParentChangeFirstWidth state pages:" + JSON.stringify(pages));
if (!("FlexAlign_SpaceAround_fixedParentChangeFirstWidth" == pages.name)) {
console.info("get FlexAlign_SpaceAround_fixedParentChangeFirstWidth pages.name:" + JSON.stringify(pages.name));
let result = await router.push(options);
console.info("push FlexAlign_SpaceAround_fixedParentChangeFirstWidth page result:" + JSON.stringify(result));
}
} catch (err) {
console.error("push FlexAlign_SpaceAround_fixedParentChangeFirstWidth page error:" + JSON.stringify(err));
}
await CommonFunc.sleep(2000);
done()
});
afterEach(async function () {
await CommonFunc.sleep(1000);
console.info("FlexAlign_SpaceAround_fixedParentChangeFirstWidth afterEach called");
});
/**
* @tc.number SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_SPACEAROUND_TEST_1300
* @tc.name testAlignSpaceAroundRowNoWrapChangeFirst
* @tc.desc Parent component fixed, child component binding width properties
*/
it('testAlignSpaceAroundRowNoWrapChangeFirst', 0, async function (done) {
console.info('new testAlignSpaceAroundRowNoWrapChangeFirst START');
globalThis.value.message.notify({name:'width', value:175})
await CommonFunc.sleep(3000);
let strJson = getInspectorByKey('FlexAlignSpaceAround13');
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('Flex');
expect(obj.$attrs.constructor.direction).assertEqual('FlexDirection.Row');
expect(obj.$attrs.constructor.wrap).assertEqual('FlexWrap.NoWrap');
expect(obj.$attrs.constructor.justifyContent).assertEqual('FlexAlign.SpaceAround');
let locationText1 = CommonFunc.getComponentRect('AlignSpaceAround37');
let locationText2 = CommonFunc.getComponentRect('AlignSpaceAround38');
let locationText3 = CommonFunc.getComponentRect('AlignSpaceAround39');
let locationFlex = CommonFunc.getComponentRect('FlexAlignSpaceAround13');
expect(locationText1.top).assertEqual(locationText2.top);
expect(locationText2.top).assertEqual(locationText3.top);
expect(locationText1.top).assertEqual(locationFlex.top);
expect(Math.round(locationText1.bottom - locationText1.top)).assertEqual(vp2px(50));
expect(Math.round(locationText2.bottom - locationText2.top)).assertEqual(vp2px(100));
expect(Math.round(locationText3.bottom - locationText3.top)).assertEqual(vp2px(150));
expect(Math.round(locationFlex.bottom - locationText3.bottom)).assertEqual(vp2px(50));
expect(Math.round(locationText2.left - locationText1.right))
.assertEqual(Math.round(locationText3.left - locationText2.right));
expect(Math.round((locationText2.left - locationText1.right)*10)/10).assertEqual(Math.round(vp2px(25/3)*10)/10);
expect(Math.round(locationText3.right - locationText3.left))
.assertEqual(Math.round(locationText2.right - locationText2.left));
expect(Math.round(locationText2.right - locationText2.left)).assertEqual(vp2px(150));
expect(Math.round((locationText1.right - locationText1.left)*10)/10).assertEqual(Math.round(vp2px(175)*10)/10);
expect(Math.round(locationText1.left - locationFlex.left))
.assertEqual(Math.round(locationFlex.right - locationText3.right));
expect(Math.round((locationText1.left - locationFlex.left)*10)/10).assertEqual(Math.round(vp2px(25/6)*10)/10);
expect(Math.round(locationText2.left - locationText1.right))
.assertEqual(Math.round(2*(locationFlex.right - locationText3.right)));
console.info('new testAlignSpaceAroundRowNoWrapChangeFirst END');
done();
});
})
}
\ No newline at end of file
arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/SpaceAround/FlexAlign_SpaceAround_fixedParentMarginFirst.test.ets
0 → 100644
浏览文件 @
8175aaa3
/*
* Copyright (c) 2023 iSoftStone Information Technology (Group) Co.,Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from "@ohos/hypium";
import router from '@system.router';
import CommonFunc from '../../../../MainAbility/common/Common';
import { MessageManager, Callback } from '../../../../MainAbility/common/MessageManager';
export default function flexAlign_SpaceAround_fixedParentMarginFirst() {
describe('FlexAlign_SpaceAround_fixedParentMarginFirst', function () {
beforeEach(async function (done) {
console.info("FlexAlign_SpaceAround_fixedParentMarginFirst beforeEach called");
let options = {
uri: 'MainAbility/pages/Flex/justifyContent/SpaceAround/FlexAlign_SpaceAround_fixedParentMarginFirst',
}
try {
router.clear();
await CommonFunc.sleep(1000);
let pages = router.getState();
console.info("get FlexAlign_SpaceAround_fixedParentMarginFirst state pages:" + JSON.stringify(pages));
if (!("FlexAlign_SpaceAround_fixedParentMarginFirst" == pages.name)) {
console.info("get FlexAlign_SpaceAround_fixedParentMarginFirst state pages.name:" + JSON.stringify(pages.name));
let result = await router.push(options);
console.info("push FlexAlign_SpaceAround_fixedParentMarginFirst page result:" + JSON.stringify(result));
}
} catch (err) {
console.error("push FlexAlign_SpaceAround_fixedParentMarginFirst page error:" + JSON.stringify(err));
}
await CommonFunc.sleep(2000);
done()
});
afterEach(async function () {
await CommonFunc.sleep(1000);
console.info("FlexAlign_SpaceAround_fixedParentMarginFirst afterEach called");
});
/**
* @tc.number SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_SPACEAROUND_TEST_1400
* @tc.name testAlignSpaceAroundRowNoWrapMarginFirstInRange
* @tc.desc Parent component fixed, child component binding margin properties, the layout space of the parent
* component meets the spindle layout requirements of the child component
*/
it('testAlignSpaceAroundRowNoWrapMarginFirstInRange', 0, async function (done) {
console.info('new testAlignSpaceAroundRowNoWrapMarginFirstInRange START');
globalThis.value.message.notify({name:'margin', value:20})
await CommonFunc.sleep(3000);
let strJson = getInspectorByKey('FlexAlignSpaceAround14');
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('Flex');
expect(obj.$attrs.constructor.direction).assertEqual('FlexDirection.Row');
expect(obj.$attrs.constructor.wrap).assertEqual('FlexWrap.NoWrap');
expect(obj.$attrs.constructor.justifyContent).assertEqual('FlexAlign.SpaceAround');
let locationText1 = CommonFunc.getComponentRect('AlignSpaceAround40');
let locationText2 = CommonFunc.getComponentRect('AlignSpaceAround41');
let locationText3 = CommonFunc.getComponentRect('AlignSpaceAround42');
let locationFlex = CommonFunc.getComponentRect('FlexAlignSpaceAround14');
expect(Math.round(locationText1.top - locationFlex.top)).assertEqual(vp2px(20))
expect(locationText2.top).assertEqual(locationText3.top);
expect(locationText3.top).assertEqual(locationFlex.top);
expect(Math.round(locationText1.bottom - locationText1.top)).assertEqual(vp2px(50));
expect(Math.round(locationText2.bottom - locationText2.top)).assertEqual(vp2px(100));
expect(Math.round(locationText3.bottom - locationText3.top)).assertEqual(vp2px(150));
expect(Math.round(locationFlex.bottom - locationText3.bottom)).assertEqual(vp2px(50));
expect(Math.round(locationText1.right - locationText1.left))
.assertEqual(Math.round(locationText2.right - locationText2.left));
expect(Math.round(locationText3.right - locationText3.left))
.assertEqual(Math.round(locationText2.right - locationText2.left));
expect(Math.round(locationText2.right - locationText2.left)).assertEqual(vp2px(150));
expect(Math.round(locationText2.left - locationText1.right - vp2px(20)))
.assertEqual(Math.round(locationText3.left - locationText2.right));
expect(Math.round(locationText1.left - locationFlex.left - vp2px(20)))
.assertEqual(Math.round(locationFlex.right - locationText3.right));
expect(Math.round(locationText2.left - locationText1.right - vp2px(20)))
.assertEqual(Math.round(2*(locationFlex.right - locationText3.right)));
console.info('new testAlignSpaceAroundRowNoWrapMarginFirstInRange END');
done();
});
/**
* @tc.number SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_SPACEAROUND_TEST_1500
* @tc.name testAlignSpaceAroundRowNoWrapMarginFirstOutRange
* @tc.desc Parent component fixed, child component binding margin properties, the layout space of the parent
* component is insufficient to meet the spindle layout requirements of the child component
*/
it('testAlignSpaceAroundRowNoWrapMarginFirstOutRange', 0, async function (done) {
console.info('new testAlignSpaceAroundRowNoWrapMarginFirstOutRange START');
globalThis.value.message.notify({name:'margin', value:50})
await CommonFunc.sleep(3000);
let strJson = getInspectorByKey('FlexAlignSpaceAround14');
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('Flex');
expect(obj.$attrs.constructor.direction).assertEqual('FlexDirection.Row');
expect(obj.$attrs.constructor.wrap).assertEqual('FlexWrap.NoWrap');
expect(obj.$attrs.constructor.justifyContent).assertEqual('FlexAlign.SpaceAround');
let locationText1 = CommonFunc.getComponentRect('AlignSpaceAround40');
let locationText2 = CommonFunc.getComponentRect('AlignSpaceAround41');
let locationText3 = CommonFunc.getComponentRect('AlignSpaceAround42');
let locationFlex = CommonFunc.getComponentRect('FlexAlignSpaceAround14');
expect(Math.round(locationText1.top - locationFlex.top)).assertEqual(Math.round(vp2px(50)));
expect(Math.round(locationText1.left - locationFlex.left)).assertEqual(Math.round(vp2px(50)));
expect(locationText2.top).assertEqual(locationText3.top);
expect(locationText3.top).assertEqual(locationFlex.top);
expect(Math.round(locationText1.bottom - locationText1.top)).assertEqual(vp2px(50));
expect(Math.round(locationText2.bottom - locationText2.top)).assertEqual(vp2px(100));
expect(Math.round(locationText3.bottom - locationText3.top)).assertEqual(vp2px(150));
expect(Math.round(locationFlex.bottom - locationText3.bottom)).assertEqual(vp2px(50));
expect(locationText2.right).assertEqual(locationText3.left);
expect(locationText3.right).assertEqual(locationFlex.right);
expect(Math.round(locationText1.right - locationText1.left)).assertEqual(Math.round(vp2px(400/3)));
expect(Math.round(locationText2.right - locationText2.left)).assertEqual(Math.round(vp2px(400/3)));
expect(Math.round(locationText3.right - locationText3.left)).assertEqual(Math.round(vp2px(400/3)));
expect(Math.round(locationText2.left - locationText1.right)).assertEqual(Math.round(vp2px(50)));
console.info('new testAlignSpaceAroundRowNoWrapMarginFirstOutRange END');
done();
});
})
}
\ No newline at end of file
arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/SpaceAround/FlexAlign_SpaceAround_fixedParentVisibility.test.ets
0 → 100644
浏览文件 @
8175aaa3
/*
* Copyright (c) 2023 iSoftStone Information Technology (Group) Co.,Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from "@ohos/hypium";
import router from '@system.router';
import CommonFunc from '../../../../MainAbility/common/Common';
import { MessageManager, Callback } from '../../../../MainAbility/common/MessageManager';
export default function flexAlign_SpaceAround_fixedParentVisibility() {
describe('FlexAlign_SpaceAround_fixedParentVisibility', function () {
beforeEach(async function (done) {
console.info("FlexAlign_SpaceAround_fixedParentVisibility beforeEach called");
let options = {
uri: 'MainAbility/pages/Flex/justifyContent/SpaceAround/FlexAlign_SpaceAround_fixedParentVisibility',
}
try {
router.clear();
await CommonFunc.sleep(1000);
let pages = router.getState();
console.info("get FlexAlign_SpaceAround_fixedParentVisibility state pages:" + JSON.stringify(pages));
if (!("FlexAlign_SpaceAround_fixedParentVisibility" == pages.name)) {
console.info("get FlexAlign_SpaceAround_fixedParentVisibility state pages.name:" + JSON.stringify(pages.name));
let result = await router.push(options);
console.info("push FlexAlign_SpaceAround_fixedParentVisibility page result:" + JSON.stringify(result));
}
} catch (err) {
console.error("push FlexAlign_SpaceAround_fixedParentVisibility page error:" + JSON.stringify(err));
}
await CommonFunc.sleep(2000);
done()
});
afterEach(async function () {
await CommonFunc.sleep(1000);
console.info("FlexAlign_SpaceAround_fixedParentVisibility afterEach called");
});
/**
* @tc.number SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_SPACEAROUND_TEST_1000
* @tc.name testAlignSpaceAroundRowNoWrapVisibilityNone
* @tc.desc Parent component fixed, child component binding visibility none properties
*/
it('testAlignSpaceAroundRowNoWrapVisibilityNone', 0, async function (done) {
console.info('new testAlignSpaceAroundRowNoWrapVisibilityNone START');
globalThis.value.message.notify({name:'visibility', value:Visibility.None})
await CommonFunc.sleep(3000);
let strJson = getInspectorByKey('FlexAlignSpaceAround10');
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('Flex');
expect(obj.$attrs.constructor.direction).assertEqual('FlexDirection.Row');
expect(obj.$attrs.constructor.wrap).assertEqual('FlexWrap.NoWrap');
expect(obj.$attrs.constructor.justifyContent).assertEqual('FlexAlign.SpaceAround');
let strJson2 = getInspectorByKey('AlignSpaceAround28');
let obj2 = JSON.parse(strJson2);
expect(obj2.$attrs.visibility).assertEqual('Visibility.None');
let locationText1 = CommonFunc.getComponentRect('AlignSpaceAround28');
let locationText2 = CommonFunc.getComponentRect('AlignSpaceAround29');
let locationText3 = CommonFunc.getComponentRect('AlignSpaceAround30');
let locationFlex = CommonFunc.getComponentRect('FlexAlignSpaceAround10');
expect(locationText1.top).assertEqual(locationText2.top);
expect(locationText2.top).assertEqual(locationText3.top);
expect(locationText2.top).assertEqual(locationFlex.top);
expect(Math.round(locationText2.bottom - locationText2.top)).assertEqual(vp2px(100));
expect(Math.round(locationText3.bottom - locationText3.top)).assertEqual(vp2px(150));
expect(Math.round(locationFlex.bottom - locationText3.bottom)).assertEqual(vp2px(50));
expect(Math.round(locationText2.left - locationFlex.left)).assertEqual(vp2px(50));
expect(Math.round(locationFlex.right - locationText3.right)).assertEqual(vp2px(50));
expect(Math.round(locationText3.right - locationText3.left))
.assertEqual(Math.round(locationText2.right - locationText2.left));
expect(Math.round(locationText2.right - locationText2.left)).assertEqual(vp2px(150));
expect(Math.round(locationText3.left - locationText2.right)).assertEqual(vp2px(100));
expect(Math.round(locationText3.left - locationText2.right))
.assertEqual(Math.round(2*(locationFlex.right - locationText3.right)));
console.info('new testAlignSpaceAroundRowNoWrapVisibilityNone END');
done();
});
/**
* @tc.number SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_SPACEAROUND_TEST_1100
* @tc.name testAlignSpaceAroundRowNoWrapVisibilityHidden
* @tc.desc Parent component fixed, child component binding visibility hidden properties
*/
it('testAlignSpaceAroundRowNoWrapVisibilityHidden', 0, async function (done) {
console.info('new testAlignSpaceAroundRowNoWrapVisibilityHidden START');
globalThis.value.message.notify({name:'visibility', value:Visibility.Hidden})
await CommonFunc.sleep(3000);
let strJson = getInspectorByKey('FlexAlignSpaceAround10');
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('Flex');
expect(obj.$attrs.constructor.direction).assertEqual('FlexDirection.Row');
expect(obj.$attrs.constructor.wrap).assertEqual('FlexWrap.NoWrap');
expect(obj.$attrs.constructor.justifyContent).assertEqual('FlexAlign.SpaceAround');
let strJson2 = getInspectorByKey('AlignSpaceAround28');
let obj2 = JSON.parse(strJson2);
expect(obj2.$attrs.visibility).assertEqual('Visibility.Hidden');
let locationText1 = CommonFunc.getComponentRect('AlignSpaceAround28');
let locationText2 = CommonFunc.getComponentRect('AlignSpaceAround29');
let locationText3 = CommonFunc.getComponentRect('AlignSpaceAround30');
let locationFlex = CommonFunc.getComponentRect('FlexAlignSpaceAround10');
expect(locationText1.top).assertEqual(locationText2.top);
expect(locationText2.top).assertEqual(locationText3.top);
expect(locationText1.top).assertEqual(locationFlex.top);
expect(Math.round(locationText1.bottom - locationText1.top)).assertEqual(vp2px(50));
expect(Math.round(locationText2.bottom - locationText2.top)).assertEqual(vp2px(100));
expect(Math.round(locationText3.bottom - locationText3.top)).assertEqual(vp2px(150));
expect(Math.round(locationFlex.bottom - locationText3.bottom)).assertEqual(vp2px(50));
expect(Math.round((locationText1.left - locationFlex.left)*10)/10).assertEqual(Math.round(vp2px(25/3)*10)/10);
expect(Math.round((locationFlex.right - locationText3.right)*10)/10).assertEqual(Math.round(vp2px(25/3)*10)/10);
expect(Math.round(locationText1.right - locationText1.left))
.assertEqual(Math.round(locationText2.right - locationText2.left));
expect(Math.round(locationText3.right - locationText3.left))
.assertEqual(Math.round(locationText2.right - locationText2.left));
expect(Math.round(locationText2.right - locationText2.left)).assertEqual(vp2px(150));
expect(Math.round(locationText2.left - locationText1.right))
.assertEqual(Math.round(locationText3.left - locationText2.right));
expect(Math.round(locationText2.left - locationText1.right)).assertEqual(Math.round(vp2px(50/3)));
expect(Math.round(locationText1.left - locationFlex.left))
.assertEqual(Math.round(locationFlex.right - locationText3.right));
expect(Math.round(locationText2.left - locationText1.right))
.assertEqual(Math.round(2*(locationFlex.right - locationText3.right)));
console.info('new testAlignSpaceAroundRowNoWrapVisibilityHidden END');
done();
});
})
}
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录