Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
f6c49113
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看板
提交
f6c49113
编写于
2月 07, 2023
作者:
E
e
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
添加flex_End用例
Signed-off-by:
N
e
<
qianwangdq@isoftstone.com
>
上级
00bec899
变更
20
隐藏空白更改
内联
并排
Showing
20 changed file
with
1543 addition
and
0 deletion
+1543
-0
arkui/ace_ets_layout_test/entry/src/main/ets/MainAbility/pages/Flex/justifyContent/End/AlignEnd_AddAlign.ets
...ility/pages/Flex/justifyContent/End/AlignEnd_AddAlign.ets
+53
-0
arkui/ace_ets_layout_test/entry/src/main/ets/MainAbility/pages/Flex/justifyContent/End/AlignEnd_AddAllSpace.ets
...ty/pages/Flex/justifyContent/End/AlignEnd_AddAllSpace.ets
+56
-0
arkui/ace_ets_layout_test/entry/src/main/ets/MainAbility/pages/Flex/justifyContent/End/AlignEnd_AddLayoutWeight.ets
...ages/Flex/justifyContent/End/AlignEnd_AddLayoutWeight.ets
+55
-0
arkui/ace_ets_layout_test/entry/src/main/ets/MainAbility/pages/Flex/justifyContent/End/AlignEnd_AddMargin.ets
...lity/pages/Flex/justifyContent/End/AlignEnd_AddMargin.ets
+55
-0
arkui/ace_ets_layout_test/entry/src/main/ets/MainAbility/pages/Flex/justifyContent/End/AlignEnd_AddOffset.ets
...lity/pages/Flex/justifyContent/End/AlignEnd_AddOffset.ets
+52
-0
arkui/ace_ets_layout_test/entry/src/main/ets/MainAbility/pages/Flex/justifyContent/End/AlignEnd_AddOneMargin.ets
...y/pages/Flex/justifyContent/End/AlignEnd_AddOneMargin.ets
+56
-0
arkui/ace_ets_layout_test/entry/src/main/ets/MainAbility/pages/Flex/justifyContent/End/AlignEnd_AddOneWidth.ets
...ty/pages/Flex/justifyContent/End/AlignEnd_AddOneWidth.ets
+51
-0
arkui/ace_ets_layout_test/entry/src/main/ets/MainAbility/pages/Flex/justifyContent/End/AlignEnd_AddPadding.ets
...ity/pages/Flex/justifyContent/End/AlignEnd_AddPadding.ets
+52
-0
arkui/ace_ets_layout_test/entry/src/main/ets/MainAbility/pages/Flex/justifyContent/End/AlignEnd_AddVisibility.ets
.../pages/Flex/justifyContent/End/AlignEnd_AddVisibility.ets
+55
-0
arkui/ace_ets_layout_test/entry/src/main/ets/MainAbility/pages/Flex/justifyContent/End/AlignEnd_NoSpace.ets
...bility/pages/Flex/justifyContent/End/AlignEnd_NoSpace.ets
+50
-0
arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/End/AlignEnd_AddAlign.test.ets
...s/test/Flex/justifyContent/End/AlignEnd_AddAlign.test.ets
+83
-0
arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/End/AlignEnd_AddAllSpace.test.ets
...est/Flex/justifyContent/End/AlignEnd_AddAllSpace.test.ets
+122
-0
arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/End/AlignEnd_AddLayoutWeight.test.ets
...Flex/justifyContent/End/AlignEnd_AddLayoutWeight.test.ets
+83
-0
arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/End/AlignEnd_AddMargin.test.ets
.../test/Flex/justifyContent/End/AlignEnd_AddMargin.test.ets
+85
-0
arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/End/AlignEnd_AddOffset.test.ets
.../test/Flex/justifyContent/End/AlignEnd_AddOffset.test.ets
+83
-0
arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/End/AlignEnd_AddOneMargin.test.ets
...st/Flex/justifyContent/End/AlignEnd_AddOneMargin.test.ets
+117
-0
arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/End/AlignEnd_AddOneWidth.test.ets
...est/Flex/justifyContent/End/AlignEnd_AddOneWidth.test.ets
+83
-0
arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/End/AlignEnd_AddPadding.test.ets
...test/Flex/justifyContent/End/AlignEnd_AddPadding.test.ets
+117
-0
arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/End/AlignEnd_AddVisibility.test.ets
...t/Flex/justifyContent/End/AlignEnd_AddVisibility.test.ets
+118
-0
arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/End/AlignEnd_NoSpace.test.ets
...ts/test/Flex/justifyContent/End/AlignEnd_NoSpace.test.ets
+117
-0
未找到文件。
arkui/ace_ets_layout_test/entry/src/main/ets/MainAbility/pages/Flex/justifyContent/End/AlignEnd_AddAlign.ets
0 → 100644
浏览文件 @
f6c49113
/*
* Copyright (c) 2023-2030 iSoftStone Information Technology (Group) Co.,Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import {MessageManager,Callback} from './../../../../common/MessageManager';
@Entry
@Component
struct AlignEnd_AddAlign {
@State DadAddAlign: number = Alignment.TopStart
messageManager:MessageManager = new MessageManager()
onPageShow() {
console.info('AlignSpaceEvenly_AddAlign onPageShow');
globalThis.value = {
name:'messageManager',message:this.messageManager
}
let callback:Callback = (message:any) => {
console.error('message = ' + message.name + "--" + message.value);
if (message.name == 'DadAddAlign') {
this.DadAddAlign = message.value;
}
}
this.messageManager.registerCallback(callback);
}
@State justifyContent: FlexAlign = FlexAlign.End
build() {
Column() {
Text('justifyContent:FlexAlign.End').fontSize(9).fontColor(0xCCCCCC).width('90%')
Flex({ justifyContent: this.justifyContent, direction: FlexDirection.Row }) {
Text('1').width(150).height(50).backgroundColor(0xF5DEB3).key("End_AddAlign_011")
Text('2').width(150).height(100).backgroundColor(0xD2B48C).key("End_AddAlign_012")
Text('3').width(150).height(150).backgroundColor(0xF5DEB3).key("End_AddAlign_013")
}
.key("End_AddAlign_01")
.width(500)
.height(200)
.backgroundColor(0xAFEEEE)
.align(this.DadAddAlign)
}
.width("100%")
.backgroundColor(0xAFEEE)
}
}
arkui/ace_ets_layout_test/entry/src/main/ets/MainAbility/pages/Flex/justifyContent/End/AlignEnd_AddAllSpace.ets
0 → 100644
浏览文件 @
f6c49113
/*
* Copyright (c) 2023-2030 iSoftStone Information Technology (Group) Co.,Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import {MessageManager,Callback} from './../../../../common/MessageManager';
@Entry
@Component
struct AlignEnd_AddAllSpace {
@State DadAllSpace: number = 10
messageManager:MessageManager = new MessageManager()
onPageShow() {
console.info('AlignSpaceEvenly_AddAllSpace onPageShow');
globalThis.value = {
name:'messageManager',message:this.messageManager
}
let callback:Callback = (message:any) => {
console.error('message = ' + message.name + "--" + message.value);
if (message.name == 'DadAllSpace') {
this.DadAllSpace = message.value;
}
}
this.messageManager.registerCallback(callback);
}
@State justifyContent: FlexAlign = FlexAlign.End
build() {
Column() {
Text('justifyContent:FlexAlign.End').fontSize(9).fontColor(0xCCCCCC).width('90%')
Flex({ justifyContent: this.justifyContent, direction: FlexDirection.Row }) {
Text('1').width(150).height(50).backgroundColor(0xF5DEB3).key("End_AddAllSpace_011")
Text('2').width(150).height(100).backgroundColor(0xD2B48C).key("End_AddAllSpace_012")
Text('3').width(150).height(150).backgroundColor(0xF5DEB3).key("End_AddAllSpace_013")
}
.key("End_AddAllSpace_01")
.width(500)
.height(200)
.padding(this.DadAllSpace)
.margin(10)
.backgroundColor(0xAFEEEE)
}
.key("End_AddAllSpace_01_Box")
.width("100%")
.height(200)
.backgroundColor(0xAFEEE)
}
}
arkui/ace_ets_layout_test/entry/src/main/ets/MainAbility/pages/Flex/justifyContent/End/AlignEnd_AddLayoutWeight.ets
0 → 100644
浏览文件 @
f6c49113
/*
* Copyright (c) 2023-2030 iSoftStone Information Technology (Group) Co.,Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import {MessageManager,Callback} from './../../../../common/MessageManager';
@Entry
@Component
struct AlignEnd_AddLayoutWeight {
@State OneLayoutWeight: number = 2
messageManager:MessageManager = new MessageManager()
onPageShow() {
console.info('AlignSpaceEvenly_AddLayoutWeight onPageShow');
globalThis.value = {
name:'messageManager',message:this.messageManager
}
let callback:Callback = (message:any) => {
console.error('message = ' + message.name + "--" + message.value);
if (message.name == 'OneLayoutWeight') {
this.OneLayoutWeight = message.value;
}
}
this.messageManager.registerCallback(callback);
}
@State justifyContent: FlexAlign = FlexAlign.End
build() {
Column() {
Text('justifyContent:FlexAlign.End').fontSize(9).fontColor(0xCCCCCC).width('90%')
Flex({ justifyContent: this.justifyContent, direction: FlexDirection.Row }) {
Text('1')
.width(150)
.height(50)
.backgroundColor(0xF5DEB3)
.key("End_AddLayoutWeight_011")
.layoutWeight( this.OneLayoutWeight)
Text('2').width(150).height(100).backgroundColor(0xD2B48C).key("End_AddLayoutWeight_012")
Text('3').width(150).height(150).backgroundColor(0xF5DEB3).key("End_AddLayoutWeight_013")
}
.key("End_AddLayoutWeight_01")
.width(500)
.height(200)
.backgroundColor(0xAFEEEE)
}
}
}
arkui/ace_ets_layout_test/entry/src/main/ets/MainAbility/pages/Flex/justifyContent/End/AlignEnd_AddMargin.ets
0 → 100644
浏览文件 @
f6c49113
/*
* Copyright (c) 2023-2030 iSoftStone Information Technology (Group) Co.,Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import {MessageManager,Callback} from './../../../../common/MessageManager';
@Entry
@Component
struct AlignEnd_AddMargin {
@State DadMargin: number = 10
messageManager:MessageManager = new MessageManager()
onPageShow() {
console.info('AlignSpaceEvenly_AddMargin onPageShow');
globalThis.value = {
name:'messageManager',message:this.messageManager
}
let callback:Callback = (message:any) => {
console.error('message = ' + message.name + "--" + message.value);
if (message.name == 'DadMargin') {
this.DadMargin = message.value;
}
}
this.messageManager.registerCallback(callback);
}
@State justifyContent: FlexAlign = FlexAlign.End
build() {
Column() {
Text('justifyContent:FlexAlign.End').fontSize(9).fontColor(0xCCCCCC).width('90%')
Flex({ justifyContent: this.justifyContent, direction: FlexDirection.Row }) {
Text('1').width(150).height(50).backgroundColor(0xF5DEB3).key("End_AddMargin_011")
Text('2').width(150).height(100).backgroundColor(0xD2B48C).key("End_AddMargin_012")
Text('3').width(150).height(150).backgroundColor(0xF5DEB3).key("End_AddMargin_013")
}
.key("End_AddMargin_01")
.width(500)
.height(200)
.margin(this.DadMargin)
.backgroundColor(0xAFEEEE)
}
.key("End_AddMargin_01_Box")
.width("100%")
.height(200)
.backgroundColor(0xAFEEE)
}
}
arkui/ace_ets_layout_test/entry/src/main/ets/MainAbility/pages/Flex/justifyContent/End/AlignEnd_AddOffset.ets
0 → 100644
浏览文件 @
f6c49113
/*
* Copyright (c) 2023-2030 iSoftStone Information Technology (Group) Co.,Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import {MessageManager,Callback} from './../../../../common/MessageManager';
@Entry
@Component
struct AlignEnd_AddOffset {
@State OneOffset: any = { x: 0, y: 0 }
messageManager:MessageManager = new MessageManager()
onPageShow() {
console.info('AlignSpaceEvenly_AddOffset onPageShow');
globalThis.value = {
name:'messageManager',message:this.messageManager
}
let callback:Callback = (message:any) => {
console.error('message = ' + message.name + "--" + message.value);
if (message.name == 'OneOffset') {
this.OneOffset = message.value;
}
}
this.messageManager.registerCallback(callback);
}
@State justifyContent: FlexAlign = FlexAlign.End
build() {
Column() {
Text('justifyContent:FlexAlign.End').fontSize(9).fontColor(0xCCCCCC).width('90%')
Flex({ justifyContent: this.justifyContent, direction: FlexDirection.Row }) {
Text('1').width(150).height(50).backgroundColor(0xF5DEB3).key("End_AddOffset_011")
.offset(this.OneOffset)
Text('2').width(150).height(100).backgroundColor(0xD2B48C).key("End_AddOffset_012")
Text('3').width(150).height(150).backgroundColor(0xF5DEB3).key("End_AddOffset_013")
}
.key("End_AddOffset_01")
.width(500)
.height(200)
.backgroundColor(0xAFEEEE)
}
.width("100%")
}
}
arkui/ace_ets_layout_test/entry/src/main/ets/MainAbility/pages/Flex/justifyContent/End/AlignEnd_AddOneMargin.ets
0 → 100644
浏览文件 @
f6c49113
/*
* Copyright (c) 2023-2030 iSoftStone Information Technology (Group) Co.,Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import {MessageManager,Callback} from './../../../../common/MessageManager';
@Entry
@Component
struct AlignEnd_AddOneMargin {
@State OneMargin: number = 10
messageManager:MessageManager = new MessageManager()
onPageShow() {
console.info('AlignSpaceEvenly_AddOneMargin onPageShow');
globalThis.value = {
name:'messageManager',message:this.messageManager
}
let callback:Callback = (message:any) => {
console.error('message = ' + message.name + "--" + message.value);
if (message.name == 'OneMargin') {
this.OneMargin = message.value;
}
}
this.messageManager.registerCallback(callback);
}
@State justifyContent: FlexAlign = FlexAlign.End
build() {
Column() {
Text('justifyContent:FlexAlign.End').fontSize(9).fontColor(0xCCCCCC).width('90%')
Flex({ justifyContent: this.justifyContent, direction: FlexDirection.Row }) {
Text('1')
.width(150)
.height(50)
.backgroundColor(0xF5DEB3)
.key("End_AddOneMargin_011")
.margin(this.OneMargin)
Text('2').width(150).height(100).backgroundColor(0xD2B48C).key("End_AddOneMargin_012")
Text('3').width(150).height(150).backgroundColor(0xF5DEB3).key("End_AddOneMargin_013")
}
.key("End_AddOneMargin_01")
.width(500)
.height(200)
.backgroundColor(0xAFEEEE)
}
.width("100%")
}
}
arkui/ace_ets_layout_test/entry/src/main/ets/MainAbility/pages/Flex/justifyContent/End/AlignEnd_AddOneWidth.ets
0 → 100644
浏览文件 @
f6c49113
/*
* Copyright (c) 2023-2030 iSoftStone Information Technology (Group) Co.,Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import {MessageManager,Callback} from './../../../../common/MessageManager';
@Entry
@Component
struct AlignEnd_AddOneWidth {
@State OneWidth: number = 100
messageManager:MessageManager = new MessageManager()
onPageShow() {
console.info('AlignSpaceEvenly_AddOneWidth onPageShow');
globalThis.value = {
name:'messageManager',message:this.messageManager
}
let callback:Callback = (message:any) => {
console.error('message = ' + message.name + "--" + message.value);
if (message.name == 'OneWidth') {
this.OneWidth = message.value;
}
}
this.messageManager.registerCallback(callback);
}
@State justifyContent: FlexAlign = FlexAlign.End
build() {
Column() {
Text('justifyContent:FlexAlign.End').fontSize(9).fontColor(0xCCCCCC).width('90%')
Flex({ justifyContent: this.justifyContent, direction: FlexDirection.Row }) {
Text('1').width(this.OneWidth).height(50).backgroundColor(0xF5DEB3).key("End_AddOneWidth_011")
Text('2').width(150).height(100).backgroundColor(0xD2B48C).key("End_AddOneWidth_012")
Text('3').width(150).height(150).backgroundColor(0xF5DEB3).key("End_AddOneWidth_013")
}
.key("End_AddOneWidth_01")
.width(500)
.height(200)
.backgroundColor(0xAFEEEE)
}
.width("100%")
}
}
arkui/ace_ets_layout_test/entry/src/main/ets/MainAbility/pages/Flex/justifyContent/End/AlignEnd_AddPadding.ets
0 → 100644
浏览文件 @
f6c49113
/*
* Copyright (c) 2023-2030 iSoftStone Information Technology (Group) Co.,Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import {MessageManager,Callback} from './../../../../common/MessageManager';
@Entry
@Component
struct AlignEnd_AddPadding {
@State DadPadding: number = 10
messageManager:MessageManager = new MessageManager()
onPageShow() {
console.info('AlignSpaceEvenly_AddPadding onPageShow');
globalThis.value = {
name:'messageManager',message:this.messageManager
}
let callback:Callback = (message:any) => {
console.error('message = ' + message.name + "--" + message.value);
if (message.name == 'DadPadding') {
this.DadPadding = message.value;
}
}
this.messageManager.registerCallback(callback);
}
@State justifyContent: FlexAlign = FlexAlign.End
build() {
Column() {
Text('alignContent:End').fontSize(9).fontColor(0xCCCCCC).width('100%')
Flex({ justifyContent: this.justifyContent, direction:FlexDirection.Row }) {
Text('1').width(150).height(50).backgroundColor(0xF5DEB3).key("End_AddPadding_011")
Text('2').width(150).height(100).backgroundColor(0xD2B48C).key("End_AddPadding_012")
Text('3').width(150).height(150).backgroundColor(0xF5DEB3).key("End_AddPadding_013")
}.key("End_AddPadding_01")
.width(500)
.height(200)
.padding(this.DadPadding)
.backgroundColor(0xAFEEEE)
}
.width('100%')
.height('100%')
}
}
arkui/ace_ets_layout_test/entry/src/main/ets/MainAbility/pages/Flex/justifyContent/End/AlignEnd_AddVisibility.ets
0 → 100644
浏览文件 @
f6c49113
/*
* Copyright (c) 2023-2030 iSoftStone Information Technology (Group) Co.,Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import {MessageManager,Callback} from './../../../../common/MessageManager';
@Entry
@Component
struct AlignEnd_AddVisibility {
@State OneVisibility: number = Visibility.None
messageManager:MessageManager = new MessageManager()
onPageShow() {
console.info('AlignSpaceEvenly_AddVisibility onPageShow');
globalThis.value = {
name:'messageManager',message:this.messageManager
}
let callback:Callback = (message:any) => {
console.error('message = ' + message.name + "--" + message.value);
if (message.name == 'OneVisibility') {
this.OneVisibility = message.value;
}
}
this.messageManager.registerCallback(callback);
}
@State justifyContent: FlexAlign = FlexAlign.End
build() {
Column() {
Text('justifyContent:FlexAlign.End').fontSize(9).fontColor(0xCCCCCC).width('90%')
Flex({ justifyContent: this.justifyContent, direction: FlexDirection.Row }) {
Text('1')
.width(150)
.height(50)
.backgroundColor(0xF5DEB3)
.key("End_AddVisibility_011")
.visibility(this.OneVisibility)
Text('2').width(150).height(100).backgroundColor(0xD2B48C).key("End_AddVisibility_012")
Text('3').width(150).height(150).backgroundColor(0xF5DEB3).key("End_AddVisibility_013")
}
.key("End_AddVisibility_01")
.width(500)
.height(200)
.backgroundColor(0xAFEEEE)
}
}
}
arkui/ace_ets_layout_test/entry/src/main/ets/MainAbility/pages/Flex/justifyContent/End/AlignEnd_NoSpace.ets
0 → 100644
浏览文件 @
f6c49113
/*
* Copyright (c) 2023-2030 iSoftStone Information Technology (Group) Co.,Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import {MessageManager,Callback} from './../../../../common/MessageManager';
@Entry
@Component
struct AlignEnd_NoSpace {
@State DadWidth: number = 200
messageManager:MessageManager = new MessageManager()
onPageShow() {
console.info('AlignSpaceEvenly_NoSpace onPageShow');
globalThis.value = {
name:'messageManager',message:this.messageManager
}
let callback:Callback = (message:any) => {
console.error('message = ' + message.name + "--" + message.value);
if (message.name == 'DadWidth') {
this.DadWidth = message.value;
}
}
this.messageManager.registerCallback(callback);
}
@State justifyContent: FlexAlign = FlexAlign.End
build() {
Column() {
Text('justifyContent:FlexAlign.End').fontSize(9).fontColor(0xCCCCCC).width('90%')
Flex({ justifyContent: this.justifyContent, direction: FlexDirection.Row }) {
Text('1').width(150).height(50).backgroundColor(0xF5DEB3).key("End_NoSpace_011")
Text('2').width(150).height(100).backgroundColor(0xD2B48C).key("End_NoSpace_012")
Text('3').width(150).height(150).backgroundColor(0xF5DEB3).key("End_NoSpace_013")
}
.key("End_NoSpace_01")
.width(this.DadWidth)
.height(200)
.backgroundColor(0xAFEEEE)
}
}
}
arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/End/AlignEnd_AddAlign.test.ets
0 → 100644
浏览文件 @
f6c49113
/*
* Copyright (c) 2023-2030 iSoftStone Information Technology (Group) Co.,Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from "@ohos/hypium";
import router from '@system.router';
import CommonFunc from "./../../../../MainAbility/common/Common"
import {MessageManager,Callback} from './../../../../MainAbility/common/MessageManager';
export default function AlignEnd_AddAlign() {
describe('AlignEnd_AddAlign', function () {
beforeEach(async function (done) {
let options = {
uri: 'MainAbility/pages/Flex/justifyContent/End/AlignEnd_AddAlign'
}
try {
router.clear();
let pages = router.getState();
console.info("get AlignEnd_AddAlign state success " + JSON.stringify(pages));
if (!("AlignEnd_AddAlign" == pages.name)) {
console.info("get AlignEnd_AddAlign state pages.name " + JSON.stringify(pages.name));
let result = await router.push(options);
await CommonFunc.sleep(2000);
console.info("push AlignEnd_AddAlign page success " + JSON.stringify(result));
}
} catch (err) {
console.error("push AlignEnd_AddAlign page error " + JSON.stringify(err));
expect().assertFail();
}
done()
});
afterEach(async function () {
await CommonFunc.sleep(2000);
console.info("AlignEnd_AddAlign after each called")
});
/**
* @tc.number SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_END_TEST_0800
* @tc.name Align_End_Row_AddAlign
* @tc.desc aceFlexAlignEndTest
*/
it('SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_END_TEST_0800', 0, async function (done) {
console.info('[SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_END_TEST_0800] START');
globalThis.value.message.notify({name:'DadAlign', value:Alignment.BottomEnd})
await CommonFunc.sleep(3000);
let strJson = getInspectorByKey('End_AddAlign_01');
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('Flex');
expect(obj.$attrs.constructor.direction).assertEqual('FlexDirection.Row');
expect(obj.$attrs.constructor.justifyContent).assertEqual('FlexAlign.End');
let End_AddAlign_011 = CommonFunc.getComponentRect('End_AddAlign_011');
let End_AddAlign_012 = CommonFunc.getComponentRect('End_AddAlign_012');
let End_AddAlign_013 = CommonFunc.getComponentRect('End_AddAlign_013');
let End_AddAlign_01 = CommonFunc.getComponentRect('End_AddAlign_01');
expect(End_AddAlign_011.top).assertEqual(End_AddAlign_012.top);
expect(End_AddAlign_012.top).assertEqual(End_AddAlign_013.top);
expect(End_AddAlign_011.top).assertEqual(End_AddAlign_01.top);
expect(End_AddAlign_012.left).assertEqual(End_AddAlign_011.right );
expect(End_AddAlign_013.left).assertEqual(End_AddAlign_012.right );
expect(End_AddAlign_013.right).assertEqual(End_AddAlign_01.right );
expect(End_AddAlign_011.left - End_AddAlign_01.left).assertEqual(vp2px(50));
expect(End_AddAlign_011.right - End_AddAlign_011.left).assertEqual(vp2px(150));
expect(End_AddAlign_012.right - End_AddAlign_012.left).assertEqual(vp2px(150));
expect(End_AddAlign_013.right - End_AddAlign_013.left).assertEqual(vp2px(150));
expect(End_AddAlign_011.bottom - End_AddAlign_011.top).assertEqual(vp2px(50));
expect(End_AddAlign_012.bottom - End_AddAlign_012.top).assertEqual(vp2px(100));
expect(End_AddAlign_013.bottom - End_AddAlign_013.top).assertEqual(vp2px(150));
console.info('[SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_END_TEST_0800] END');
done()
});
})
}
arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/End/AlignEnd_AddAllSpace.test.ets
0 → 100644
浏览文件 @
f6c49113
/*
* Copyright (c) 2023-2030 iSoftStone Information Technology (Group) Co.,Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from "@ohos/hypium";
import router from '@system.router';
import CommonFunc from "./../../../../MainAbility/common/Common"
import {MessageManager,Callback} from './../../../../MainAbility/common/MessageManager';
export default function AlignEnd_AddAllSpace() {
describe('AlignEnd_AddAllSpace', function () {
beforeEach(async function (done) {
let options = {
uri: 'MainAbility/pages/Flex/justifyContent/End/AlignEnd_AddAllSpace'
}
try {
router.clear();
let pages = router.getState();
console.info("get AlignEnd_AddAllSpace state success " + JSON.stringify(pages));
if (!("AlignEnd_AddAllSpace" == pages.name)) {
console.info("get AlignEnd_AddAllSpace state success " + JSON.stringify(pages.name));
let result = await router.push(options);
await CommonFunc.sleep(2000);
console.info("push AlignEnd_AddAllSpace page success " + JSON.stringify(result));
}
} catch (err) {
console.error("push AlignAlignEnd_AddAllSpace page error " + JSON.stringify(err));
expect().assertFail();
}
done()
});
afterEach(async function () {
await CommonFunc.sleep(2000);
console.info("AlignAlignEnd_AddAllSpace after each called");
});
/**
* @tc.number SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_END_TEST_0600
* @tc.name Align_End_Row_AddAllSpace
* @tc.desc aceFlexAlignEndTest
*/
it('SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_END_TEST_0600', 0, async function (done) {
console.info('[SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_END_TEST_0600] START');
globalThis.value.message.notify({name:'DadAllSpace', value:30})
await CommonFunc.sleep(3000);
let strJson = getInspectorByKey('End_AddAllSpace_01');
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('Flex');
expect(obj.$attrs.constructor.direction).assertEqual('FlexDirection.Row');
expect(obj.$attrs.constructor.justifyContent).assertEqual('FlexAlign.End');
let End_AddAllSpace_011 = CommonFunc.getComponentRect('End_AddAllSpace_011');
let End_AddAllSpace_012 = CommonFunc.getComponentRect('End_AddAllSpace_012');
let End_AddAllSpace_013 = CommonFunc.getComponentRect('End_AddAllSpace_013');
let End_AddAllSpace_01 = CommonFunc.getComponentRect('End_AddAllSpace_01');
let End_AddAllSpace_01_Box = CommonFunc.getComponentRect('End_AddAllSpace_01_Box');
expect(End_AddAllSpace_011.top).assertEqual(End_AddAllSpace_012.top);
expect(End_AddAllSpace_012.top).assertEqual(End_AddAllSpace_013.top);
expect(End_AddAllSpace_012.left).assertEqual(End_AddAllSpace_011.right);
expect(End_AddAllSpace_013.left).assertEqual(End_AddAllSpace_012.right);
expect(End_AddAllSpace_011.left - End_AddAllSpace_01.left).assertEqual(vp2px(30));
expect(End_AddAllSpace_01.right - End_AddAllSpace_013.right).assertEqual(vp2px(30));
expect(End_AddAllSpace_011.top - End_AddAllSpace_01.top).assertEqual(vp2px(30));
expect(End_AddAllSpace_01.left - End_AddAllSpace_01_Box.left).assertEqual(vp2px(10));
expect(End_AddAllSpace_01.top - End_AddAllSpace_01_Box.top).assertEqual(vp2px(10));
expect(End_AddAllSpace_011.bottom - End_AddAllSpace_011.top).assertEqual(vp2px(50));
expect(End_AddAllSpace_012.bottom - End_AddAllSpace_012.top).assertEqual(vp2px(100));
expect(End_AddAllSpace_013.bottom - End_AddAllSpace_013.top).assertEqual(vp2px(150));
expect(End_AddAllSpace_011.right - End_AddAllSpace_011.left).assertEqual(vp2px(440/3));
expect(End_AddAllSpace_012.right - End_AddAllSpace_012.left).assertEqual(vp2px(440/3));
expect(End_AddAllSpace_013.right - End_AddAllSpace_013.left).assertEqual(vp2px(440/3));
console.info('[SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_END_TEST_0600] END');
done();
});
/**
* @tc.number SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_END_TEST_0700
* @tc.name Align_End_Row_AddAllSpace
* @tc.desc aceFlexAlignEndTest
*/
it('SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_END_TEST_0700', 0, async function (done) {
console.info('[SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_END_TEST_0700] START');
globalThis.value.message.notify({name:'DadAllSpace', value:20})
await CommonFunc.sleep(3000);
let strJson = getInspectorByKey('End_AddAllSpace_01');
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('Flex');
expect(obj.$attrs.constructor.direction).assertEqual('FlexDirection.Row');
expect(obj.$attrs.constructor.justifyContent).assertEqual('FlexAlign.End');
let End_AddAllSpace_011 = CommonFunc.getComponentRect('End_AddAllSpace_011');
let End_AddAllSpace_012 = CommonFunc.getComponentRect('End_AddAllSpace_012');
let End_AddAllSpace_013 = CommonFunc.getComponentRect('End_AddAllSpace_013');
let End_AddAllSpace_01 = CommonFunc.getComponentRect('End_AddAllSpace_01');
let End_AddAllSpace_01_Box = CommonFunc.getComponentRect('End_AddAllSpace_01_Box');
expect(End_AddAllSpace_011.top).assertEqual(End_AddAllSpace_012.top);
expect(End_AddAllSpace_012.top).assertEqual(End_AddAllSpace_013.top);
expect(End_AddAllSpace_012.left).assertEqual(End_AddAllSpace_011.right);
expect(End_AddAllSpace_013.left).assertEqual(End_AddAllSpace_012.right);
expect(End_AddAllSpace_011.left - End_AddAllSpace_01.left).assertEqual(vp2px(30));
expect(End_AddAllSpace_01.right - End_AddAllSpace_013.right).assertEqual(vp2px(20));
expect(End_AddAllSpace_011.top - End_AddAllSpace_01.top).assertEqual(vp2px(20));
expect(End_AddAllSpace_01.left - End_AddAllSpace_01_Box.left).assertEqual(vp2px(10));
expect(End_AddAllSpace_01.top - End_AddAllSpace_01_Box.top).assertEqual(vp2px(10));
expect(End_AddAllSpace_011.right - End_AddAllSpace_011.left).assertEqual(vp2px(150));
expect(End_AddAllSpace_012.right - End_AddAllSpace_012.left).assertEqual(vp2px(150));
expect(End_AddAllSpace_013.right - End_AddAllSpace_013.left).assertEqual(vp2px(150));
expect(End_AddAllSpace_011.bottom - End_AddAllSpace_011.top).assertEqual(vp2px(50));
expect(End_AddAllSpace_012.bottom - End_AddAllSpace_012.top).assertEqual(vp2px(100));
expect(End_AddAllSpace_013.bottom - End_AddAllSpace_013.top).assertEqual(vp2px(150));
console.info('[SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_END_TEST_0700] END');
done();
});
})
}
arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/End/AlignEnd_AddLayoutWeight.test.ets
0 → 100644
浏览文件 @
f6c49113
/*
* Copyright (c) 2023-2030 iSoftStone Information Technology (Group) Co.,Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from "@ohos/hypium";
import router from '@system.router';
import CommonFunc from "./../../../../MainAbility/common/Common"
import {MessageManager,Callback} from './../../../../MainAbility/common/MessageManager';
export default function AlignEnd_AddLayoutWeight() {
describe('AlignEnd_AddLayoutWeight', function () {
beforeEach(async function (done) {
let options = {
uri: 'MainAbility/pages/Flex/justifyContent/End/AlignEnd_AddLayoutWeight',
}
try {
router.clear();
let pages = router.getState();
console.info("get AlignEnd_AddLayoutWeight state success " + JSON.stringify(pages));
if (!("AlignEnd_AddLayoutWeight" == pages.name)) {
console.info("get AlignEnd_AddLayoutWeight state pages.name " + JSON.stringify(pages.name));
let result = await router.push(options);
await CommonFunc.sleep(2000);
console.info("push AlignEnd_AddLayoutWeight page success " + JSON.stringify(result));
}
} catch (err) {
console.error("push AlignEnd_AddLayoutWeight page error " + JSON.stringify(err));
expect().assertFail();
}
done()
});
afterEach(async function () {
await CommonFunc.sleep(2000);
console.info("AlignEnd_AddLayoutWeight after each called");
});
/**
* @tc.number SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_END_TEST_1200
* @tc.name Align_End_Row_AddLayoutWeight
* @tc.desc aceFlexAlignEndTest
*/
it('SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_END_TEST_1200', 0, async function (done) {
console.info('[SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_END_TEST_1200] START');
globalThis.value.message.notify({name:'OneLayoutWeight', value:1})
await CommonFunc.sleep(3000);
let strJson = getInspectorByKey('End_AddLayoutWeight_01');
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('Flex');
expect(obj.$attrs.constructor.direction).assertEqual('FlexDirection.Row');
expect(obj.$attrs.constructor.justifyContent).assertEqual('FlexAlign.End');
let End_AddLayoutWeight_011 = CommonFunc.getComponentRect('End_AddLayoutWeight_011');
let End_AddLayoutWeight_012 = CommonFunc.getComponentRect('End_AddLayoutWeight_012');
let End_AddLayoutWeight_013 = CommonFunc.getComponentRect('End_AddLayoutWeight_013');
let End_AddLayoutWeight_01 = CommonFunc.getComponentRect('End_AddLayoutWeight_01');
expect(End_AddLayoutWeight_011.top).assertEqual(End_AddLayoutWeight_01.top);
expect(End_AddLayoutWeight_011.top).assertEqual(End_AddLayoutWeight_012.top);
expect(End_AddLayoutWeight_013.top).assertEqual(End_AddLayoutWeight_012.top);
expect(End_AddLayoutWeight_011.right).assertEqual(End_AddLayoutWeight_012.left);
expect(End_AddLayoutWeight_012.right).assertEqual(End_AddLayoutWeight_013.left);
expect(End_AddLayoutWeight_011.left).assertEqual(End_AddLayoutWeight_01.left);
expect(End_AddLayoutWeight_013.right).assertEqual(End_AddLayoutWeight_01.right);
expect(End_AddLayoutWeight_011.right - End_AddLayoutWeight_011.left).assertEqual(vp2px(200));
expect(End_AddLayoutWeight_012.right - End_AddLayoutWeight_012.left).assertEqual(vp2px(150));
expect(End_AddLayoutWeight_013.right - End_AddLayoutWeight_013.left).assertEqual(vp2px(150));
expect(End_AddLayoutWeight_011.bottom - End_AddLayoutWeight_011.top).assertEqual(vp2px(50));
expect(End_AddLayoutWeight_012.bottom - End_AddLayoutWeight_012.top).assertEqual(vp2px(100));
expect(End_AddLayoutWeight_013.bottom - End_AddLayoutWeight_013.top).assertEqual(vp2px(150));
console.info('[SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_END_TEST_1200] END');
done();
});
})
}
arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/End/AlignEnd_AddMargin.test.ets
0 → 100644
浏览文件 @
f6c49113
/*
* Copyright (c) 2023-2030 iSoftStone Information Technology (Group) Co.,Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from "@ohos/hypium";
import router from '@system.router';
import CommonFunc from "./../../../../MainAbility/common/Common"
import {MessageManager,Callback} from './../../../../MainAbility/common/MessageManager';
export default function AlignEnd_AddMargin() {
describe('AlignEnd_AddMargin', function () {
beforeEach(async function (done) {
let options = {
uri: 'MainAbility/pages/Flex/justifyContent/End/AlignEnd_AddMargin',
}
try {
router.clear();
let pages = router.getState();
console.info("get AlignEnd_AddMargin state success " + JSON.stringify(pages));
if (!("AlignEnd_AddMargin" == pages.name)) {
console.info("get AlignEnd_AddMargin state pages.name " + JSON.stringify(pages.name));
let result = await router.push(options);
await CommonFunc.sleep(2000);
console.info("push AlignEnd_AddMargin page success " + JSON.stringify(result));
}
} catch (err) {
console.error("push AlignEnd_AddMargin page error " + JSON.stringify(err));
expect().assertFail();
}
done()
});
afterEach(async function () {
await CommonFunc.sleep(2000);
console.info("AlignEnd_AddMargin after each called");
});
/**
* @tc.number SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_END_TEST_0500
* @tc.name Align_End_Row_AddMargin
* @tc.desc aceFlexAlignEndTest
*/
it('SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_END_TEST_0500', 0, async function (done) {
console.info('[SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_END_TEST_0500] START');
globalThis.value.message.notify({name:'DadMargin', value:20})
await CommonFunc.sleep(3000);
let strJson = getInspectorByKey('End_AddMargin_01');
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('Flex');
expect(obj.$attrs.constructor.direction).assertEqual('FlexDirection.Row');
expect(obj.$attrs.constructor.justifyContent).assertEqual('FlexAlign.End');
let End_AddMargin_011 = CommonFunc.getComponentRect('End_AddMargin_011');
let End_AddMargin_012 = CommonFunc.getComponentRect('End_AddMargin_012');
let End_AddMargin_013 = CommonFunc.getComponentRect('End_AddMargin_013');
let End_AddMargin_01 = CommonFunc.getComponentRect('End_AddMargin_01');
let End_AddMargin_01_Box = CommonFunc.getComponentRect('End_AddMargin_01_Box');
expect(End_AddMargin_011.top).assertEqual(End_AddMargin_012.top);
expect(End_AddMargin_013.top).assertEqual(End_AddMargin_012.top);
expect(End_AddMargin_012.left).assertEqual(End_AddMargin_011.right);
expect(End_AddMargin_013.left).assertEqual(End_AddMargin_012.right);
expect(End_AddMargin_013.right).assertEqual(End_AddMargin_01.right);
expect(End_AddMargin_01.left - End_AddMargin_01_Box.left).assertEqual(vp2px(20));
expect(End_AddMargin_01.top - End_AddMargin_01_Box.top).assertEqual(vp2px(20));
expect(End_AddMargin_011.left - End_AddMargin_01.left).assertEqual(vp2px(50));
expect(End_AddMargin_011.bottom - End_AddMargin_011.top).assertEqual(vp2px(50));
expect(End_AddMargin_012.bottom - End_AddMargin_012.top).assertEqual(vp2px(100));
expect(End_AddMargin_013.bottom - End_AddMargin_013.top).assertEqual(vp2px(150));
expect(End_AddMargin_011.right - End_AddMargin_011.left).assertEqual(vp2px(150));
expect(End_AddMargin_012.right - End_AddMargin_012.left).assertEqual(vp2px(150));
expect(End_AddMargin_013.right - End_AddMargin_013.left).assertEqual(vp2px(150));
console.info('[SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_END_TEST_0500] END');
done();
});
})
}
arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/End/AlignEnd_AddOffset.test.ets
0 → 100644
浏览文件 @
f6c49113
/*
* Copyright (c) 2023-2030 iSoftStone Information Technology (Group) Co.,Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from "@ohos/hypium";
import router from '@system.router';
import CommonFunc from "./../../../../MainAbility/common/Common"
import {MessageManager,Callback} from './../../../../MainAbility/common/MessageManager';
export default function AlignEnd_AddOffset() {
describe('AlignEnd_AddOffset', function () {
beforeEach(async function (done) {
let options = {
uri: 'MainAbility/pages/Flex/justifyContent/End/AlignEnd_AddOffset',
}
try {
router.clear();
let pages = router.getState();
console.info("get AlignEnd_AddOffset state success " + JSON.stringify(pages));
if (!("AlignEnd_AddOffset" == pages.name)) {
console.info("get AlignEnd_AddOffset state pages.name " + JSON.stringify(pages.name));
let result = await router.push(options);
await CommonFunc.sleep(2000);
console.info("push AlignEnd_AddOffset page success " + JSON.stringify(result));
}
} catch (err) {
console.error("push AlignEnd_AddOffset page error " + JSON.stringify(err));
expect().assertFail();
}
done()
});
afterEach(async function () {
await CommonFunc.sleep(2000);
console.info("AlignEnd_AddOffset after each called");
});
/**
* @tc.number SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_END_TEST_0900
* @tc.name Align_End_Row_AddOffset
* @tc.desc aceFlexAlignEndTest
*/
it('SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_END_TEST_0900', 0, async function (done) {
console.info('[SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_END_TEST_0900] START');
globalThis.value.message.notify({name:'OneOffset', value:{ x: 10, y: 15 }})
await CommonFunc.sleep(3000);
let strJson = getInspectorByKey('End_AddAlign_01');
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('Flex');
expect(obj.$attrs.constructor.direction).assertEqual('FlexDirection.Row');
expect(obj.$attrs.constructor.justifyContent).assertEqual('FlexAlign.End');
let End_AddOffset_011 = CommonFunc.getComponentRect('End_AddOffset_011');
let End_AddOffset_012 = CommonFunc.getComponentRect('End_AddOffset_012');
let End_AddOffset_013 = CommonFunc.getComponentRect('End_AddOffset_013');
let End_AddOffset_01 = CommonFunc.getComponentRect('End_AddOffset_01');
expect(End_AddOffset_011.top - End_AddOffset_01.top).assertEqual(vp2px(15));
expect(End_AddOffset_011.right - End_AddOffset_012.left).assertEqual(vp2px(10));
expect(End_AddOffset_011.left - End_AddOffset_01.left).assertEqual(vp2px(60));
expect(End_AddOffset_012.top).assertEqual(End_AddOffset_013.top);
expect(End_AddOffset_012.top).assertEqual(End_AddOffset_01.top);
expect(End_AddOffset_013.left).assertEqual(End_AddOffset_012.right);
expect(End_AddOffset_01.right).assertEqual(End_AddOffset_013.right);
expect(End_AddOffset_011.right - End_AddOffset_011.left).assertEqual(vp2px(150));
expect(End_AddOffset_012.right - End_AddOffset_012.left).assertEqual(vp2px(150));
expect(End_AddOffset_013.right - End_AddOffset_013.left).assertEqual(vp2px(150));
expect(End_AddOffset_011.bottom - End_AddOffset_011.top).assertEqual(vp2px(50));
expect(End_AddOffset_012.bottom - End_AddOffset_012.top).assertEqual(vp2px(100));
expect(End_AddOffset_013.bottom - End_AddOffset_013.top).assertEqual(vp2px(150));
console.info('[SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_END_TEST_0900] END');
done();
});
})
}
arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/End/AlignEnd_AddOneMargin.test.ets
0 → 100644
浏览文件 @
f6c49113
/*
* Copyright (c) 2023-2030 iSoftStone Information Technology (Group) Co.,Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from "@ohos/hypium";
import router from '@system.router';
import CommonFunc from "./../../../../MainAbility/common/Common"
import {MessageManager,Callback} from './../../../../MainAbility/common/MessageManager';
export default function AlignEnd_AddOneMargin() {
describe('AlignEnd_AddOneMargin', function () {
beforeEach(async function (done) {
let options = {
uri: 'MainAbility/pages/Flex/justifyContent/End/AlignEnd_AddOneMargin',
}
try {
router.clear();
let pages = router.getState();
console.info("get AlignEnd_AddOneMargin state success " + JSON.stringify(pages));
if (!("AlignEnd_AddOneMargin" == pages.name)) {
console.info("get AlignEnd_AddOneMargin state pages.name " + JSON.stringify(pages.name));
let result = await router.push(options);
await CommonFunc.sleep(2000);
console.info("push AlignEnd_AddOneMargin page success " + JSON.stringify(result));
}
} catch (err) {
console.error("push AlignEnd_AddOneMargin page error " + JSON.stringify(err));
expect().assertFail();
}
done()
});
afterEach(async function () {
await CommonFunc.sleep(2000);
console.info("AlignEnd_AddOneMargin after each called");
});
/**
* @tc.number SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_END_TEST_1400
* @tc.name Align_End_Row_AddOneMargin
* @tc.desc aceFlexAlignEndTest
*/
it('SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_END_TEST_1400', 0, async function (done) {
console.info('[SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_END_TEST_1400] START');
globalThis.value.message.notify({name:'OneMargin', value:20});
await CommonFunc.sleep(3000);
let strJson = getInspectorByKey('End_AddOneMargin_01');
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('Flex');
expect(obj.$attrs.constructor.direction).assertEqual('FlexDirection.Row');
expect(obj.$attrs.constructor.justifyContent).assertEqual('FlexAlign.End');
let End_AddOneMargin_011 = CommonFunc.getComponentRect('End_AddOneMargin_011');
let End_AddOneMargin_012 = CommonFunc.getComponentRect('End_AddOneMargin_012');
let End_AddOneMargin_013 = CommonFunc.getComponentRect('End_AddOneMargin_013');
let End_AddOneMargin_01 = CommonFunc.getComponentRect('End_AddOneMargin_01');
expect(End_AddOneMargin_011.top - End_AddOneMargin_01.top).assertEqual(vp2px(20));
expect(End_AddOneMargin_012.left - End_AddOneMargin_011.right).assertEqual(vp2px(20));
expect(End_AddOneMargin_011.left - End_AddOneMargin_01.left).assertEqual(vp2px(30));
expect(End_AddOneMargin_013.top).assertEqual(End_AddOneMargin_012.top);
expect(End_AddOneMargin_012.top).assertEqual(End_AddOneMargin_01.top);
expect(End_AddOneMargin_013.left).assertEqual(End_AddOneMargin_012.right);
expect(End_AddOneMargin_013.right).assertEqual(End_AddOneMargin_01.right);
expect(End_AddOneMargin_011.bottom - End_AddOneMargin_011.top).assertEqual(vp2px(50));
expect(End_AddOneMargin_012.bottom - End_AddOneMargin_012.top).assertEqual(vp2px(100));
expect(End_AddOneMargin_013.bottom - End_AddOneMargin_013.top).assertEqual(vp2px(150));
expect(End_AddOneMargin_011.right - End_AddOneMargin_011.left).assertEqual(vp2px(150));
expect(End_AddOneMargin_012.right - End_AddOneMargin_012.left).assertEqual(vp2px(150));
expect(End_AddOneMargin_013.right - End_AddOneMargin_013.left).assertEqual(vp2px(150));
console.info('[SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_END_TEST_1400] END');
done();
})
/**
* @tc.number SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_END_TEST_1500
* @tc.name Align_End_Row_AddOneMargin
* @tc.desc aceFlexAlignEndTest
*/
it('SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_END_TEST_1500', 0, async function (done) {
console.info('[SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_END_TEST_1500] START');
globalThis.value.message.notify({name:'OneMargin', value:30});
await CommonFunc.sleep(3000);
let strJson = getInspectorByKey('End_AddOneMargin_01');
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('Flex');
expect(obj.$attrs.constructor.direction).assertEqual('FlexDirection.Row');
expect(obj.$attrs.constructor.justifyContent).assertEqual('FlexAlign.End');
let End_AddOneMargin_011 = CommonFunc.getComponentRect('End_AddOneMargin_011');
let End_AddOneMargin_012 = CommonFunc.getComponentRect('End_AddOneMargin_012');
let End_AddOneMargin_013 = CommonFunc.getComponentRect('End_AddOneMargin_013');
let End_AddOneMargin_01 = CommonFunc.getComponentRect('End_AddOneMargin_01');
expect(End_AddOneMargin_011.top - End_AddOneMargin_01.top).assertEqual(vp2px(30));
expect(End_AddOneMargin_012.left - End_AddOneMargin_011.right).assertEqual(vp2px(30));
expect(End_AddOneMargin_011.left - End_AddOneMargin_01.left).assertEqual(vp2px(30));
expect(End_AddOneMargin_013.top).assertEqual(End_AddOneMargin_012.top);
expect(End_AddOneMargin_012.top).assertEqual(End_AddOneMargin_01.top);
expect(End_AddOneMargin_013.left).assertEqual(End_AddOneMargin_012.right);
expect(End_AddOneMargin_013.right).assertEqual(End_AddOneMargin_01.right);
expect(End_AddOneMargin_011.bottom - End_AddOneMargin_011.top).assertEqual(vp2px(50));
expect(End_AddOneMargin_012.bottom - End_AddOneMargin_012.top).assertEqual(vp2px(100));
expect(End_AddOneMargin_013.bottom - End_AddOneMargin_013.top).assertEqual(vp2px(150));
expect(End_AddOneMargin_011.right - End_AddOneMargin_011.left).assertEqual(vp2px(440/3));
expect(End_AddOneMargin_012.right - End_AddOneMargin_012.left).assertEqual(vp2px(440/3));
expect(End_AddOneMargin_013.right - End_AddOneMargin_013.left).assertEqual(vp2px(440/3));
console.info('[SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_END_TEST_1500] END');
done();
})
})
}
arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/End/AlignEnd_AddOneWidth.test.ets
0 → 100644
浏览文件 @
f6c49113
/*
* Copyright (c) 2023-2030 iSoftStone Information Technology (Group) Co.,Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from "@ohos/hypium";
import router from '@system.router';
import CommonFunc from "./../../../../MainAbility/common/Common"
import {MessageManager,Callback} from './../../../../MainAbility/common/MessageManager';
export default function AlignEnd_AddOneWidth() {
describe('AlignEnd_AddOneWidth', function () {
beforeEach(async function (done) {
let options = {
uri: 'MainAbility/pages/Flex/justifyContent/End/AlignEnd_AddOneWidth',
}
try {
router.clear();
let pages = router.getState();
console.info("get AlignEnd_AddOneWidth state success " + JSON.stringify(pages));
if (!("AlignEnd_AddOneWidth" == pages.name)) {
console.info("get AlignEnd_AddOneWidth( state success " + JSON.stringify(pages.name));
let result = await router.push(options);
await CommonFunc.sleep(2000);
console.info("push AlignEnd_AddOneWidth( page success " + JSON.stringify(result));
}
} catch (err) {
console.error("push AlignEnd_AddOneWidth( page error " + JSON.stringify(err));
expect().assertFail();
}
done()
});
afterEach(async function () {
await CommonFunc.sleep(2000);
console.info("AlignEnd_AddOneWidth after each called");
});
/**
* @tc.number SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_END_TEST_1300
* @tc.name Align_End_Row_ChangeOneWidth
* @tc.desc aceFlexAlignEndTest
*/
it('SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_END_TEST_1300', 0, async function (done) {
console.info('[SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_END_TEST_1300] START');
globalThis.value.message.notify({name:'OneWidth', value:160})
await CommonFunc.sleep(3000);
let strJson = getInspectorByKey('End_AddOneWidth_01');
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('Flex');
expect(obj.$attrs.constructor.direction).assertEqual('FlexDirection.Row');
expect(obj.$attrs.constructor.justifyContent).assertEqual('FlexAlign.End');
let End_AddOneWidth_011 = CommonFunc.getComponentRect('End_AddOneWidth_011');
let End_AddOneWidth_012 = CommonFunc.getComponentRect('End_AddOneWidth_012');
let End_AddOneWidth_013 = CommonFunc.getComponentRect('End_AddOneWidth_013');
let End_AddOneWidth_01 = CommonFunc.getComponentRect('End_AddOneWidth_01');
expect(End_AddOneWidth_012.left).assertEqual(End_AddOneWidth_011.right);
expect(End_AddOneWidth_013.left).assertEqual(End_AddOneWidth_012.right);
expect(End_AddOneWidth_013.right).assertEqual(End_AddOneWidth_01.right);
expect(End_AddOneWidth_011.top).assertEqual(End_AddOneWidth_012.top);
expect(End_AddOneWidth_013.top).assertEqual(End_AddOneWidth_012.top);
expect(End_AddOneWidth_01.top).assertEqual(End_AddOneWidth_011.top);
expect(End_AddOneWidth_011.left - End_AddOneWidth_01.left).assertEqual(vp2px(40));
expect(End_AddOneWidth_011.right - End_AddOneWidth_011.left).assertEqual(vp2px(160));
expect(End_AddOneWidth_012.right - End_AddOneWidth_012.left).assertEqual(vp2px(150));
expect(End_AddOneWidth_013.right - End_AddOneWidth_013.left).assertEqual(vp2px(150));
expect(End_AddOneWidth_011.bottom - End_AddOneWidth_011.top).assertEqual(vp2px(50));
expect(End_AddOneWidth_012.bottom - End_AddOneWidth_012.top).assertEqual(vp2px(100));
expect(End_AddOneWidth_013.bottom - End_AddOneWidth_013.top).assertEqual(vp2px(150));
console.info('[SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_END_TEST_1300] END');
done();
});
})
}
arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/End/AlignEnd_AddPadding.test.ets
0 → 100644
浏览文件 @
f6c49113
/*
* Copyright (c) 2023-2030 iSoftStone Information Technology (Group) Co.,Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from "@ohos/hypium";
import router from '@system.router';
import CommonFunc from "./../../../../MainAbility/common/Common"
import {MessageManager,Callback} from './../../../../MainAbility/common/MessageManager';
export default function AlignEnd_AddPadding() {
describe('AlignEnd_AddPadding', function () {
beforeEach(async function (done) {
let options = {
uri: 'MainAbility/pages/Flex/justifyContent/End/AlignEnd_AddPadding'
}
try {
router.clear();
let pages = router.getState();
console.info("get AlignEnd_AddPadding state success " + JSON.stringify(pages));
if (!("AlignEnd_AddPadding" == pages.name)) {
console.info("get AlignEnd_AddPadding state pages.name " + JSON.stringify(pages.name));
let result = await router.push(options);
await CommonFunc.sleep(2000);
console.info("push AlignEnd_AddPadding page success " + JSON.stringify(result));
}
} catch (err) {
console.error("push AlignEnd_AddPadding page error " + JSON.stringify(err));
expect().assertFail();
}
done()
});
afterEach(async function () {
await CommonFunc.sleep(2000);
console.info("AlignEnd_AddPadding after each called");
});
/**
* @tc.number SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_END_TEST_0300
* @tc.name Align_End_Row_AddPadding
* @tc.desc aceFlexAlignEndTest
*/
it('SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_END_TEST_0300', 0, async function (done) {
console.info('[SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_END_TEST_0300] START');
globalThis.value.message.notify({name:'DadPadding', value:30})
await CommonFunc.sleep(3000);
let strJson = getInspectorByKey('End_AddPadding_01');
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('Flex');
expect(obj.$attrs.constructor.direction).assertEqual('FlexDirection.Row');
expect(obj.$attrs.constructor.justifyContent).assertEqual('FlexAlign.End');
let End_AddPadding_011 = CommonFunc.getComponentRect('End_AddPadding_011');
let End_AddPadding_012 = CommonFunc.getComponentRect('End_AddPadding_012');
let End_AddPadding_013 = CommonFunc.getComponentRect('End_AddPadding_013');
let End_AddPadding_01 = CommonFunc.getComponentRect('End_AddPadding_01');
expect(End_AddPadding_011.top).assertEqual(End_AddPadding_012.top);
expect(End_AddPadding_012.top).assertEqual(End_AddPadding_013.top);
expect(End_AddPadding_012.left).assertEqual(End_AddPadding_011.right);
expect(End_AddPadding_013.left).assertEqual(End_AddPadding_012.right);
expect(End_AddPadding_011.top - End_AddPadding_01.top).assertEqual(vp2px(30));
expect(End_AddPadding_011.left - End_AddPadding_01.left).assertEqual(vp2px(30));
expect(End_AddPadding_01.right - End_AddPadding_013.right).assertEqual(vp2px(30));
expect(End_AddPadding_011.bottom - End_AddPadding_011.top).assertEqual(vp2px(50));
expect(End_AddPadding_012.bottom - End_AddPadding_012.top).assertEqual(vp2px(100));
expect(End_AddPadding_013.bottom - End_AddPadding_013.top).assertEqual(vp2px(150));
expect(End_AddPadding_011.right - End_AddPadding_011.left).assertEqual(vp2px(440/3));
expect(End_AddPadding_012.right - End_AddPadding_012.left).assertEqual(vp2px(440/3));
expect(End_AddPadding_013.right - End_AddPadding_013.left).assertEqual(vp2px(440/3));
console.info('[SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_END_TEST_0300] END');
done();
});
/**
* @tc.number SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_END_TEST_0400
* @tc.name Align_End_Row_AddPadding
* @tc.desc aceFlexAlignEndTest
*/
it('SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_END_TEST_0400', 0, async function (done) {
console.info('[SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_END_TEST_0400] START');
globalThis.value.message.notify({name:'DadPadding', value:20})
await CommonFunc.sleep(3000);
let strJson = getInspectorByKey('End_AddPadding_01');
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('Flex');
expect(obj.$attrs.constructor.direction).assertEqual('FlexDirection.Row');
expect(obj.$attrs.constructor.justifyContent).assertEqual('FlexAlign.End');
let End_AddPadding_011 = CommonFunc.getComponentRect('End_AddPadding_011');
let End_AddPadding_012 = CommonFunc.getComponentRect('End_AddPadding_012');
let End_AddPadding_013 = CommonFunc.getComponentRect('End_AddPadding_013');
let End_AddPadding_01 = CommonFunc.getComponentRect('End_AddPadding_01');
expect(End_AddPadding_011.top).assertEqual(End_AddPadding_012.top);
expect(End_AddPadding_012.top).assertEqual(End_AddPadding_013.top);
expect(End_AddPadding_011.right).assertEqual(End_AddPadding_012.left);
expect(End_AddPadding_012.right).assertEqual(End_AddPadding_013.left);
expect(End_AddPadding_011.top - End_AddPadding_01.top).assertEqual(vp2px(20));
expect(End_AddPadding_011.left - End_AddPadding_01.left).assertEqual(vp2px(30));
expect(End_AddPadding_01.right - End_AddPadding_013.right).assertEqual(vp2px(20));
expect(End_AddPadding_011.right - End_AddPadding_011.left).assertEqual(vp2px(150));
expect(End_AddPadding_012.right - End_AddPadding_012.left).assertEqual(vp2px(150));
expect(End_AddPadding_013.right - End_AddPadding_013.left).assertEqual(vp2px(150));
expect(End_AddPadding_011.bottom - End_AddPadding_011.top).assertEqual(vp2px(50));
expect(End_AddPadding_012.bottom - End_AddPadding_012.top).assertEqual(vp2px(100));
expect(End_AddPadding_013.bottom - End_AddPadding_013.top).assertEqual(vp2px(150));
console.info('[SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_END_TEST_0400] END');
done();
});
})
}
arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/End/AlignEnd_AddVisibility.test.ets
0 → 100644
浏览文件 @
f6c49113
/*
* Copyright (c) 2023-2030 iSoftStone Information Technology (Group) Co.,Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from "@ohos/hypium";
import router from '@system.router';
import CommonFunc from "./../../../../MainAbility/common/Common"
import {MessageManager,Callback} from './../../../../MainAbility/common/MessageManager';
export default function AlignEnd_AddVisibility() {
describe('AlignEnd_AddVisibility', function () {
beforeEach(async function (done) {
let options = {
uri: 'MainAbility/pages/Flex/justifyContent/End/AlignEnd_AddVisibility',
}
try {
router.clear();
let pages = router.getState();
console.info("get AlignEnd_AddVisibility state success " + JSON.stringify(pages));
if (!("AlignEnd_AddVisibility" == pages.name)) {
console.info("get AlignEnd_AddVisibility state pages.name " + JSON.stringify(pages.name));
let result = await router.push(options);
await CommonFunc.sleep(2000);
console.info("push AlignEnd_AddVisibility page success " + JSON.stringify(result));
}
} catch (err) {
console.error("push AlignEnd_AddVisibility page error " + JSON.stringify(err));
expect().assertFail();
}
done()
});
afterEach(async function () {
await CommonFunc.sleep(2000);
console.info("AlignEnd_AddVisibility after each called");
});
/**
* @tc.number SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_END_TEST_1000
* @tc.name Align_End_Row_AddVisibility
* @tc.desc aceFlexAlignEndTest
*/
it('SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_END_TEST_1000', 0, async function (done) {
console.info('[SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_END_TEST_1000] START');
globalThis.value.message.notify({name:'OneVisibility',value:Visibility.None});
await CommonFunc.sleep(3000);
let strJson = getInspectorByKey('End_AddVisibility_01');
let obj = JSON.parse(strJson);
let strJson2 = getInspectorByKey('End_AddVisibility_011');
let obj2 = JSON.parse(strJson2);
expect(obj.$type).assertEqual('Flex');
expect(obj.$attrs.constructor.direction).assertEqual('FlexDirection.Row');
expect(obj.$attrs.constructor.justifyContent).assertEqual('FlexAlign.End');
expect(obj2.$attrs.visibility).assertEqual("Visibility.None");
let End_AddVisibility_012 = CommonFunc.getComponentRect('End_AddVisibility_012');
let End_AddVisibility_013 = CommonFunc.getComponentRect('End_AddVisibility_013');
let End_AddVisibility_01 = CommonFunc.getComponentRect('End_AddVisibility_01');
expect(End_AddVisibility_012.top).assertEqual(End_AddVisibility_013.top);
expect(End_AddVisibility_012.top).assertEqual(End_AddVisibility_01.top);
expect(End_AddVisibility_012.right).assertEqual(End_AddVisibility_013.left);
expect(End_AddVisibility_013.right).assertEqual(End_AddVisibility_01.right);
expect(End_AddVisibility_012.left - End_AddVisibility_01.left).assertEqual(vp2px(200));
expect(End_AddVisibility_012.right - End_AddVisibility_012.left).assertEqual(vp2px(150));
expect(End_AddVisibility_013.right - End_AddVisibility_013.left).assertEqual(vp2px(150));
expect(End_AddVisibility_012.bottom - End_AddVisibility_012.top).assertEqual(vp2px(100));
expect(End_AddVisibility_013.bottom - End_AddVisibility_013.top).assertEqual(vp2px(150));
console.info('[SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_END_TEST_1000] END');
done();
});
/**
* @tc.number SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_END_TEST_1100
* @tc.name Align_End_Row_AddVisibility
* @tc.desc aceFlexAlignEndTest
*/
it('SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_END_TEST_1100', 0, async function (done) {
console.info('[SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_END_TEST_1100] START');
globalThis.value.message.notify({name:'OneVisibility',value:Visibility.Hidden})
await CommonFunc.sleep(3000);
let strJson = getInspectorByKey('End_AddVisibility_01');
let obj = JSON.parse(strJson);
let strJson2 = getInspectorByKey('End_AddVisibility_011');
let obj2 = JSON.parse(strJson2);
expect(obj.$type).assertEqual('Flex');
expect(obj.$attrs.constructor.direction).assertEqual('FlexDirection.Row');
expect(obj.$attrs.constructor.justifyContent).assertEqual('FlexAlign.End');
expect(obj2.$attrs.visibility).assertEqual("Visibility.Hidden");
let End_AddVisibility_011 = CommonFunc.getComponentRect('End_AddVisibility_011');
let End_AddVisibility_012 = CommonFunc.getComponentRect('End_AddVisibility_012');
let End_AddVisibility_013 = CommonFunc.getComponentRect('End_AddVisibility_013');
let End_AddVisibility_01 = CommonFunc.getComponentRect('End_AddVisibility_01');
expect(End_AddVisibility_011.top).assertEqual(End_AddVisibility_012.top);
expect(End_AddVisibility_012.top).assertEqual(End_AddVisibility_013.top);
expect(End_AddVisibility_012.top).assertEqual(End_AddVisibility_01.top);
expect(End_AddVisibility_011.right).assertEqual(End_AddVisibility_012.left);
expect(End_AddVisibility_013.right).assertEqual(End_AddVisibility_01.right);
expect(End_AddVisibility_013.left).assertEqual(End_AddVisibility_012.right);
expect(End_AddVisibility_011.left - End_AddVisibility_01.left).assertEqual(vp2px(50));
expect(End_AddVisibility_011.right - End_AddVisibility_011.left).assertEqual(vp2px(150));
expect(End_AddVisibility_012.right - End_AddVisibility_012.left).assertEqual(vp2px(150));
expect(End_AddVisibility_013.right - End_AddVisibility_013.left).assertEqual(vp2px(150));
expect(End_AddVisibility_011.bottom - End_AddVisibility_011.top).assertEqual(vp2px(50));
expect(End_AddVisibility_012.bottom - End_AddVisibility_012.top).assertEqual(vp2px(100));
expect(End_AddVisibility_013.bottom - End_AddVisibility_013.top).assertEqual(vp2px(150));
console.info('[SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_END_TEST_1100] END');
done();
});
})
}
arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/End/AlignEnd_NoSpace.test.ets
0 → 100644
浏览文件 @
f6c49113
/*
* Copyright (c) 2023-2030 iSoftStone Information Technology (Group) Co.,Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from "@ohos/hypium";
import router from '@system.router';
import CommonFunc from "./../../../../MainAbility/common/Common"
import {MessageManager,Callback} from './../../../../MainAbility/common/MessageManager';
export default function AlignEnd_NoSpace() {
describe('AlignEnd_NoSpace', function () {
beforeEach(async function (done) {
let options = {
uri: 'MainAbility/pages/Flex/justifyContent/End/AlignEnd_NoSpace'
}
try {
router.clear();
let pages = router.getState();
console.info("get AlignEnd_NoSpace state success " + JSON.stringify(pages));
if (!("AlignEnd_NoSpace" == pages.name)) {
console.info("get AlignEnd_NoSpace state pages.name " + JSON.stringify(pages.name));
let result = await router.push(options);
await CommonFunc.sleep(2000);
console.info("push AlignEnd_NoSpace page success " + JSON.stringify(result));
}
} catch (err) {
console.error("push AlignEnd_NoSpace page error " + JSON.stringify(err));
expect().assertFail();
}
done()
});
afterEach(async function () {
await CommonFunc.sleep(2000);
console.info("AlignEnd_NoSpace after each called");
});
/**
* @tc.number SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_END_TEST_0100
* @tc.name Align_End_Row_ChangeWidth
* @tc.desc aceFlexAlignEndTest
*/
it('SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_END_TEST_0100', 0, async function (done) {
console.info('[SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_END_TEST_0100] START');
globalThis.value.message.notify({name:'DadWidth', value:400});
await CommonFunc.sleep(3000);
let strJson = getInspectorByKey('End_NoSpace_01');
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('Flex');
expect(obj.$attrs.constructor.direction).assertEqual('FlexDirection.Row');
expect(obj.$attrs.constructor.justifyContent).assertEqual('FlexAlign.End');
let End_NoSpace_011 = CommonFunc.getComponentRect('End_NoSpace_011');
let End_NoSpace_012 = CommonFunc.getComponentRect('End_NoSpace_012');
let End_NoSpace_013 = CommonFunc.getComponentRect('End_NoSpace_013');
let End_NoSpace_01 = CommonFunc.getComponentRect('End_NoSpace_01');
expect(End_NoSpace_011.top).assertEqual(End_NoSpace_012.top);
expect(End_NoSpace_012.top).assertEqual(End_NoSpace_013.top);
expect(End_NoSpace_011.top).assertEqual(End_NoSpace_01.top);
expect(End_NoSpace_011.left).assertEqual(End_NoSpace_01.left);
expect(End_NoSpace_012.left).assertEqual(End_NoSpace_011.right);
expect(End_NoSpace_013.left).assertEqual(End_NoSpace_012.right);
expect(End_NoSpace_013.right).assertEqual(End_NoSpace_01.right);
expect(End_NoSpace_011.bottom - End_NoSpace_011.top).assertEqual(vp2px(50));
expect(End_NoSpace_012.bottom - End_NoSpace_012.top).assertEqual(vp2px(100));
expect(End_NoSpace_013.bottom - End_NoSpace_013.top).assertEqual(vp2px(150));
expect(End_NoSpace_011.right - End_NoSpace_011.left).assertEqual(vp2px(400/3));
expect(End_NoSpace_012.right - End_NoSpace_012.left).assertEqual(vp2px(400/3));
expect(End_NoSpace_013.right - End_NoSpace_013.left).assertEqual(vp2px(400/3));
console.info('[SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_END_TEST_0100] END');
done();
});
/**
* @tc.number SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_END_TEST_0200
* @tc.name Align_End_Row_ChangeWidth
* @tc.desc aceFlexAlignEndTest
*/
it('SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_END_TEST_0200', 0, async function (done) {
console.info('[SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_END_TEST_0200] START');
globalThis.value.message.notify({name:'DadWidth', value:500})
await CommonFunc.sleep(3000);
let strJson = getInspectorByKey('End_NoSpace_01');
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('Flex');
expect(obj.$attrs.constructor.direction).assertEqual('FlexDirection.Row');
expect(obj.$attrs.constructor.justifyContent).assertEqual('FlexAlign.End');
let End_NoSpace_011 = CommonFunc.getComponentRect('End_NoSpace_011');
let End_NoSpace_012 = CommonFunc.getComponentRect('End_NoSpace_012');
let End_NoSpace_013 = CommonFunc.getComponentRect('End_NoSpace_013');
let End_NoSpace_01 = CommonFunc.getComponentRect('End_NoSpace_01');
expect(End_NoSpace_011.top).assertEqual(End_NoSpace_012.top);
expect(End_NoSpace_012.top).assertEqual(End_NoSpace_013.top);
expect(End_NoSpace_011.top).assertEqual(End_NoSpace_01.top);
expect(End_NoSpace_012.left).assertEqual(End_NoSpace_011.right);
expect(End_NoSpace_013.left).assertEqual(End_NoSpace_012.right);
expect(End_NoSpace_013.right).assertEqual(End_NoSpace_01.right);
expect(End_NoSpace_011.left - End_NoSpace_01.left).assertEqual(vp2px(50));
expect(End_NoSpace_011.bottom - End_NoSpace_011.top).assertEqual(vp2px(50));
expect(End_NoSpace_012.bottom - End_NoSpace_012.top).assertEqual(vp2px(100));
expect(End_NoSpace_013.bottom - End_NoSpace_013.top).assertEqual(vp2px(150));
expect(End_NoSpace_011.right - End_NoSpace_011.left).assertEqual(vp2px(150));
expect(End_NoSpace_012.right - End_NoSpace_012.left).assertEqual(vp2px(150));
expect(End_NoSpace_013.right - End_NoSpace_013.left).assertEqual(vp2px(150));
console.info('[SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_END_TEST_0200] END');
done();
});
})
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录