Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
3404a80b
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看板
提交
3404a80b
编写于
2月 07, 2023
作者:
W
wangwentian
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add flex_justifyContent_SpaceBetween xts_acts testcase & pages again
modisy reviews Signed-off-by:
N
wangwentian
<
wtwanga@isoftstone.com
>
上级
69f52ad3
变更
20
隐藏空白更改
内联
并排
Showing
20 changed file
with
1743 addition
and
0 deletion
+1743
-0
arkui/ace_ets_layout_test/entry/src/main/ets/MainAbility/pages/Flex/justifyContent/SpaceBetween/FlexAlign_SpaceBetween_fixedChild.ets
...ontent/SpaceBetween/FlexAlign_SpaceBetween_fixedChild.ets
+60
-0
arkui/ace_ets_layout_test/entry/src/main/ets/MainAbility/pages/Flex/justifyContent/SpaceBetween/FlexAlign_SpaceBetween_fixedChildParentItemAlignEnd.ets
...n/FlexAlign_SpaceBetween_fixedChildParentItemAlignEnd.ets
+61
-0
arkui/ace_ets_layout_test/entry/src/main/ets/MainAbility/pages/Flex/justifyContent/SpaceBetween/FlexAlign_SpaceBetween_fixedChildParentMarPad.ets
...Between/FlexAlign_SpaceBetween_fixedChildParentMarPad.ets
+62
-0
arkui/ace_ets_layout_test/entry/src/main/ets/MainAbility/pages/Flex/justifyContent/SpaceBetween/FlexAlign_SpaceBetween_fixedChildParentMargin.ets
...Between/FlexAlign_SpaceBetween_fixedChildParentMargin.ets
+57
-0
arkui/ace_ets_layout_test/entry/src/main/ets/MainAbility/pages/Flex/justifyContent/SpaceBetween/FlexAlign_SpaceBetween_fixedChildParentPadding.ets
...etween/FlexAlign_SpaceBetween_fixedChildParentPadding.ets
+57
-0
arkui/ace_ets_layout_test/entry/src/main/ets/MainAbility/pages/Flex/justifyContent/SpaceBetween/FlexAlign_SpaceBetween_fixedParent.ets
...ntent/SpaceBetween/FlexAlign_SpaceBetween_fixedParent.ets
+61
-0
arkui/ace_ets_layout_test/entry/src/main/ets/MainAbility/pages/Flex/justifyContent/SpaceBetween/FlexAlign_SpaceBetween_fixedParentChangeFirst.ets
...Between/FlexAlign_SpaceBetween_fixedParentChangeFirst.ets
+67
-0
arkui/ace_ets_layout_test/entry/src/main/ets/MainAbility/pages/Flex/justifyContent/SpaceBetween/FlexAlign_SpaceBetween_fixedParentChangeFirstWidth.ets
...en/FlexAlign_SpaceBetween_fixedParentChangeFirstWidth.ets
+56
-0
arkui/ace_ets_layout_test/entry/src/main/ets/MainAbility/pages/Flex/justifyContent/SpaceBetween/FlexAlign_SpaceBetween_fixedParentMarginFirst.ets
...Between/FlexAlign_SpaceBetween_fixedParentMarginFirst.ets
+56
-0
arkui/ace_ets_layout_test/entry/src/main/ets/MainAbility/pages/Flex/justifyContent/SpaceBetween/FlexAlign_SpaceBetween_fixedParentVisibility.ets
...eBetween/FlexAlign_SpaceBetween_fixedParentVisibility.ets
+57
-0
arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/SpaceBetween/FlexAlign_SpaceBetween_fixedChild.test.ets
...t/SpaceBetween/FlexAlign_SpaceBetween_fixedChild.test.ets
+133
-0
arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/SpaceBetween/FlexAlign_SpaceBetween_fixedChildParentItemAlignEnd.test.ets
...xAlign_SpaceBetween_fixedChildParentItemAlignEnd.test.ets
+91
-0
arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/SpaceBetween/FlexAlign_SpaceBetween_fixedChildParentMarPad.test.ets
...en/FlexAlign_SpaceBetween_fixedChildParentMarPad.test.ets
+133
-0
arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/SpaceBetween/FlexAlign_SpaceBetween_fixedChildParentMargin.test.ets
...en/FlexAlign_SpaceBetween_fixedChildParentMargin.test.ets
+90
-0
arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/SpaceBetween/FlexAlign_SpaceBetween_fixedChildParentPadding.test.ets
...n/FlexAlign_SpaceBetween_fixedChildParentPadding.test.ets
+131
-0
arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/SpaceBetween/FlexAlign_SpaceBetween_fixedParent.test.ets
.../SpaceBetween/FlexAlign_SpaceBetween_fixedParent.test.ets
+94
-0
arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/SpaceBetween/FlexAlign_SpaceBetween_fixedParentChangeFirst.test.ets
...en/FlexAlign_SpaceBetween_fixedParentChangeFirst.test.ets
+128
-0
arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/SpaceBetween/FlexAlign_SpaceBetween_fixedParentChangeFirstWidth.test.ets
...exAlign_SpaceBetween_fixedParentChangeFirstWidth.test.ets
+90
-0
arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/SpaceBetween/FlexAlign_SpaceBetween_fixedParentMarginFirst.test.ets
...en/FlexAlign_SpaceBetween_fixedParentMarginFirst.test.ets
+128
-0
arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/SpaceBetween/FlexAlign_SpaceBetween_fixedParentVisibility.test.ets
...een/FlexAlign_SpaceBetween_fixedParentVisibility.test.ets
+131
-0
未找到文件。
arkui/ace_ets_layout_test/entry/src/main/ets/MainAbility/pages/Flex/justifyContent/SpaceBetween/FlexAlign_SpaceBetween_fixedChild.ets
0 → 100644
浏览文件 @
3404a80b
/**
* 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_SpaceBetween_fixedChild {
@State testHeight: number = 150
@State testWidth: number = 450
messageManager:MessageManager = new MessageManager()
private content: string = "FlexAlign_SpaceBetween_fixedChild Page"
onPageShow() {
console.info('FlexAlign_SpaceBetween_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_SpaceBetween_fixedChild page build done called');
}
build() {
Column() {
Text('justifyContent:Align_SpaceBetween1').fontSize(9).fontColor(0xCCCCCC).width('90%')
Flex({ direction: FlexDirection.Row, wrap: FlexWrap.NoWrap, justifyContent: FlexAlign.SpaceBetween }) {
Text('1').width(150).height(50).backgroundColor(0xF5DEB3).key('AlignSpaceBetween1')
Text('2').width(150).height(100).backgroundColor(0xD2B48C).key('AlignSpaceBetween2')
Text('3').width(150).height(150).backgroundColor(0xffa500).key('AlignSpaceBetween3')
}
.key('FlexAlignSpaceBetween1')
.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/SpaceBetween/FlexAlign_SpaceBetween_fixedChildParentItemAlignEnd.ets
0 → 100644
浏览文件 @
3404a80b
/**
* 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_SpaceBetween_fixedChildParentItemAlignEnd {
@State testHeight: number = 150
@State testWidth: number = 450
messageManager:MessageManager = new MessageManager()
private content: string = "FlexAlign_SpaceBetween_fixedChildParentItemAlignEnd Page"
onPageShow() {
console.info('FlexAlign_SpaceBetween_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_SpaceBetween_fixedChildParentItemAlignEnd page build done called');
}
build() {
Column() {
Text('justifyContent:Align_SpaceBetween8').fontSize(9).fontColor(0xCCCCCC).width('90%')
Flex({ direction: FlexDirection.Row, wrap: FlexWrap.NoWrap, justifyContent: FlexAlign.SpaceBetween }) {
Text('1').width(150).height(50).backgroundColor(0xF5DEB3).key('AlignSpaceBetween22')
Text('2').width(150).height(100).backgroundColor(0xD2B48C).key('AlignSpaceBetween23')
Text('3').width(150).height(150).backgroundColor(0xffa500).key('AlignSpaceBetween24')
}
.key('FlexAlignSpaceBetween8')
.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/SpaceBetween/FlexAlign_SpaceBetween_fixedChildParentMarPad.ets
0 → 100644
浏览文件 @
3404a80b
/**
* 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_SpaceBetween_fixedChildParentMarPad {
@State testPadding: number = 10
@State testMargin: number = 10
messageManager:MessageManager = new MessageManager()
private content: string = "FlexAlign_SpaceBetween_fixedChildParentMarPad Page"
onPageShow() {
console.info('FlexAlign_SpaceBetween_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_SpaceBetween_fixedChildParentMarPad page build done called');
}
build() {
Column() {
Text('justifyContent:Align_SpaceBetween6').fontSize(9).fontColor(0xCCCCCC).width('90%')
Flex({ direction: FlexDirection.Row, wrap: FlexWrap.NoWrap, justifyContent: FlexAlign.SpaceBetween }) {
Text('1').width(150).height(50).backgroundColor(0xF5DEB3).key('AlignSpaceBetween16')
Text('2').width(150).height(100).backgroundColor(0xD2B48C).key('AlignSpaceBetween17')
Text('3').width(150).height(150).backgroundColor(0xffa500).key('AlignSpaceBetween18')
}
.key('FlexAlignSpaceBetween6')
.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/SpaceBetween/FlexAlign_SpaceBetween_fixedChildParentMargin.ets
0 → 100644
浏览文件 @
3404a80b
/**
* 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_SpaceBetween_fixedChildParentMargin {
@State testMargin: number = 0
messageManager:MessageManager = new MessageManager()
private content: string = "FlexAlign_SpaceBetween_fixedChildParentMargin Page"
onPageShow() {
console.info('FlexAlign_SpaceBetween_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_SpaceBetween_fixedChildParentMargin page build done called');
}
build() {
Column() {
Text('justifyContent:Align_SpaceBetween5').fontSize(9).fontColor(0xCCCCCC).width('90%')
Flex({ direction: FlexDirection.Row, wrap: FlexWrap.NoWrap, justifyContent: FlexAlign.SpaceBetween }) {
Text('1').width(150).height(50).backgroundColor(0xF5DEB3).key('AlignSpaceBetween13')
Text('2').width(150).height(100).backgroundColor(0xD2B48C).key('AlignSpaceBetween14')
Text('3').width(150).height(150).backgroundColor(0xffa500).key('AlignSpaceBetween15')
}
.key('FlexAlignSpaceBetween5')
.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/SpaceBetween/FlexAlign_SpaceBetween_fixedChildParentPadding.ets
0 → 100644
浏览文件 @
3404a80b
/**
* 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_SpaceBetween_fixedChildParentPadding {
@State testPadding: number = 0
messageManager:MessageManager = new MessageManager()
private content: string = "FlexAlign_SpaceBetween_fixedChildParentPadding Page"
onPageShow() {
console.info('FlexAlign_SpaceBetween_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_SpaceBetween_fixedChildParentPadding page build done called');
}
build() {
Column() {
Text('justifyContent:Align_SpaceBetween3').fontSize(9).fontColor(0xCCCCCC).width('90%')
Flex({ direction: FlexDirection.Row, wrap: FlexWrap.NoWrap, justifyContent: FlexAlign.SpaceBetween }) {
Text('1').width(150).height(50).backgroundColor(0xF5DEB3).key('AlignSpaceBetween7')
Text('2').width(150).height(100).backgroundColor(0xD2B48C).key('AlignSpaceBetween8')
Text('3').width(150).height(150).backgroundColor(0xffa500).key('AlignSpaceBetween9')
}
.key('FlexAlignSpaceBetween3')
.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/SpaceBetween/FlexAlign_SpaceBetween_fixedParent.ets
0 → 100644
浏览文件 @
3404a80b
/**
* 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_SpaceBetween_fixedParent {
@State testOffsetX: number = 0
@State testOffsetY: number = 0
messageManager:MessageManager = new MessageManager()
private content: string = "FlexAlign_SpaceBetween_fixedParent Page"
onPageShow() {
console.info('FlexAlign_SpaceBetween_fixedParent 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 == 'x') {
this.testOffsetX = message.value;
}
if (message.name == 'y') {
this.testOffsetY = message.value;
}
}
this.messageManager.registerCallback(callback);
}
onBuildDone() {
console.info('FlexAlign_SpaceBetween_fixedParent page build done called');
}
build() {
Column() {
Text('justifyContent:Align_SpaceBetween9').fontSize(9).fontColor(0xCCCCCC).width('90%')
Flex({ justifyContent: FlexAlign.SpaceBetween }) {
Text('1').width(150).height(50).backgroundColor(0xF5DEB3).key('AlignSpaceBetween25')
.offset({ x: this.testOffsetX, y: this.testOffsetY })
Text('2').width(150).height(100).backgroundColor(0xD2B48C).key('AlignSpaceBetween26')
Text('3').width(150).height(150).backgroundColor(0xffa500).key('AlignSpaceBetween27')
}
.key('FlexAlignSpaceBetween9')
.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/SpaceBetween/FlexAlign_SpaceBetween_fixedParentChangeFirst.ets
0 → 100644
浏览文件 @
3404a80b
/**
* 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_SpaceBetween_fixedParentChangeFirst {
@State testFirstlayoutWeight: number = 0
@State testSecondlayoutWeight: number = 0
@State testThirdlayoutWeight: number = 0
messageManager:MessageManager = new MessageManager()
private content: string = "FlexAlign_SpaceBetween_fixedParentChangeFirst Page"
onPageShow() {
console.info('FlexAlign_SpaceBetween_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_SpaceBetween_fixedParentChangeFirst page build done called');
}
build() {
Column() {
Text('justifyContent:Align_SpaceBetween12').fontSize(9).fontColor(0xCCCCCC).width('90%')
Flex({ justifyContent: FlexAlign.SpaceBetween }) {
Text('1').width(150).height(50).backgroundColor(0xF5DEB3).key('AlignSpaceBetween34')
.layoutWeight(this.testFirstlayoutWeight)
Text('2').width(150).height(100).backgroundColor(0xD2B48C).key('AlignSpaceBetween35')
.layoutWeight(this.testSecondlayoutWeight)
Text('3').width(150).height(150).backgroundColor(0xffa500).key('AlignSpaceBetween36')
.layoutWeight(this.testThirdlayoutWeight)
}
.key('FlexAlignSpaceBetween12')
.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/SpaceBetween/FlexAlign_SpaceBetween_fixedParentChangeFirstWidth.ets
0 → 100644
浏览文件 @
3404a80b
/**
* 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_SpaceBetween_fixedParentChangeFirstWidth {
@State testWidth: number = 150
messageManager:MessageManager = new MessageManager()
private content: string = "FlexAlign_SpaceBetween_fixedParentChangeFirstWidth Page"
onPageShow() {
console.info('FlexAlign_SpaceBetween_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_SpaceBetween_fixedParentChangeFirstWidth page build done called');
}
build() {
Column() {
Text('justifyContent:Align_SpaceBetween13').fontSize(9).fontColor(0xCCCCCC).width('90%')
Flex({ justifyContent: FlexAlign.SpaceBetween }) {
Text('1').width(this.testWidth).height(50).backgroundColor(0xF5DEB3).key('AlignSpaceBetween37')
Text('2').width(150).height(100).backgroundColor(0xD2B48C).key('AlignSpaceBetween38')
Text('3').width(150).height(150).backgroundColor(0xffa500).key('AlignSpaceBetween39')
}
.key('FlexAlignSpaceBetween13')
.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/SpaceBetween/FlexAlign_SpaceBetween_fixedParentMarginFirst.ets
0 → 100644
浏览文件 @
3404a80b
/**
* 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_SpaceBetween_fixedParentMarginFirst {
@State testMargin: number = 0
messageManager:MessageManager = new MessageManager()
private content: string = "FlexAlign_SpaceBetween_fixedParentMarginFirst Page"
onPageShow() {
console.info('FlexAlign_SpaceBetween_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_SpaceBetween_fixedParentMarginFirst page build done called');
}
build() {
Column() {
Text('justifyContent:Align_SpaceBetween14').fontSize(9).fontColor(0xCCCCCC).width('90%')
Flex({ justifyContent: FlexAlign.SpaceBetween }) {
Text('1').width(150).height(50).backgroundColor(0xF5DEB3).key('AlignSpaceBetween40').margin(this.testMargin)
Text('2').width(150).height(100).backgroundColor(0xD2B48C).key('AlignSpaceBetween41')
Text('3').width(150).height(150).backgroundColor(0xffa500).key('AlignSpaceBetween42')
}
.key('FlexAlignSpaceBetween14')
.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/SpaceBetween/FlexAlign_SpaceBetween_fixedParentVisibility.ets
0 → 100644
浏览文件 @
3404a80b
/**
* 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_SpaceBetween_fixedParentVisibility {
@State testVisibility: number = Visibility.Visible
messageManager:MessageManager = new MessageManager()
private content: string = "FlexAlign_SpaceBetween_fixedParentVisibility Page"
onPageShow() {
console.info('FlexAlign_SpaceBetween_fixedParentVisibility 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 == 'visibility') {
this.testVisibility = message.value;
}
}
this.messageManager.registerCallback(callback);
}
onBuildDone() {
console.info('FlexAlign_SpaceBetween_fixedParentVisibility page build done called');
}
build() {
Column() {
Text('justifyContent:Align_SpaceBetween9').fontSize(9).fontColor(0xCCCCCC).width('90%')
Flex({ justifyContent: FlexAlign.SpaceBetween }) {
Text('1').width(150).height(50).backgroundColor(0xF5DEB3).key('AlignSpaceBetween28')
.visibility(this.testVisibility)
Text('2').width(150).height(100).backgroundColor(0xD2B48C).key('AlignSpaceBetween29')
Text('3').width(150).height(150).backgroundColor(0xffa500).key('AlignSpaceBetween30')
}
.key('FlexAlignSpaceBetween10')
.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/SpaceBetween/FlexAlign_SpaceBetween_fixedChild.test.ets
0 → 100644
浏览文件 @
3404a80b
/*
* 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_SpaceBetween_fixedChild() {
describe('FlexAlign_SpaceBetween_fixedChild', function () {
beforeEach(async function (done) {
console.info("FlexAlign_SpaceBetween_fixedChild beforeEach called");
let options = {
uri: 'MainAbility/pages/Flex/justifyContent/SpaceBetween/FlexAlign_SpaceBetween_fixedChild',
}
try {
router.clear();
await CommonFunc.sleep(1000);
let pages = router.getState();
console.info("get FlexAlign_SpaceBetween_fixedChild state pages:" + JSON.stringify(pages));
if (!("FlexAlign_SpaceBetween_fixedChild" == pages.name)) {
console.info("get FlexAlign_SpaceBetween_fixedChild state pages.name:" + JSON.stringify(pages.name));
let result = await router.push(options);
console.info("push FlexAlign_SpaceBetween_fixedChild page result:" + JSON.stringify(result));
}
} catch (err) {
console.error("push FlexAlign_SpaceBetween_fixedChild page error:" + JSON.stringify(err));
}
await CommonFunc.sleep(2000);
done()
});
afterEach(async function () {
await CommonFunc.sleep(1000);
console.info("FlexAlign_SpaceBetween_fixedChild afterEach called");
});
/**
* @tc.number SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_SPACEBETWEEN_TEST_0100
* @tc.name testAlignSpaceBetweenRowNoWrapParentWidthAndHeightOutRange
* @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('testAlignSpaceBetweenRowNoWrapParentWidthAndHeightOutRange', 0, async function (done) {
console.info('new testAlignSpaceBetweenRowNoWrapParentWidthAndHeightOutRange START');
globalThis.value.message.notify({name:'height', value:200})
globalThis.value.message.notify({name:'width', value:400})
await CommonFunc.sleep(3000);
let strJson = getInspectorByKey('FlexAlignSpaceBetween1');
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.SpaceBetween');
let locationText1 = CommonFunc.getComponentRect('AlignSpaceBetween1');
let locationText2 = CommonFunc.getComponentRect('AlignSpaceBetween2');
let locationText3 = CommonFunc.getComponentRect('AlignSpaceBetween3');
let locationFlex = CommonFunc.getComponentRect('FlexAlignSpaceBetween1');
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 testAlignSpaceBetweenRowNoWrapParentWidthAndHeightOutRange END');
done();
});
/**
* @tc.number SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_SPACEBETWEEN_TEST_0200
* @tc.name testAlignSpaceBetweenRowNoWrapParentWidthAndHeightInRange
* @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('testAlignSpaceBetweenRowNoWrapParentWidthAndHeightInRange', 0, async function (done) {
console.info('new testAlignSpaceBetweenRowNoWrapParentWidthAndHeightInRange START');
globalThis.value.message.notify({name:'height', value:200})
globalThis.value.message.notify({name:'width', value:500})
await CommonFunc.sleep(3000);
let strJson = getInspectorByKey('FlexAlignSpaceBetween1');
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.SpaceBetween');
let locationText1 = CommonFunc.getComponentRect('AlignSpaceBetween1');
let locationText2 = CommonFunc.getComponentRect('AlignSpaceBetween2');
let locationText3 = CommonFunc.getComponentRect('AlignSpaceBetween3');
let locationFlex = CommonFunc.getComponentRect('FlexAlignSpaceBetween1');
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(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(vp2px(150));
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)*10)/10);
console.info('new testAlignSpaceBetweenRowNoWrapParentWidthAndHeightInRange END');
done();
});
})
}
\ No newline at end of file
arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/SpaceBetween/FlexAlign_SpaceBetween_fixedChildParentItemAlignEnd.test.ets
0 → 100644
浏览文件 @
3404a80b
/*
* 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_SpaceBetween_fixedChildParentItemAlignEnd() {
describe('FlexAlign_SpaceBetween_fixedChildParentItemAlignEnd', function () {
beforeEach(async function (done) {
console.info("FlexAlign_SpaceBetween_fixedChildParentItemAlignEnd beforeEach called");
let options = {
uri: 'MainAbility/pages/Flex/justifyContent/SpaceBetween/FlexAlign_SpaceBetween_fixedChildParentItemAlignEnd',
}
try {
router.clear();
await CommonFunc.sleep(1000);
let pages = router.getState();
console.info("get FlexAlign_SpaceBetween_fixedChildParentItemAlignEnd state pages:" + JSON.stringify(pages));
if (!("FlexAlign_SpaceBetween_fixedChildParentItemAlignEnd" == pages.name)) {
console.info("get FlexAlign_SpaceBetween_fixedChildParentItemAlignEnd pages.name:" + JSON.stringify(pages.name));
let result = await router.push(options);
console.info("push FlexAlign_SpaceBetween_fixedChildParentItemAlignEnd page result:" + JSON.stringify(result));
}
} catch (err) {
console.error("push FlexAlign_SpaceBetween_fixedChildParentItemAlignEnd page error:" + JSON.stringify(err));
}
await CommonFunc.sleep(2000);
done()
});
afterEach(async function () {
await CommonFunc.sleep(1000);
console.info("FlexAlign_SpaceBetween_fixedChildParentItemAlignEnd afterEach called");
});
/**
* @tc.number SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_SPACEBETWEEN_TEST_0800
* @tc.name testAlignSpaceBetweenRowNoWrapAlignmentBottomEnd
* @tc.desc The child component is fixed, and the parent component is bound with Alignment.BottomEnd attributes
*/
it('testAlignSpaceBetweenRowNoWrapAlignmentBottomEnd', 0, async function (done) {
console.info('new testAlignSpaceBetweenRowNoWrapAlignmentBottomEnd START');
globalThis.value.message.notify({name:'height', value:200})
globalThis.value.message.notify({name:'width', value:500})
await CommonFunc.sleep(3000);
let strJson = getInspectorByKey('FlexAlignSpaceBetween8');
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.SpaceBetween');
let locationText1 = CommonFunc.getComponentRect('AlignSpaceBetween22');
let locationText2 = CommonFunc.getComponentRect('AlignSpaceBetween23');
let locationText3 = CommonFunc.getComponentRect('AlignSpaceBetween24');
let locationFlex = CommonFunc.getComponentRect('FlexAlignSpaceBetween8');
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(locationText1.left).assertEqual(locationFlex.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(vp2px(150));
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)*10)/10);
console.info('new testAlignSpaceBetweenRowNoWrapAlignmentBottomEnd END');
done();
});
})
}
\ No newline at end of file
arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/SpaceBetween/FlexAlign_SpaceBetween_fixedChildParentMarPad.test.ets
0 → 100644
浏览文件 @
3404a80b
/*
* 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_SpaceBetween_fixedChildParentMarPad() {
describe('FlexAlign_SpaceBetween_fixedChildParentMarPad', function () {
beforeEach(async function (done) {
console.info("FlexAlign_SpaceBetween_fixedChildParentMarPad beforeEach called");
let options = {
uri: 'MainAbility/pages/Flex/justifyContent/SpaceBetween/FlexAlign_SpaceBetween_fixedChildParentMarPad',
}
try {
router.clear();
await CommonFunc.sleep(1000);
let pages = router.getState();
console.info("get FlexAlign_SpaceBetween_fixedChildParentMarPad state pages:" + JSON.stringify(pages));
if (!("FlexAlign_SpaceBetween_fixedChildParentMarPad" == pages.name)) {
console.info("get FlexAlign_SpaceBetween_fixedChildParentMarPad state pages.name:" + JSON.stringify(pages.name));
let result = await router.push(options);
console.info("push FlexAlign_SpaceBetween_fixedChildParentMarPad page result:" + JSON.stringify(result));
}
} catch (err) {
console.error("push FlexAlign_SpaceBetween_fixedChildParentMarPad page error:" + JSON.stringify(err));
}
await CommonFunc.sleep(2000);
done()
});
afterEach(async function () {
await CommonFunc.sleep(1000);
console.info("FlexAlign_SpaceBetween_fixedChildParentMarPad afterEach called");
});
/**
* @tc.number SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_SPACEBETWEEN_TEST_0600
* @tc.name testAlignSpaceBetweenRowNoWrapMarPadOutRange
* @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('testAlignSpaceBetweenRowNoWrapMarPadOutRange', 0, async function (done) {
console.info('new testAlignSpaceBetweenRowNoWrapMarPadOutRange START');
globalThis.value.message.notify({name:'margin', value:20})
globalThis.value.message.notify({name:'padding', value:50})
await CommonFunc.sleep(3000);
let strJson = getInspectorByKey('FlexAlignSpaceBetween6');
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.SpaceBetween');
let locationText1 = CommonFunc.getComponentRect('AlignSpaceBetween16');
let locationText2 = CommonFunc.getComponentRect('AlignSpaceBetween17');
let locationText3 = CommonFunc.getComponentRect('AlignSpaceBetween18');
let locationFlex = CommonFunc.getComponentRect('FlexAlignSpaceBetween6');
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 testAlignSpaceBetweenRowNoWrapMarPadOutRange END');
done();
});
/**
* @tc.number SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_SPACEBETWEEN_TEST_0700
* @tc.name testAlignSpaceBetweenRowNoWrapMarPadInRange
* @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('testAlignSpaceBetweenRowNoWrapMarPadInRange', 0, async function (done) {
console.info('new testAlignSpaceBetweenRowNoWrapMarPadInRange START');
globalThis.value.message.notify({name:'margin', value:20})
globalThis.value.message.notify({name:'padding', value:5})
await CommonFunc.sleep(3000);
let strJson = getInspectorByKey('FlexAlignSpaceBetween6');
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.SpaceBetween');
let locationText1 = CommonFunc.getComponentRect('AlignSpaceBetween16');
let locationText2 = CommonFunc.getComponentRect('AlignSpaceBetween17');
let locationText3 = CommonFunc.getComponentRect('AlignSpaceBetween18');
let locationFlex = CommonFunc.getComponentRect('FlexAlignSpaceBetween6');
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.left - locationFlex.left)*10)/10).assertEqual(Math.round(vp2px(5)*10)/10);
expect(Math.round((locationText3.right)*10)/10).assertEqual(Math.round((locationFlex.right - vp2px(5))*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(vp2px(20));
console.info('new testAlignSpaceBetweenRowNoWrapMarPadInRange END');
done();
});
})
}
\ No newline at end of file
arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/SpaceBetween/FlexAlign_SpaceBetween_fixedChildParentMargin.test.ets
0 → 100644
浏览文件 @
3404a80b
/*
* 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_SpaceBetween_fixedChildParentMargin() {
describe('FlexAlign_SpaceBetween_fixedChildParentMargin', function () {
beforeEach(async function (done) {
console.info("FlexAlign_SpaceBetween_fixedChildParentMargin beforeEach called");
let options = {
uri: 'MainAbility/pages/Flex/justifyContent/SpaceBetween/FlexAlign_SpaceBetween_fixedChildParentMargin',
}
try {
router.clear();
await CommonFunc.sleep(1000);
let pages = router.getState();
console.info("get FlexAlign_SpaceBetween_fixedChildParentMargin state pages:" + JSON.stringify(pages));
if (!("FlexAlign_SpaceBetween_fixedChildParentMargin" == pages.name)) {
console.info("get FlexAlign_SpaceBetween_fixedChildParentMargin pages.name:" + JSON.stringify(pages.name));
let result = await router.push(options);
console.info("push FlexAlign_SpaceBetween_fixedChildParentMargin page result:" + JSON.stringify(result));
}
} catch (err) {
console.error("push FlexAlign_SpaceBetween_fixedChildParentMargin page error:" + JSON.stringify(err));
}
await CommonFunc.sleep(2000);
done()
});
afterEach(async function () {
await CommonFunc.sleep(1000);
console.info("FlexAlign_SpaceBetween_fixedChildParentMargin afterEach called");
});
/**
* @tc.number SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_SPACEBETWEEN_TEST_0500
* @tc.name testAlignSpaceBetweenRowNoWrapMargin
* @tc.desc The child component is fixed, and the parent component is bound with margin attributes
*/
it('testAlignSpaceBetweenRowNoWrapMargin', 0, async function (done) {
console.info('new testAlignSpaceBetweenRowNoWrapMargin START');
globalThis.value.message.notify({name:'margin', value:20})
await CommonFunc.sleep(3000);
let strJson = getInspectorByKey('FlexAlignSpaceBetween5');
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.SpaceBetween');
let locationText1 = CommonFunc.getComponentRect('AlignSpaceBetween13');
let locationText2 = CommonFunc.getComponentRect('AlignSpaceBetween14');
let locationText3 = CommonFunc.getComponentRect('AlignSpaceBetween15');
let locationFlex = CommonFunc.getComponentRect('FlexAlignSpaceBetween5');
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(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(vp2px(150));
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)*10)/10);
console.info('new testAlignSpaceBetweenRowNoWrapMargin END');
done();
});
})
}
\ No newline at end of file
arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/SpaceBetween/FlexAlign_SpaceBetween_fixedChildParentPadding.test.ets
0 → 100644
浏览文件 @
3404a80b
/*
* 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_SpaceBetween_fixedChildParentPadding() {
describe('FlexAlign_SpaceBetween_fixedChildParentPadding', function () {
beforeEach(async function (done) {
console.info("FlexAlign_SpaceBetween_fixedChildParentPadding beforeEach called");
let options = {
uri: 'MainAbility/pages/Flex/justifyContent/SpaceBetween/FlexAlign_SpaceBetween_fixedChildParentPadding',
}
try {
router.clear();
await CommonFunc.sleep(1000);
let pages = router.getState();
console.info("get FlexAlign_SpaceBetween_fixedChildParentPadding state pages:" + JSON.stringify(pages));
if (!("FlexAlign_SpaceBetween_fixedChildParentPadding" == pages.name)) {
console.info("get FlexAlign_SpaceBetween_fixedChildParentPadding pages.name:" + JSON.stringify(pages.name));
let result = await router.push(options);
console.info("push FlexAlign_SpaceBetween_fixedChildParentPadding page result:" + JSON.stringify(result));
}
} catch (err) {
console.error("push FlexAlign_SpaceBetween_fixedChildParentPadding page error:" + JSON.stringify(err));
}
await CommonFunc.sleep(2000);
done()
});
afterEach(async function () {
await CommonFunc.sleep(1000);
console.info("FlexAlign_SpaceBetween_fixedChildParentPadding afterEach called");
});
/**
* @tc.number SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_SPACEBETWEEN_TEST_0300
* @tc.name testAlignSpaceBetweenRowNoWrapPaddingOutRange
* @tc.desc The child component is fixed, and parent component is bound with padding attributes, the layout
* space of parent component is insufficient to meet the spindle layout requirements of child component
*/
it('testAlignSpaceBetweenRowNoWrapPaddingOutRange', 0, async function (done) {
console.info('new testAlignSpaceBetweenRowNoWrapPaddingOutRange START');
globalThis.value.message.notify({name:'padding', value:50})
await CommonFunc.sleep(3000);
let strJson = getInspectorByKey('FlexAlignSpaceBetween3');
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.SpaceBetween');
let locationText1 = CommonFunc.getComponentRect('AlignSpaceBetween7');
let locationText2 = CommonFunc.getComponentRect('AlignSpaceBetween8');
let locationText3 = CommonFunc.getComponentRect('AlignSpaceBetween9');
let locationFlex = CommonFunc.getComponentRect('FlexAlignSpaceBetween3');
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(Math.round(locationFlex.right - locationText3.right)).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(Math.round(vp2px(400/3)));
console.info('new testAlignSpaceBetweenRowNoWrapPaddingOutRange END');
done();
});
/**
* @tc.number SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_SPACEBETWEEN_TEST_0400
* @tc.name testAlignSpaceBetweenRowNoWrapPaddingInRange
* @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('testAlignSpaceBetweenRowNoWrapPaddingInRange', 0, async function (done) {
console.info('new testAlignSpaceBetweenRowNoWrapPaddingInRange START');
globalThis.value.message.notify({name:'padding', value:5})
await CommonFunc.sleep(3000);
let strJson = getInspectorByKey('FlexAlignSpaceBetween3');
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.SpaceBetween');
let locationText1 = CommonFunc.getComponentRect('AlignSpaceBetween7');
let locationText2 = CommonFunc.getComponentRect('AlignSpaceBetween8');
let locationText3 = CommonFunc.getComponentRect('AlignSpaceBetween9');
let locationFlex = CommonFunc.getComponentRect('FlexAlignSpaceBetween3');
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.left - locationFlex.left)*10)/10).assertEqual(Math.round(vp2px(5)*10)/10);
expect(Math.round((locationText3.right)*10)/10).assertEqual(Math.round((locationFlex.right - vp2px(5))*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(vp2px(20));
console.info('new testAlignSpaceBetweenRowNoWrapPaddingInRange END');
done();
});
})
}
\ No newline at end of file
arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/SpaceBetween/FlexAlign_SpaceBetween_fixedParent.test.ets
0 → 100644
浏览文件 @
3404a80b
/*
* 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_SpaceBetween_fixedParent() {
describe('FlexAlign_SpaceBetween_fixedParent', function () {
beforeEach(async function (done) {
console.info("FlexAlign_SpaceBetween_fixedParent beforeEach called");
let options = {
uri: 'MainAbility/pages/Flex/justifyContent/SpaceBetween/FlexAlign_SpaceBetween_fixedParent',
}
try {
router.clear();
await CommonFunc.sleep(1000);
let pages = router.getState();
console.info("get FlexAlign_SpaceBetween_fixedParent state pages:" + JSON.stringify(pages));
if (!("FlexAlign_SpaceBetween_fixedParent" == pages.name)) {
console.info("get FlexAlign_SpaceBetween_fixedParent state pages.name:" + JSON.stringify(pages.name));
let result = await router.push(options);
console.info("push FlexAlign_SpaceBetween_fixedParent page result:" + JSON.stringify(result));
}
} catch (err) {
console.error("push FlexAlign_SpaceBetween_fixedParent page error:" + JSON.stringify(err));
}
await CommonFunc.sleep(2000);
done()
});
afterEach(async function () {
await CommonFunc.sleep(1000);
console.info("FlexAlign_SpaceBetween_fixedParent afterEach called");
});
/**
* @tc.number SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_SPACEBETWEEN_TEST_0900
* @tc.name testAlignSpaceBetweenRowNoWrapOffset
* @tc.desc Parent component fixed, child component binding offset properties
*/
it('testAlignSpaceBetweenRowNoWrapOffset', 0, async function (done) {
console.info('new testAlignSpaceBetweenRowNoWrapOffset START');
globalThis.value.message.notify({name:'x', value:15})
globalThis.value.message.notify({name:'y', value:30})
await CommonFunc.sleep(3000);
let strJson = getInspectorByKey('FlexAlignSpaceBetween9');
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.SpaceBetween');
let strJson2 = getInspectorByKey('AlignSpaceBetween25');
let obj2 = JSON.parse(strJson2);
expect(obj2.$attrs.visibility).assertEqual('Visibility.Visible');
let locationText1 = CommonFunc.getComponentRect('AlignSpaceBetween25');
let locationText2 = CommonFunc.getComponentRect('AlignSpaceBetween26');
let locationText3 = CommonFunc.getComponentRect('AlignSpaceBetween27');
let locationFlex = CommonFunc.getComponentRect('FlexAlignSpaceBetween9');
expect(Math.round(locationText1.top - locationFlex.top)).assertEqual(vp2px(30))
expect(Math.round((locationText1.left - locationFlex.left)*10)/10).assertEqual(Math.round(vp2px(15)*10)/10)
expect(locationText2.top).assertEqual(locationText3.top);
expect(Math.round(locationText3.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(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(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((locationText3.left - locationText2.right)*10)/10).assertEqual(Math.round(vp2px(25)*10)/10);
console.info('new testAlignSpaceBetweenRowNoWrapOffset END');
done();
});
})
}
\ No newline at end of file
arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/SpaceBetween/FlexAlign_SpaceBetween_fixedParentChangeFirst.test.ets
0 → 100644
浏览文件 @
3404a80b
/*
* 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_SpaceBetween_fixedParentChangeFirst() {
describe('FlexAlign_SpaceBetween_fixedParentChangeFirst', function () {
beforeEach(async function (done) {
console.info("FlexAlign_SpaceBetween_fixedParentChangeFirst beforeEach called");
let options = {
uri: 'MainAbility/pages/Flex/justifyContent/SpaceBetween/FlexAlign_SpaceBetween_fixedParentChangeFirst',
}
try {
router.clear();
await CommonFunc.sleep(1000);
let pages = router.getState();
console.info("get FlexAlign_SpaceBetween_fixedParentChangeFirst state pages:" + JSON.stringify(pages));
if (!("FlexAlign_SpaceBetween_fixedParentChangeFirst" == pages.name)) {
console.info("get FlexAlign_SpaceBetween_fixedParentChangeFirst state pages.name:" + JSON.stringify(pages.name));
let result = await router.push(options);
console.info("push FlexAlign_SpaceBetween_fixedParentChangeFirst page result:" + JSON.stringify(result));
}
} catch (err) {
console.error("push FlexAlign_SpaceBetween_fixedParentChangeFirst page error:" + JSON.stringify(err));
}
await CommonFunc.sleep(2000);
done()
});
afterEach(async function () {
await CommonFunc.sleep(1000);
console.info("FlexAlign_SpaceBetween_fixedParentChangeFirst afterEach called");
});
/**
* @tc.number SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_SPACEBETWEEN_TEST_1200
* @tc.name testAlignSpaceBetweenRowNoWrapChangeFirstLayoutWeight122
* @tc.desc Parent component fixed, child component binding layoutWeight first1 second2 third2 properties
*/
it('testAlignSpaceBetweenRowNoWrapChangeFirstLayoutWeight122', 0, async function (done) {
console.info('new testAlignSpaceBetweenRowNoWrapChangeFirstLayoutWeight122 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('FlexAlignSpaceBetween12');
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.SpaceBetween');
let locationText1 = CommonFunc.getComponentRect('AlignSpaceBetween34');
let locationText2 = CommonFunc.getComponentRect('AlignSpaceBetween35');
let locationText3 = CommonFunc.getComponentRect('AlignSpaceBetween36');
let locationFlex = CommonFunc.getComponentRect('FlexAlignSpaceBetween12');
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.left - locationFlex.left)).assertEqual(vp2px(0));
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(locationText2.right - locationText2.left)).assertEqual(vp2px(200));
expect(Math.round(locationText3.right - locationText3.left)).assertEqual(vp2px(200));
console.info('new testAlignSpaceBetweenRowNoWrapChangeFirstLayoutWeight122 END');
done();
});
/**
* @tc.number SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_SPACEBETWEEN_TEST_1600
* @tc.name testAlignSpaceBetweenRowNoWrapChangeFirstLayoutWeight120
* @tc.desc Parent component fixed, child component binding layoutWeight first1 second2 third0 properties
*/
it('testAlignSpaceBetweenRowNoWrapChangeFirstLayoutWeight120', 0, async function (done) {
console.info('new testAlignSpaceBetweenRowNoWrapChangeFirstLayoutWeight120 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('FlexAlignSpaceBetween12');
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.SpaceBetween');
let locationText1 = CommonFunc.getComponentRect('AlignSpaceBetween34');
let locationText2 = CommonFunc.getComponentRect('AlignSpaceBetween35');
let locationText3 = CommonFunc.getComponentRect('AlignSpaceBetween36');
let locationFlex = CommonFunc.getComponentRect('FlexAlignSpaceBetween12');
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.left - locationFlex.left)).assertEqual(vp2px(0));
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)*10)/10).assertEqual(Math.round(vp2px(350/3)*10)/10);
expect(Math.round((locationText2.right - locationText2.left)*10)/10).assertEqual(Math.round(vp2px(700/3)*10)/10);
expect(Math.round(locationText3.right - locationText3.left)).assertEqual(vp2px(150));
console.info('new testAlignSpaceBetweenRowNoWrapChangeFirstLayoutWeight120 END');
done();
});
})
}
\ No newline at end of file
arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/SpaceBetween/FlexAlign_SpaceBetween_fixedParentChangeFirstWidth.test.ets
0 → 100644
浏览文件 @
3404a80b
/*
* 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_SpaceBetween_fixedParentChangeFirstWidth() {
describe('FlexAlign_SpaceBetween_fixedParentChangeFirstWidth', function () {
beforeEach(async function (done) {
console.info("FlexAlign_SpaceBetween_fixedParentChangeFirstWidth beforeEach called");
let options = {
uri: 'MainAbility/pages/Flex/justifyContent/SpaceBetween/FlexAlign_SpaceBetween_fixedParentChangeFirstWidth',
}
try {
router.clear();
await CommonFunc.sleep(1000);
let pages = router.getState();
console.info("get FlexAlign_SpaceBetween_fixedParentChangeFirstWidth state pages:" + JSON.stringify(pages));
if (!("FlexAlign_SpaceBetween_fixedParentChangeFirstWidth" == pages.name)) {
console.info("get FlexAlign_SpaceBetween_fixedParentChangeFirstWidth pages.name:" + JSON.stringify(pages.name));
let result = await router.push(options);
console.info("push FlexAlign_SpaceBetween_fixedParentChangeFirstWidth page result:" + JSON.stringify(result));
}
} catch (err) {
console.error("push FlexAlign_SpaceBetween_fixedParentChangeFirstWidth page error:" + JSON.stringify(err));
}
await CommonFunc.sleep(2000);
done()
});
afterEach(async function () {
await CommonFunc.sleep(1000);
console.info("FlexAlign_SpaceBetween_fixedParentChangeFirstWidth afterEach called");
});
/**
* @tc.number SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_SPACEBETWEEN_TEST_1300
* @tc.name testAlignSpaceBetweenRowNoWrapChangeFirstWidth
* @tc.desc Parent component fixed, child component binding width properties
*/
it('testAlignSpaceBetweenRowNoWrapChangeFirstWidth', 0, async function (done) {
console.info('new testAlignSpaceBetweenRowNoWrapChangeFirstWidth START');
globalThis.value.message.notify({name:'width', value:175})
await CommonFunc.sleep(3000);
let strJson = getInspectorByKey('FlexAlignSpaceBetween13');
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.SpaceBetween');
let locationText1 = CommonFunc.getComponentRect('AlignSpaceBetween37');
let locationText2 = CommonFunc.getComponentRect('AlignSpaceBetween38');
let locationText3 = CommonFunc.getComponentRect('AlignSpaceBetween39');
let locationFlex = CommonFunc.getComponentRect('FlexAlignSpaceBetween13');
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.left - locationFlex.left)).assertEqual(vp2px(0));
expect(Math.round(locationText2.left - locationText1.right))
.assertEqual(Math.round(locationText3.left - locationText2.right));
expect(Math.round((locationText2.left - locationText1.right)*100)/100)
.assertEqual(Math.round((vp2px(12.5))*100)/100);
expect(locationText3.right).assertEqual(locationFlex.right);
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);
console.info('new testAlignSpaceBetweenRowNoWrapChangeFirstWidth END');
done();
});
})
}
\ No newline at end of file
arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/SpaceBetween/FlexAlign_SpaceBetween_fixedParentMarginFirst.test.ets
0 → 100644
浏览文件 @
3404a80b
/*
* 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_SpaceBetween_fixedParentMarginFirst() {
describe('FlexAlign_SpaceBetween_fixedParentMarginFirst', function () {
beforeEach(async function (done) {
console.info("FlexAlign_SpaceBetween_fixedParentMarginFirst beforeEach called");
let options = {
uri: 'MainAbility/pages/Flex/justifyContent/SpaceBetween/FlexAlign_SpaceBetween_fixedParentMarginFirst',
}
try {
router.clear();
await CommonFunc.sleep(1000);
let pages = router.getState();
console.info("get FlexAlign_SpaceBetween_fixedParentMarginFirst state pages:" + JSON.stringify(pages));
if (!("FlexAlign_SpaceBetween_fixedParentMarginFirst" == pages.name)) {
console.info("get FlexAlign_SpaceBetween_fixedParentMarginFirst state pages.name:" + JSON.stringify(pages.name));
let result = await router.push(options);
console.info("push FlexAlign_SpaceBetween_fixedParentMarginFirst page result:" + JSON.stringify(result));
}
} catch (err) {
console.error("push FlexAlign_SpaceBetween_fixedParentMarginFirst page error:" + JSON.stringify(err));
}
await CommonFunc.sleep(2000);
done()
});
afterEach(async function () {
await CommonFunc.sleep(1000);
console.info("FlexAlign_SpaceBetween_fixedParentMarginFirst afterEach called");
});
/**
* @tc.number SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_SPACEBETWEEN_TEST_1400
* @tc.name testAlignSpaceBetweenRowNoWrapMarginFirstInRange
* @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('testAlignSpaceBetweenRowNoWrapMarginFirstInRange', 0, async function (done) {
console.info('new testAlignSpaceBetweenRowNoWrapMarginFirstInRange START');
globalThis.value.message.notify({name:'margin', value:20})
await CommonFunc.sleep(3000);
let strJson = getInspectorByKey('FlexAlignSpaceBetween14');
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.SpaceBetween');
let locationText1 = CommonFunc.getComponentRect('AlignSpaceBetween40');
let locationText2 = CommonFunc.getComponentRect('AlignSpaceBetween41');
let locationText3 = CommonFunc.getComponentRect('AlignSpaceBetween42');
let locationFlex = CommonFunc.getComponentRect('FlexAlignSpaceBetween14');
expect(Math.round(locationText1.top - locationFlex.top)).assertEqual(vp2px(20))
expect(Math.round(locationText1.left - locationFlex.left)).assertEqual(vp2px(20))
expect(locationText2.top).assertEqual(locationText3.top);
expect(Math.round(locationText3.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(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(vp2px(150));
expect(Math.round((locationText2.left - locationText1.right)*10)/10).assertEqual(Math.round(vp2px(25)*10)/10);
expect(Math.round((locationText3.left - locationText2.right)*10)/10).assertEqual(Math.round(vp2px(5)*10)/10);
console.info('new testAlignSpaceBetweenRowNoWrapMarginFirstInRange END');
done();
});
/**
* @tc.number SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_SPACEBETWEEN_TEST_1500
* @tc.name testAlignSpaceBetweenRowNoWrapMarginFirstOutRange
* @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('testAlignSpaceBetweenRowNoWrapMarginFirstOutRange', 0, async function (done) {
console.info('new testAlignSpaceBetweenRowNoWrapMarginFirstOutRange START');
globalThis.value.message.notify({name:'margin', value:50})
await CommonFunc.sleep(3000);
let strJson = getInspectorByKey('FlexAlignSpaceBetween14');
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.SpaceBetween');
let locationText1 = CommonFunc.getComponentRect('AlignSpaceBetween40');
let locationText2 = CommonFunc.getComponentRect('AlignSpaceBetween41');
let locationText3 = CommonFunc.getComponentRect('AlignSpaceBetween42');
let locationFlex = CommonFunc.getComponentRect('FlexAlignSpaceBetween14');
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(Math.round(locationText3.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(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 testAlignSpaceBetweenRowNoWrapMarginFirstOutRange END');
done();
});
})
}
\ No newline at end of file
arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/SpaceBetween/FlexAlign_SpaceBetween_fixedParentVisibility.test.ets
0 → 100644
浏览文件 @
3404a80b
/*
* 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_SpaceBetween_fixedParentVisibility() {
describe('FlexAlign_SpaceBetween_fixedParentVisibility', function () {
beforeEach(async function (done) {
console.info("FlexAlign_SpaceBetween_fixedParentVisibility beforeEach called");
let options = {
uri: 'MainAbility/pages/Flex/justifyContent/SpaceBetween/FlexAlign_SpaceBetween_fixedParentVisibility',
}
try {
router.clear();
await CommonFunc.sleep(1000);
let pages = router.getState();
console.info("get FlexAlign_SpaceBetween_fixedParentVisibility state pages:" + JSON.stringify(pages));
if (!("FlexAlign_SpaceBetween_fixedParentVisibility" == pages.name)) {
console.info("get FlexAlign_SpaceBetween_fixedParentVisibility state pages.name:" + JSON.stringify(pages.name));
let result = await router.push(options);
console.info("push FlexAlign_SpaceBetween_fixedParentVisibility page result:" + JSON.stringify(result));
}
} catch (err) {
console.error("push FlexAlign_SpaceBetween_fixedParentVisibility page error:" + JSON.stringify(err));
}
await CommonFunc.sleep(2000);
done()
});
afterEach(async function () {
await CommonFunc.sleep(1000);
console.info("FlexAlign_SpaceBetween_fixedParentVisibility afterEach called");
});
/**
* @tc.number SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_SPACEBETWEEN_TEST_1000
* @tc.name testAlignSpaceBetweenRowNoWrapVisibilityNone
* @tc.desc Parent component fixed, child component binding visibility none properties
*/
it('testAlignSpaceBetweenRowNoWrapVisibilityNone', 0, async function (done) {
console.info('new testAlignSpaceBetweenRowNoWrapVisibilityNone START');
globalThis.value.message.notify({name:'visibility', value:Visibility.None})
await CommonFunc.sleep(3000);
let strJson = getInspectorByKey('FlexAlignSpaceBetween10');
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.SpaceBetween');
let strJson2 = getInspectorByKey('AlignSpaceBetween28');
let obj2 = JSON.parse(strJson2);
expect(obj2.$attrs.visibility).assertEqual('Visibility.None');
let locationText1 = CommonFunc.getComponentRect('AlignSpaceBetween28');
let locationText2 = CommonFunc.getComponentRect('AlignSpaceBetween29');
let locationText3 = CommonFunc.getComponentRect('AlignSpaceBetween30');
let locationFlex = CommonFunc.getComponentRect('FlexAlignSpaceBetween10');
expect(locationText1.top).assertEqual(locationText2.top);
expect(locationText2.top).assertEqual(locationText3.top);
expect(Math.round(locationText2.top - locationFlex.top)).assertEqual(vp2px(0));
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(0));
expect(locationText3.right).assertEqual(locationFlex.right);
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(200));
console.info('new testAlignSpaceBetweenRowNoWrapVisibilityNone END');
done();
});
/**
* @tc.number SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_SPACEBETWEEN_TEST_1100
* @tc.name testAlignSpaceBetweenRowNoWrapVisibilityHidden
* @tc.desc Parent component fixed, child component binding visibility hidden properties
*/
it('testAlignSpaceBetweenRowNoWrapVisibilityHidden', 0, async function (done) {
console.info('new testAlignSpaceBetweenRowNoWrapVisibilityHidden START');
globalThis.value.message.notify({name:'visibility', value:Visibility.Hidden})
await CommonFunc.sleep(3000);
let strJson = getInspectorByKey('FlexAlignSpaceBetween10');
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.SpaceBetween');
let strJson2 = getInspectorByKey('AlignSpaceBetween28');
let obj2 = JSON.parse(strJson2);
expect(obj2.$attrs.visibility).assertEqual('Visibility.Hidden');
let locationText1 = CommonFunc.getComponentRect('AlignSpaceBetween28');
let locationText2 = CommonFunc.getComponentRect('AlignSpaceBetween29');
let locationText3 = CommonFunc.getComponentRect('AlignSpaceBetween30');
let locationFlex = CommonFunc.getComponentRect('FlexAlignSpaceBetween10');
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(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(vp2px(150));
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)*10)/10);
console.info('new testAlignSpaceBetweenRowNoWrapVisibilityHidden 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.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录