提交 4de1c63b 编写于 作者: Z zhangshuqi

Column_New

Signed-off-by: Nzhangshuqi <zhangshuqi7@huawei.com>
上级 977c64f7
/**
* Copyright (c) 2023 Huawei Device 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 columnNesting_Space {
@State addSpace: string = '10vp'
messageManager:MessageManager = new MessageManager()
onPageShow() {
console.info('columnNesting_Space onPageShow');
globalThis.value = {
name:'messageManager',message:this.messageManager
}
let callback:Callback = (message:any) => {
console.error('message = ' + message.name + "--" + message.value);
if (message.name == 'addSpace') {
this.addSpace = message.value;
}
}
this.messageManager.registerCallback(callback);
}
build() {
Column({space:30}){
Column({space:this.addSpace}) {
Column(){Text('1')}.width(300).height(50).backgroundColor(0xF5DEB3).key('columnNesting_Space_011')
Column(){Text('2')}.width(300).height(100).backgroundColor(0xD2B48C).key('columnNesting_Space_012')
Column(){Text('3')}.width(300).height(150).backgroundColor(0xF5DEB3).key('columnNesting_Space_013')
}.key('columnNesting_Space_01').width(350).height(400).backgroundColor(0xAFEEEE)
Column({space:this.addSpace}) {
Column(){Text('1')}.width(300).height(50).backgroundColor(0xF5DEB3).key('columnNesting_Space_021')
Column(){Text('2')}.width(300).height(100).backgroundColor(0xD2B48C).key('columnNesting_Space_022')
Column(){Text('3')}.width(300).height(150).backgroundColor(0xF5DEB3).key('columnNesting_Space_023')
}.key('columnNesting_Space_02').width(350).height(400).backgroundColor(0xAFEEEE)
}.width(300).height(1000).backgroundColor(0xF5DEB3).key('columnNesting_Space_1')
}
}
\ No newline at end of file
/**
* Copyright (c) 2023 Huawei Device 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 columnNesting_alignItems {
@State addSpace: string = '10vp'
messageManager:MessageManager = new MessageManager()
onPageShow() {
console.info('columnNesting_alignItems onPageShow');
globalThis.value = {
name:'messageManager',message:this.messageManager
}
let callback:Callback = (message:any) => {
console.error('message = ' + message.name + "--" + message.value);
if (message.name == 'addSpace') {
this.addSpace = message.value;
}
}
this.messageManager.registerCallback(callback);
}
build() {
Column({space:30}){
Column({space:this.addSpace}) {
Column(){Text('1')}.width(300).height(50).backgroundColor(0xF5DEB3).key('columnNesting_alignItems_011')
Column(){Text('2')}.width(300).height(100).backgroundColor(0xD2B48C).key('columnNesting_alignItems_012')
Column(){Text('3')}.width(300).height(150).backgroundColor(0xF5DEB3).key('columnNesting_alignItems_013')
}.key('columnNesting_alignItems_01').width(350).height(400).backgroundColor(0xAFEEEE).alignItems(HorizontalAlign.Start)
Column({space:this.addSpace}) {
Column(){Text('1')}.width(300).height(50).backgroundColor(0xF5DEB3).key('columnNesting_alignItems_021')
Column(){Text('2')}.width(300).height(100).backgroundColor(0xD2B48C).key('columnNesting_alignItems_022')
Column(){Text('3')}.width(300).height(150).backgroundColor(0xF5DEB3).key('columnNesting_alignItems_023')
}.key('columnNesting_alignItems_02').width(350).height(400).backgroundColor(0xAFEEEE).alignItems(HorizontalAlign.End)
}.width(300).height(1000).backgroundColor(0xF5DEB3).key('columnNesting_alignItems_1').alignItems(HorizontalAlign.Center)
}
}
\ No newline at end of file
/**
* Copyright (c) 2023 Huawei Device 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 columnNesting_justifyContent {
@State addSpace: string = '10vp'
messageManager:MessageManager = new MessageManager()
onPageShow() {
console.info('columnNesting_justifyContent onPageShow');
globalThis.value = {
name:'messageManager',message:this.messageManager
}
let callback:Callback = (message:any) => {
console.error('message = ' + message.name + "--" + message.value);
if (message.name == 'addSpace') {
this.addSpace = message.value;
}
}
this.messageManager.registerCallback(callback);
}
build() {
Column({space:10}){
Column({space:10}) {
Column(){Text('1')}.width(300).height(50).backgroundColor(0xF5DEB3).key('columnNesting_justifyContent_011')
Column(){Text('2')}.width(300).height(50).backgroundColor(0xD2B48C).key('columnNesting_justifyContent_012')
Column(){Text('3')}.width(300).height(50).backgroundColor(0xF5DEB3).key('columnNesting_justifyContent_013')
}.key('columnNesting_justifyContent_01').width(350).height(300).backgroundColor(0xAFEEEE).justifyContent(FlexAlign.Start)
Column({space:10}) {
Column(){Text('1')}.width(300).height(50).backgroundColor(0xF5DEB3).key('columnNesting_justifyContent_021')
Column(){Text('2')}.width(300).height(50).backgroundColor(0xD2B48C).key('columnNesting_justifyContent_022')
Column(){Text('3')}.width(300).height(50).backgroundColor(0xF5DEB3).key('columnNesting_justifyContent_023')
}.key('columnNesting_justifyContent_02').width(350).height(300).backgroundColor(0xAFEEEE).justifyContent(FlexAlign.End)
}.width(350).height(700).backgroundColor(0xF5DEB3).key('columnNesting_justifyContent_1').justifyContent(FlexAlign.SpaceBetween)
}
}
\ No newline at end of file
/**
* Copyright (c) 2023 Huawei Device 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 flexBasis_Default {
@State addflexBasis: number = 0
messageManager:MessageManager = new MessageManager()
onPageShow() {
console.info('flexBasis_Default onPageShow');
globalThis.value = {
name:'messageManager',message:this.messageManager
}
let callback:Callback = (message:any) => {
console.error('message = ' + message.name + "--" + message.value);
if (message.name == 'addflexBasis') {
this.addflexBasis = message.value;
}
}
this.messageManager.registerCallback(callback);
}
build() {
Column(){
Column({space:10}) {
Column(){Text('1')}.width(300).height(200).flexBasis(this.addflexBasis).backgroundColor(0xF5DEB3).key('Column_flexBasis_011')
Column(){Text('2')}.width(300).height(100).backgroundColor(0xD2B48C).key('Column_flexBasis_012')
Column(){Text('3')}.width(300).height(100).backgroundColor(0xF5DEB3).key('Column_flexBasis_013')
}.key('Column_flexBasis_01').width(350).height(470).backgroundColor(0xAFEEEE)
Column({space:10}) {
Column(){Text('1')}.width(300).height(200).backgroundColor(0xF5DEB3).key('Column_flexBasis_021')
Column(){Text('2')}.width(300).height(100).backgroundColor(0xD2B48C).key('Column_flexBasis_022')
Column(){Text('3')}.width(300).height(100).backgroundColor(0xF5DEB3).key('Column_flexBasis_023')
}.key('Column_flexBasis_02').width(350).height(470).backgroundColor(0xAFEEEE)
}
}
}
\ No newline at end of file
/**
* Copyright (c) 2023 Huawei Device 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 flexBasis_Type {
@State addflexBasis1: number = 0
@State addflexBasis2: string = '0'
messageManager:MessageManager = new MessageManager()
onPageShow() {
console.info('flexBasis_Type onPageShow');
globalThis.value = {
name:'messageManager',message:this.messageManager
}
let callback:Callback = (message:any) => {
console.error('message = ' + message.name + "--" + message.value);
if (message.name == 'addflexBasis1') {
this.addflexBasis1 = message.value;
}else if(message.name == 'addflexBasis2'){
this.addflexBasis2 = message.value;
}
}
this.messageManager.registerCallback(callback);
}
build() {
Column(){
Column({space:10}) {
Column(){Text('1')}.width(300).height(200).flexBasis(this.addflexBasis1).backgroundColor(0xF5DEB3).key('Column_flexBasis_011')
Column(){Text('2')}.width(300).height(100).backgroundColor(0xD2B48C).key('Column_flexBasis_012')
Column(){Text('3')}.width(300).height(100).backgroundColor(0xF5DEB3).key('Column_flexBasis_013')
}.key('Column_flexBasis_01').width(350).height(470).backgroundColor(0xAFEEEE)
Column({space:10}) {
Column(){Text('1')}.width(300).height(220).flexBasis(this.addflexBasis2).backgroundColor(0xF5DEB3).key('Column_flexBasis_021')
Column(){Text('2')}.width(300).height(100).backgroundColor(0xD2B48C).key('Column_flexBasis_022')
Column(){Text('3')}.width(300).height(100).backgroundColor(0xF5DEB3).key('Column_flexBasis_023')
}.key('Column_flexBasis_02').width(350).height(470).backgroundColor(0xAFEEEE)
}
}
}
\ No newline at end of file
/**
* Copyright (c) 2023 Huawei Device 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 flexGrow_Default {
@State addflexGrow: number = 0
messageManager:MessageManager = new MessageManager()
onPageShow() {
console.info('flexGrow_Default onPageShow');
globalThis.value = {
name:'messageManager',message:this.messageManager
}
let callback:Callback = (message:any) => {
console.error('message = ' + message.name + "--" + message.value);
if (message.name == 'addflexGrow') {
this.addflexGrow = message.value;
}
}
this.messageManager.registerCallback(callback);
}
build() {
Column(){
Column({space:10}) {
Column(){Text('1')}.width(300).height(100).flexGrow(this.addflexGrow).backgroundColor(0xF5DEB3).key('Column_flexGrow_Default_011')
Column(){Text('2')}.width(300).height(100).flexGrow(this.addflexGrow).backgroundColor(0xD2B48C).key('Column_flexGrow_Default_012')
Column(){Text('3')}.width(300).height(100).flexGrow(this.addflexGrow).backgroundColor(0xF5DEB3).key('Column_flexGrow_Default_013')
}.key('Column_flexGrow_Default_01').width(350).height(450).backgroundColor(0xAFEEEE)
Column({space:10}) {
Column(){Text('1')}.width(300).height(100).backgroundColor(0xF5DEB3).key('Column_flexGrow_Default_021')
Column(){Text('2')}.width(300).height(100).backgroundColor(0xD2B48C).key('Column_flexGrow_Default_022')
Column(){Text('3')}.width(300).height(100).backgroundColor(0xF5DEB3).key('Column_flexGrow_Default_023')
}.key('Column_flexGrow_Default_02').width(350).height(450).backgroundColor(0xAFEEEE)
}
}
}
\ No newline at end of file
/**
* Copyright (c) 2023 Huawei Device 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 flexGrow_Part {
@State addflexGrow1: number = 0
@State addflexGrow2: number = 0
@State addflexGrow3: number = 0
messageManager:MessageManager = new MessageManager()
onPageShow() {
console.info('flexGrow_Part onPageShow');
globalThis.value = {
name:'messageManager',message:this.messageManager
}
let callback:Callback = (message:any) => {
console.error('message = ' + message.name + "--" + message.value);
if (message.name == 'addflexGrow1') {
this.addflexGrow1 = message.value;
}else if (message.name == 'addflexGrow2') {
this.addflexGrow2 = message.value;
}
}
this.messageManager.registerCallback(callback);
}
build() {
Column(){
Column({space:10}) {
Column(){Text('1')}.width(300).height(100).layoutWeight(1).flexGrow(this.addflexGrow1).backgroundColor(0xF5DEB3).key('Column_flexGrow_011')
Column(){Text('2')}.width(300).height(100).flexGrow(this.addflexGrow2).backgroundColor(0xD2B48C).key('Column_flexGrow_012')
Column(){Text('3')}.width(300).height(100).flexGrow(this.addflexGrow3).backgroundColor(0xF5DEB3).key('Column_flexGrow_013')
}.key('Column_flexGrow_01').width(350).height(470).backgroundColor(0xAFEEEE)
Column({space:10}) {
Column(){Text('1')}.width(300).height(100).backgroundColor(0xF5DEB3).key('Column_flexGrow_021')
Column(){Text('2')}.width(300).height(100).backgroundColor(0xD2B48C).key('Column_flexGrow_022')
Column(){Text('3')}.width(300).height(100).backgroundColor(0xF5DEB3).key('Column_flexGrow_023')
}.key('Column_flexGrow_02').width(350).height(470).backgroundColor(0xAFEEEE)
}
}
}
\ No newline at end of file
/**
* Copyright (c) 2023 Huawei Device 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 flexShrink_Default {
@State addflexShrink: number = 0
messageManager:MessageManager = new MessageManager()
onPageShow() {
console.info('flexShrink_Default onPageShow');
globalThis.value = {
name:'messageManager',message:this.messageManager
}
let callback:Callback = (message:any) => {
console.error('message = ' + message.name + "--" + message.value);
if (message.name == 'addflexShrink') {
this.addflexShrink = message.value;
}
}
this.messageManager.registerCallback(callback);
}
build() {
Column(){
Column({space:10}) {
Column(){Text('1')}.width(300).height(200).flexShrink(this.addflexShrink).backgroundColor(0xF5DEB3).key('Column_flexShrink_011')
Column(){Text('2')}.width(300).height(100).flexShrink(this.addflexShrink).backgroundColor(0xD2B48C).key('Column_flexShrink_012')
Column(){Text('3')}.width(300).height(100).flexShrink(this.addflexShrink).backgroundColor(0xF5DEB3).key('Column_flexShrink_013')
}.key('Column_flexShrink_01').width(350).height(450).backgroundColor(0xAFEEEE)
Column({space:10}) {
Column(){Text('1')}.width(300).height(200).backgroundColor(0xF5DEB3).key('Column_flexShrink_011')
Column(){Text('2')}.width(300).height(100).backgroundColor(0xD2B48C).key('Column_flexShrink_012')
Column(){Text('3')}.width(300).height(100).backgroundColor(0xF5DEB3).key('Column_flexShrink_013')
}.key('Column_flexShrink_01').width(350).height(450).backgroundColor(0xAFEEEE)
}
}
}
\ No newline at end of file
/**
* Copyright (c) 2023 Huawei Device 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 flexShrink_Part {
@State addflexShrink: number = 0
messageManager:MessageManager = new MessageManager()
onPageShow() {
console.info('flexShrink_Part onPageShow');
globalThis.value = {
name:'messageManager',message:this.messageManager
}
let callback:Callback = (message:any) => {
console.error('message = ' + message.name + "--" + message.value);
if (message.name == 'addflexShrink') {
this.addflexShrink = message.value;
}
}
this.messageManager.registerCallback(callback);
}
build() {
Column({space:10}) {
Column(){Text('1')}.width(300).height(300).backgroundColor(0xF5DEB3).key('Column_flexShrink_011')
Column(){Text('2')}.width(300).height(100).flexShrink(this.addflexShrink).backgroundColor(0xD2B48C).key('Column_flexShrink_012')
Column(){Text('3')}.width(300).height(100).flexShrink(this.addflexShrink).backgroundColor(0xF5DEB3).key('Column_flexShrink_013')
}.key('Column_flexShrink_01').width(350).height(450).backgroundColor(0xAFEEEE)
}
}
\ No newline at end of file
/**
* Copyright (c) 2023 Huawei Device 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 layoutWeight_All {
@State layoutWeight1: string = '0'
@State layoutWeight2: string = '0'
@State layoutWeight3: string = '0'
messageManager:MessageManager = new MessageManager()
onPageShow() {
console.info('layoutWeight_All onPageShow');
globalThis.value = {
name:'messageManager',message:this.messageManager
}
let callback:Callback = (message:any) => {
console.error('message = ' + message.name + "--" + message.value);
if(message.name == 'layoutWeight1'){
this.layoutWeight1 = message.value;
}else if(message.name == 'layoutWeight2'){
this.layoutWeight2 = message.value;
}else if(message.name == 'layoutWeight3'){
this.layoutWeight3 = message.value;
}
}
this.messageManager.registerCallback(callback);
}
build() {
Column(){
Column({space:10}) {
Column(){Text('1')}.width(300).height(100).layoutWeight(this.layoutWeight1).backgroundColor(0xF5DEB3).key('Column_layoutWeight_All_021')
Column(){Text('2')}.width(300).height(100).layoutWeight(this.layoutWeight2).backgroundColor(0xD2B48C).key('Column_layoutWeight_All_022')
Column(){Text('3')}.width(300).height(100).layoutWeight(this.layoutWeight3).backgroundColor(0xF5DEB3).key('Column_layoutWeight_All_023')
}.key('Column_layoutWeight_All_02').width(350).height(470).backgroundColor(0xAFEEEE)
}
}
}
\ No newline at end of file
/**
* Copyright (c) 2023 Huawei Device 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 layoutWeight_Default {
@State layoutWeight1: number = 0
@State layoutWeight2: string = '0'
messageManager:MessageManager = new MessageManager()
onPageShow() {
console.info('layoutWeight_Default onPageShow');
globalThis.value = {
name:'messageManager',message:this.messageManager
}
let callback:Callback = (message:any) => {
console.error('message = ' + message.name + "--" + message.value);
if (message.name == 'layoutWeight1') {
this.layoutWeight1 = message.value;
}else if(message.name == 'layoutWeight2'){
this.layoutWeight2 = message.value;
}
}
this.messageManager.registerCallback(callback);
}
build() {
Column(){
Column({space:10}) {
Column(){Text('1')}.width(300).height(100).layoutWeight(this.layoutWeight1).backgroundColor(0xF5DEB3).key('Column_layoutWeight_011')
Column(){Text('2')}.width(300).height(100).backgroundColor(0xD2B48C).key('Column_layoutWeight_012')
Column(){Text('3')}.width(300).height(100).backgroundColor(0xF5DEB3).key('Column_layoutWeight_013')
}.key('Column_layoutWeight_01').width(350).height(450).backgroundColor(0xAFEEEE)
Column({space:10}) {
Column(){Text('1')}.width(300).height(100).layoutWeight(this.layoutWeight2).backgroundColor(0xF5DEB3).key('Column_layoutWeight_021')
Column(){Text('2')}.width(300).height(100).backgroundColor(0xD2B48C).key('Column_layoutWeight_022')
Column(){Text('3')}.width(300).height(100).backgroundColor(0xF5DEB3).key('Column_layoutWeight_023')
}.key('Column_layoutWeight_02').width(350).height(450).backgroundColor(0xAFEEEE)
}
}
}
\ No newline at end of file
/**
* Copyright (c) 2023 Huawei Device 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 layoutWeight_Part {
@State layoutWeight1: string = '0'
@State layoutWeight2: string = '0'
messageManager:MessageManager = new MessageManager()
onPageShow() {
console.info('layoutWeight_Part onPageShow');
globalThis.value = {
name:'messageManager',message:this.messageManager
}
let callback:Callback = (message:any) => {
console.error('message = ' + message.name + "--" + message.value);
if (message.name == 'layoutWeight1') {
this.layoutWeight1 = message.value;
}else if(message.name == 'layoutWeight2'){
this.layoutWeight2 = message.value;
}
}
this.messageManager.registerCallback(callback);
}
build() {
Column(){
Column({space:10}) {
Column(){Text('1')}.width(300).height(100).layoutWeight(this.layoutWeight1).backgroundColor(0xF5DEB3).key('Column_layoutWeight_021')
Column(){Text('2')}.width(300).height(100).layoutWeight(this.layoutWeight2).backgroundColor(0xD2B48C).key('Column_layoutWeight_022')
Column(){Text('3')}.width(300).height(100).backgroundColor(0xF5DEB3).key('Column_layoutWeight_023')
}.key('Column_layoutWeight_02').width(350).height(450).backgroundColor(0xAFEEEE)
}
}
}
\ No newline at end of file
/**
* Copyright (c) 2023 Huawei Device 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 layoutWeight_flexGrow {
@State addLayoutWeight: number = 0
messageManager:MessageManager = new MessageManager()
onPageShow() {
console.info('layoutWeight_flexGrow onPageShow');
globalThis.value = {
name:'messageManager',message:this.messageManager
}
let callback:Callback = (message:any) => {
console.error('message = ' + message.name + "--" + message.value);
if (message.name == 'addLayoutWeight') {
this.addLayoutWeight = message.value;
}
}
this.messageManager.registerCallback(callback);
}
build() {
Column({space:10}) {
Column(){Text('1')}.width(300).height(100).flexGrow(1).layoutWeight(this.addLayoutWeight).backgroundColor(0xF5DEB3).key('Column_layoutWeight_011')
Column(){Text('2')}.width(300).height(100).flexGrow(2).layoutWeight(this.addLayoutWeight).backgroundColor(0xD2B48C).key('Column_layoutWeight_012')
Column(){Text('3')}.width(300).height(100).flexGrow(1).layoutWeight(this.addLayoutWeight).backgroundColor(0xF5DEB3).key('Column_layoutWeight_013')
}.key('Column_layoutWeight_01').width(350).height(470).backgroundColor(0xAFEEEE)
}
}
\ No newline at end of file
/**
* Copyright (c) 2023 Huawei Device 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 layoutWeight_flexShrink {
@State addLayoutWeight: number = 0
messageManager:MessageManager = new MessageManager()
onPageShow() {
console.info('layoutWeight_flexShrink onPageShow');
globalThis.value = {
name:'messageManager',message:this.messageManager
}
let callback:Callback = (message:any) => {
console.error('message = ' + message.name + "--" + message.value);
if (message.name == 'addLayoutWeight') {
this.addLayoutWeight = message.value;
}
}
this.messageManager.registerCallback(callback);
}
build() {
Column({space:10}) {
Column(){Text('1')}.width(300).height(100).flexShrink(1).layoutWeight(this.addLayoutWeight).backgroundColor(0xF5DEB3).key('Column_layoutWeight_011')
Column(){Text('2')}.width(300).height(100).flexShrink(2).layoutWeight(this.addLayoutWeight).backgroundColor(0xD2B48C).key('Column_layoutWeight_012')
Column(){Text('3')}.width(300).height(100).flexShrink(2).layoutWeight(this.addLayoutWeight).backgroundColor(0xF5DEB3).key('Column_layoutWeight_013')
}.key('Column_layoutWeight_01').width(350).height(470).backgroundColor(0xAFEEEE)
}
}
\ No newline at end of file
/**
* Copyright (c) 2023 Huawei Device 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 Column_Space_Default {
@State addSpace1:number=0
@State addSpace2:string='0'
messageManager:MessageManager = new MessageManager()
onPageShow() {
console.info('Column_Space_Default onPageShow');
globalThis.value = {
name:'messageManager',message:this.messageManager
}
let callback:Callback = (message:any) => {
console.error('message = ' + message.name + "--" + message.value);
if (message.name == 'addSpace1') {
this.addSpace1 = message.value;
}else if(message.name == 'addSpace2'){
this.addSpace2 = message.value;
}
}
this.messageManager.registerCallback(callback);
}
build() {
Column(){
Column({space:this.addSpace1}) {
Column(){Text('1')}.width(300).height(50).backgroundColor(0xF5DEB3).key('Column_Space_Default_011')
Column(){Text('2')}.width(300).height(100).backgroundColor(0xD2B48C).key('Column_Space_Default_012')
Column(){Text('3')}.width(300).height(150).backgroundColor(0xF5DEB3).key('Column_Space_Default_013')
}.key('Column_Space_Default_01').width(350).height(400).backgroundColor(0xAFEEEE)
Column({space:this.addSpace2}) {
Column(){Text('1')}.width(300).height(50).backgroundColor(0xF5DEB3).key('Column_Space_Default_021')
Column(){Text('2')}.width(300).height(100).backgroundColor(0xD2B48C).key('Column_Space_Default_022')
Column(){Text('3')}.width(300).height(150).backgroundColor(0xF5DEB3).key('Column_Space_Default_023')
}.key('Column_Space_Default_02').width(350).height(400).backgroundColor(0xAFEEEE)
}
}
}
\ No newline at end of file
/**
* Copyright (c) 2023 Huawei Device 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 Column_Space_String {
@State addSpace: string = '10vp'
messageManager:MessageManager = new MessageManager()
onPageShow() {
console.info('Column_Space_String onPageShow');
globalThis.value = {
name:'messageManager',message:this.messageManager
}
let callback:Callback = (message:any) => {
console.error('message = ' + message.name + "--" + message.value);
if (message.name == 'addSpace') {
this.addSpace = message.value;
}
}
this.messageManager.registerCallback(callback);
}
build() {
Column({space:this.addSpace}) {
Column(){Text('1')}.width(300).height(50).backgroundColor(0xF5DEB3).key('Column_Space_String_011')
Column(){Text('2')}.width(300).height(100).backgroundColor(0xD2B48C).key('Column_Space_String_012')
Column(){Text('3')}.width(300).height(150).backgroundColor(0xF5DEB3).key('Column_Space_String_013')
}.key('Column_Space_String_01').width(350).height(400).backgroundColor(0xAFEEEE)
}
}
\ No newline at end of file
/**
* Copyright (c) 2023 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium';
import router from '@ohos.router';
import CommonFunc from '../../../MainAbility/common/Common';
import {MessageManager,Callback} from '../../../MainAbility/common/MessageManager';
export default function columnNesting_Space() {
describe('columnNesting_Space', function () {
beforeEach(async function (done) {
console.info("columnNesting_Space beforeEach start");
let options = {
url: "MainAbility/pages/Column/columnNesting/columnNesting_Space",
}
try {
router.clear();
let pages = router.getState();
console.info("get columnNesting_Space state pages1:" + JSON.stringify(pages));
if (!("columnNesting_Space" == pages.name)) {
console.info("get columnNesting_Space pages.name:" + JSON.stringify(pages.name));
let result = await router.push(options);
await CommonFunc.sleep(2000);
pages = router.getState();
console.info("get columnNesting_Space state pages2:" + JSON.stringify(pages));
console.info("push columnNesting_Space page result:" + JSON.stringify(result));
}
} catch (err) {
console.error("push columnNesting_Space page error " + JSON.stringify(err));
expect().assertFail();
}
done();
});
afterEach(async function () {
await CommonFunc.sleep(2000);
console.info("columnNesting_Space after each called")
});
/**
* @tc.number SUB_ACE_columnNesting_Space_TEST_0100
* @tc.name testColumnSpace
* @tc.desc column_1 and column_01, column_02 settings space do not affect each other
*/
it('SUB_ACE_columnNesting_Space_TEST_0100', 0, async function (done) {
console.info('[SUB_ACE_columnNesting_Space_TEST_0100] START');
await CommonFunc.sleep(4000);
console.log('get Initial value')
let columnNesting_Space_011 = CommonFunc.getComponentRect('columnNesting_Space_011');
let columnNesting_Space_012 = CommonFunc.getComponentRect('columnNesting_Space_012');
let columnNesting_Space_013 = CommonFunc.getComponentRect('columnNesting_Space_013');
let columnNesting_Space_01 = CommonFunc.getComponentRect('columnNesting_Space_01');
let columnNesting_Space_021 = CommonFunc.getComponentRect('columnNesting_Space_021');
let columnNesting_Space_022 = CommonFunc.getComponentRect('columnNesting_Space_022');
let columnNesting_Space_023 = CommonFunc.getComponentRect('columnNesting_Space_023');
let columnNesting_Space_02 = CommonFunc.getComponentRect('columnNesting_Space_02');
let columnNesting_Space_1 = CommonFunc.getComponentRect('columnNesting_Space_1');
console.log('assert position')
expect(Math.round(columnNesting_Space_011.left - columnNesting_Space_01.left)).assertEqual(Math.round(columnNesting_Space_01.right - columnNesting_Space_011.right));
expect(Math.round(columnNesting_Space_012.left - columnNesting_Space_01.left)).assertEqual(Math.round(columnNesting_Space_01.right - columnNesting_Space_012.right));
expect(Math.round(columnNesting_Space_013.left - columnNesting_Space_01.left)).assertEqual(Math.round(columnNesting_Space_01.right - columnNesting_Space_013.right));
expect(Math.round(columnNesting_Space_012.top - columnNesting_Space_011.bottom)).assertEqual(Math.round(columnNesting_Space_013.top - columnNesting_Space_012.bottom))
expect(Math.round(columnNesting_Space_021.left - columnNesting_Space_02.left)).assertEqual(Math.round(columnNesting_Space_02.right - columnNesting_Space_021.right));
expect(Math.round(columnNesting_Space_022.left - columnNesting_Space_02.left)).assertEqual(Math.round(columnNesting_Space_02.right - columnNesting_Space_022.right));
expect(Math.round(columnNesting_Space_023.left - columnNesting_Space_02.left)).assertEqual(Math.round(columnNesting_Space_02.right - columnNesting_Space_023.right));
expect(Math.round(columnNesting_Space_022.top - columnNesting_Space_021.bottom)).assertEqual(Math.round(columnNesting_Space_023.top - columnNesting_Space_022.bottom))
expect(columnNesting_Space_01.top).assertEqual(columnNesting_Space_011.top);
console.log('assert space')
expect(Math.round(columnNesting_Space_012.top - columnNesting_Space_011.bottom)).assertEqual(Math.round(vp2px(10)));
console.log('columnNesting_Space_012.top - columnNesting_Space_011.bottom', + columnNesting_Space_012.top - columnNesting_Space_011.bottom)
expect(Math.round(columnNesting_Space_013.top - columnNesting_Space_012.bottom)).assertEqual(Math.round(vp2px(10)));
console.log('columnNesting_Space_013.top - columnNesting_Space_012.bottom', + columnNesting_Space_013.top - columnNesting_Space_012.bottom)
expect(Math.round(columnNesting_Space_022.top - columnNesting_Space_021.bottom)).assertEqual(Math.round(vp2px(10)));
console.log('columnNesting_Space_012.top - columnNesting_Space_011.bottom', + columnNesting_Space_012.top - columnNesting_Space_011.bottom)
expect(Math.round(columnNesting_Space_023.top - columnNesting_Space_022.bottom)).assertEqual(Math.round(vp2px(10)));
console.log('columnNesting_Space_013.top - columnNesting_Space_012.bottom', + columnNesting_Space_013.top - columnNesting_Space_012.bottom)
expect(Math.round(columnNesting_Space_02.top - columnNesting_Space_01.bottom)).assertEqual(Math.round(vp2px(30)));
console.log('columnNesting_Space_02.top - columnNesting_Space_01.bottom', + columnNesting_Space_02.top - columnNesting_Space_01.bottom)
console.log('assert height')
console.log('column_01 assert height')
expect(Math.round(columnNesting_Space_011.bottom - columnNesting_Space_011.top)).assertEqual(vp2px(50));
expect(Math.round(columnNesting_Space_012.bottom - columnNesting_Space_012.top)).assertEqual(vp2px(100));
expect(Math.round(columnNesting_Space_013.bottom - columnNesting_Space_013.top)).assertEqual(vp2px(150));
console.log('column_02 assert height')
expect(Math.round(columnNesting_Space_021.bottom - columnNesting_Space_021.top)).assertEqual(vp2px(50));
expect(Math.round(columnNesting_Space_022.bottom - columnNesting_Space_022.top)).assertEqual(vp2px(100));
expect(Math.round(columnNesting_Space_023.bottom - columnNesting_Space_023.top)).assertEqual(vp2px(150));
expect(Math.round(columnNesting_Space_01.bottom - columnNesting_Space_01.top)).assertEqual(vp2px(400));
expect(Math.round(columnNesting_Space_02.bottom - columnNesting_Space_02.top)).assertEqual(vp2px(400));
console.log('assert weight')
expect(Math.round(columnNesting_Space_011.right - columnNesting_Space_011.left)).assertEqual(vp2px(300));
expect(Math.round(columnNesting_Space_012.right - columnNesting_Space_012.left)).assertEqual(vp2px(300));
expect(Math.round(columnNesting_Space_013.right - columnNesting_Space_013.left)).assertEqual(vp2px(300));
expect(Math.round(columnNesting_Space_021.right - columnNesting_Space_021.left)).assertEqual(vp2px(300));
expect(Math.round(columnNesting_Space_022.right - columnNesting_Space_022.left)).assertEqual(vp2px(300));
expect(Math.round(columnNesting_Space_023.right - columnNesting_Space_023.left)).assertEqual(vp2px(300));
expect(Math.round(columnNesting_Space_01.right - columnNesting_Space_01.left)).assertEqual(vp2px(350));
expect(Math.round(columnNesting_Space_02.right - columnNesting_Space_02.left)).assertEqual(vp2px(350));
console.info('[SUB_ACE_columnNesting_Space_TEST_0100] END');
done();
});
})
}
\ No newline at end of file
/**
* Copyright (c) 2023 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium';
import router from '@ohos.router';
import CommonFunc from '../../../MainAbility/common/Common';
import {MessageManager,Callback} from '../../../MainAbility/common/MessageManager';
export default function columnNesting_alignItems() {
describe('columnNesting_alignItems', function () {
beforeEach(async function (done) {
console.info("columnNesting_alignItems beforeEach start");
let options = {
url: "MainAbility/pages/Column/columnNesting/columnNesting_alignItems",
}
try {
router.clear();
let pages = router.getState();
console.info("get columnNesting_alignItems state pages1:" + JSON.stringify(pages));
if (!("columnNesting_alignItems" == pages.name)) {
console.info("get columnNesting_alignItems pages.name:" + JSON.stringify(pages.name));
let result = await router.push(options);
await CommonFunc.sleep(2000);
pages = router.getState();
console.info("get columnNesting_alignItems state pages2:" + JSON.stringify(pages));
console.info("push columnNesting_alignItems page result:" + JSON.stringify(result));
}
} catch (err) {
console.error("push columnNesting_alignItems page error " + JSON.stringify(err));
expect().assertFail();
}
done();
});
afterEach(async function () {
await CommonFunc.sleep(2000);
console.info("columnNesting_alignItems after each called")
});
/**
* @tc.number SUB_ACE_columnNesting_alignItems_TEST_0100
* @tc.name testColumnSpace
* @tc.desc column_1 and column_01, column_02 settings justifyContent do not affect each other
*/
it('SUB_ACE_columnNesting_alignItems_TEST_0100', 0, async function (done) {
console.info('[SUB_ACE_columnNesting_alignItems_TEST_0100] START');
await CommonFunc.sleep(4000);
console.log('get Initial value')
let columnNesting_alignItems_011 = CommonFunc.getComponentRect('columnNesting_alignItems_011');
let columnNesting_alignItems_012 = CommonFunc.getComponentRect('columnNesting_alignItems_012');
let columnNesting_alignItems_013 = CommonFunc.getComponentRect('columnNesting_alignItems_013');
let columnNesting_alignItems_01 = CommonFunc.getComponentRect('columnNesting_alignItems_01');
let columnNesting_alignItems_021 = CommonFunc.getComponentRect('columnNesting_alignItems_021');
let columnNesting_alignItems_022 = CommonFunc.getComponentRect('columnNesting_alignItems_022');
let columnNesting_alignItems_023 = CommonFunc.getComponentRect('columnNesting_alignItems_023');
let columnNesting_alignItems_02 = CommonFunc.getComponentRect('columnNesting_alignItems_02');
let columnNesting_alignItems_1 = CommonFunc.getComponentRect('columnNesting_alignItems_1');
console.log('assert position')
expect(columnNesting_alignItems_011.left).assertEqual(columnNesting_alignItems_01.left );
expect(columnNesting_alignItems_012.left).assertEqual(columnNesting_alignItems_01.left );
expect(columnNesting_alignItems_013.left).assertEqual(columnNesting_alignItems_01.left );
expect(columnNesting_alignItems_021.right).assertEqual(columnNesting_alignItems_02.right);
expect(columnNesting_alignItems_022.right).assertEqual(columnNesting_alignItems_02.right);
expect(columnNesting_alignItems_023.right).assertEqual(columnNesting_alignItems_02.right);
expect(columnNesting_alignItems_01.top).assertEqual(columnNesting_alignItems_011.top);
expect(columnNesting_alignItems_1.top).assertEqual(columnNesting_alignItems_01.top);
console.log('assert space')
expect(Math.round(columnNesting_alignItems_012.top - columnNesting_alignItems_011.bottom)).assertEqual(Math.round(columnNesting_alignItems_013.top - columnNesting_alignItems_012.bottom))
expect(Math.round(columnNesting_alignItems_022.top - columnNesting_alignItems_021.bottom)).assertEqual(Math.round(columnNesting_alignItems_023.top - columnNesting_alignItems_022.bottom))
expect(Math.round(columnNesting_alignItems_012.top - columnNesting_alignItems_011.bottom)).assertEqual(Math.round(vp2px(10)));
console.log('columnNesting_alignItems_012.top - columnNesting_alignItems_011.bottom', + columnNesting_alignItems_012.top - columnNesting_alignItems_011.bottom)
expect(Math.round(columnNesting_alignItems_013.top - columnNesting_alignItems_012.bottom)).assertEqual(Math.round(vp2px(10)));
console.log('columnNesting_alignItems_013.top - columnNesting_alignItems_012.bottom', + columnNesting_alignItems_013.top - columnNesting_alignItems_012.bottom)
expect(Math.round(columnNesting_alignItems_022.top - columnNesting_alignItems_021.bottom)).assertEqual(Math.round(vp2px(10)));
console.log('columnNesting_alignItems_012.top - columnNesting_alignItems_011.bottom', + columnNesting_alignItems_012.top - columnNesting_alignItems_011.bottom)
expect(Math.round(columnNesting_alignItems_023.top - columnNesting_alignItems_022.bottom)).assertEqual(Math.round(vp2px(10)));
console.log('columnNesting_alignItems_013.top - columnNesting_alignItems_012.bottom', + columnNesting_alignItems_013.top - columnNesting_alignItems_012.bottom)
expect(Math.round(columnNesting_alignItems_02.top - columnNesting_alignItems_01.bottom)).assertEqual(Math.round(vp2px(30)));
console.log('columnNesting_alignItems_02.top - columnNesting_alignItems_01.bottom', + columnNesting_alignItems_02.top - columnNesting_alignItems_01.bottom)
console.log('assert height')
console.log('column_01 assert height')
expect(Math.round(columnNesting_alignItems_011.bottom - columnNesting_alignItems_011.top)).assertEqual(vp2px(50));
expect(Math.round(columnNesting_alignItems_012.bottom - columnNesting_alignItems_012.top)).assertEqual(vp2px(100));
expect(Math.round(columnNesting_alignItems_013.bottom - columnNesting_alignItems_013.top)).assertEqual(vp2px(150));
console.log('column_02 assert height')
expect(Math.round(columnNesting_alignItems_021.bottom - columnNesting_alignItems_021.top)).assertEqual(vp2px(50));
expect(Math.round(columnNesting_alignItems_022.bottom - columnNesting_alignItems_022.top)).assertEqual(vp2px(100));
expect(Math.round(columnNesting_alignItems_023.bottom - columnNesting_alignItems_023.top)).assertEqual(vp2px(150));
expect(Math.round(columnNesting_alignItems_01.bottom - columnNesting_alignItems_01.top)).assertEqual(vp2px(400));
expect(Math.round(columnNesting_alignItems_02.bottom - columnNesting_alignItems_02.top)).assertEqual(vp2px(400));
console.log('assert weight')
console.log('column_01 assert weight')
expect(Math.round(columnNesting_alignItems_011.right - columnNesting_alignItems_011.left)).assertEqual(vp2px(300));
expect(Math.round(columnNesting_alignItems_012.right - columnNesting_alignItems_012.left)).assertEqual(vp2px(300));
expect(Math.round(columnNesting_alignItems_013.right - columnNesting_alignItems_013.left)).assertEqual(vp2px(300));
console.log('column_02 assert weight')
expect(Math.round(columnNesting_alignItems_021.right - columnNesting_alignItems_021.left)).assertEqual(vp2px(300));
expect(Math.round(columnNesting_alignItems_022.right - columnNesting_alignItems_022.left)).assertEqual(vp2px(300));
expect(Math.round(columnNesting_alignItems_023.right - columnNesting_alignItems_023.left)).assertEqual(vp2px(300));
expect(Math.round(columnNesting_alignItems_01.right - columnNesting_alignItems_01.left)).assertEqual(vp2px(350));
expect(Math.round(columnNesting_alignItems_02.right - columnNesting_alignItems_02.left)).assertEqual(vp2px(350));
console.info('[SUB_ACE_columnNesting_alignItems_TEST_0100] END');
done();
});
})
}
\ No newline at end of file
/**
* Copyright (c) 2023 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium';
import router from '@ohos.router';
import CommonFunc from '../../../MainAbility/common/Common';
import {MessageManager,Callback} from '../../../MainAbility/common/MessageManager';
export default function columnNesting_justifyContent() {
describe('columnNesting_justifyContent', function () {
beforeEach(async function (done) {
console.info("columnNesting_justifyContent beforeEach start");
let options = {
url: "MainAbility/pages/Column/columnNesting/columnNesting_justifyContent",
}
try {
router.clear();
let pages = router.getState();
console.info("get columnNesting_justifyContent state pages1:" + JSON.stringify(pages));
if (!("columnNesting_justifyContent" == pages.name)) {
console.info("get columnNesting_justifyContent pages.name:" + JSON.stringify(pages.name));
let result = await router.push(options);
await CommonFunc.sleep(2000);
pages = router.getState();
console.info("get columnNesting_justifyContent state pages2:" + JSON.stringify(pages));
console.info("push columnNesting_justifyContent page result:" + JSON.stringify(result));
}
} catch (err) {
console.error("push columnNesting_justifyContent page error " + JSON.stringify(err));
expect().assertFail();
}
done();
});
afterEach(async function () {
await CommonFunc.sleep(2000);
console.info("columnNesting_justifyContent after each called")
});
/**
* @tc.number SUB_ACE_columnNesting_justifyContent_TEST_0100
* @tc.name testColumnSpace
* @tc.desc column_1 and column_01, column_02 settings justifyContent do not affect each other
*/
it('SUB_ACE_columnNesting_justifyContent_TEST_0100', 0, async function (done) {
console.info('[SUB_ACE_columnNesting_justifyContent_TEST_0100] START');
await CommonFunc.sleep(4000);
console.log('get Initial value')
let columnNesting_justifyContent_011 = CommonFunc.getComponentRect('columnNesting_justifyContent_011');
let columnNesting_justifyContent_012 = CommonFunc.getComponentRect('columnNesting_justifyContent_012');
let columnNesting_justifyContent_013 = CommonFunc.getComponentRect('columnNesting_justifyContent_013');
let columnNesting_justifyContent_01 = CommonFunc.getComponentRect('columnNesting_justifyContent_01');
let columnNesting_justifyContent_021 = CommonFunc.getComponentRect('columnNesting_justifyContent_021');
let columnNesting_justifyContent_022 = CommonFunc.getComponentRect('columnNesting_justifyContent_022');
let columnNesting_justifyContent_023 = CommonFunc.getComponentRect('columnNesting_justifyContent_023');
let columnNesting_justifyContent_02 = CommonFunc.getComponentRect('columnNesting_justifyContent_02');
let columnNesting_justifyContent_1 = CommonFunc.getComponentRect('columnNesting_justifyContent_1');
console.log('assert position')
expect(Math.round(columnNesting_justifyContent_011.left - columnNesting_justifyContent_01.left)).assertEqual(Math.round(columnNesting_justifyContent_01.right - columnNesting_justifyContent_011.right));
expect(Math.round(columnNesting_justifyContent_012.left - columnNesting_justifyContent_01.left)).assertEqual(Math.round(columnNesting_justifyContent_01.right - columnNesting_justifyContent_012.right));
expect(Math.round(columnNesting_justifyContent_013.left - columnNesting_justifyContent_01.left)).assertEqual(Math.round(columnNesting_justifyContent_01.right - columnNesting_justifyContent_013.right));
expect(Math.round(columnNesting_justifyContent_021.left - columnNesting_justifyContent_02.left)).assertEqual(Math.round(columnNesting_justifyContent_02.right - columnNesting_justifyContent_021.right));
expect(Math.round(columnNesting_justifyContent_022.left - columnNesting_justifyContent_02.left)).assertEqual(Math.round(columnNesting_justifyContent_02.right - columnNesting_justifyContent_022.right));
expect(Math.round(columnNesting_justifyContent_023.left - columnNesting_justifyContent_02.left)).assertEqual(Math.round(columnNesting_justifyContent_02.right - columnNesting_justifyContent_023.right));
expect(columnNesting_justifyContent_01.top).assertEqual(columnNesting_justifyContent_011.top);
expect(columnNesting_justifyContent_1.top).assertEqual(columnNesting_justifyContent_01.top);
console.log('assert space')
expect(Math.round(columnNesting_justifyContent_012.top - columnNesting_justifyContent_011.bottom)).assertEqual(Math.round(columnNesting_justifyContent_013.top - columnNesting_justifyContent_012.bottom))
expect(Math.round(columnNesting_justifyContent_022.top - columnNesting_justifyContent_021.bottom)).assertEqual(Math.round(columnNesting_justifyContent_023.top - columnNesting_justifyContent_022.bottom))
expect(Math.round(columnNesting_justifyContent_012.top - columnNesting_justifyContent_011.bottom)).assertEqual(Math.round(vp2px(10)));
console.log('columnNesting_justifyContent_012.top - columnNesting_justifyContent_011.bottom', + columnNesting_justifyContent_012.top - columnNesting_justifyContent_011.bottom)
expect(Math.round(columnNesting_justifyContent_013.top - columnNesting_justifyContent_012.bottom)).assertEqual(Math.round(vp2px(10)));
console.log('columnNesting_justifyContent_013.top - columnNesting_justifyContent_012.bottom', + columnNesting_justifyContent_013.top - columnNesting_justifyContent_012.bottom)
expect(Math.round(columnNesting_justifyContent_022.top - columnNesting_justifyContent_021.bottom)).assertEqual(Math.round(vp2px(10)));
console.log('columnNesting_justifyContent_012.top - columnNesting_justifyContent_011.bottom', + columnNesting_justifyContent_012.top - columnNesting_justifyContent_011.bottom)
expect(Math.round(columnNesting_justifyContent_023.top - columnNesting_justifyContent_022.bottom)).assertEqual(Math.round(vp2px(10)));
console.log('columnNesting_justifyContent_013.top - columnNesting_justifyContent_012.bottom', + columnNesting_justifyContent_013.top - columnNesting_justifyContent_012.bottom)
expect(Math.round(columnNesting_justifyContent_02.top - columnNesting_justifyContent_01.bottom)).assertEqual(Math.round(vp2px(100)));
console.log('columnNesting_justifyContent_02.top - columnNesting_justifyContent_01.bottom', + columnNesting_justifyContent_02.top - columnNesting_justifyContent_01.bottom)
console.log('assert height')
console.log('column_01 assert height')
expect(Math.round(columnNesting_justifyContent_011.bottom - columnNesting_justifyContent_011.top)).assertEqual(vp2px(50));
expect(Math.round(columnNesting_justifyContent_012.bottom - columnNesting_justifyContent_012.top)).assertEqual(vp2px(50));
expect(Math.round(columnNesting_justifyContent_013.bottom - columnNesting_justifyContent_013.top)).assertEqual(vp2px(50));
console.log('column_02 assert height')
expect(Math.round(columnNesting_justifyContent_021.bottom - columnNesting_justifyContent_021.top)).assertEqual(vp2px(50));
expect(Math.round(columnNesting_justifyContent_022.bottom - columnNesting_justifyContent_022.top)).assertEqual(vp2px(50));
expect(Math.round(columnNesting_justifyContent_023.bottom - columnNesting_justifyContent_023.top)).assertEqual(vp2px(50));
expect(Math.round(columnNesting_justifyContent_01.bottom - columnNesting_justifyContent_01.top)).assertEqual(vp2px(300));
expect(Math.round(columnNesting_justifyContent_02.bottom - columnNesting_justifyContent_02.top)).assertEqual(vp2px(300));
console.log('assert weight')
console.log('column_01 assert weight')
expect(Math.round(columnNesting_justifyContent_011.right - columnNesting_justifyContent_011.left)).assertEqual(vp2px(300));
expect(Math.round(columnNesting_justifyContent_012.right - columnNesting_justifyContent_012.left)).assertEqual(vp2px(300));
expect(Math.round(columnNesting_justifyContent_013.right - columnNesting_justifyContent_013.left)).assertEqual(vp2px(300));
console.log('column_02 assert weight')
expect(Math.round(columnNesting_justifyContent_021.right - columnNesting_justifyContent_021.left)).assertEqual(vp2px(300));
expect(Math.round(columnNesting_justifyContent_022.right - columnNesting_justifyContent_022.left)).assertEqual(vp2px(300));
expect(Math.round(columnNesting_justifyContent_023.right - columnNesting_justifyContent_023.left)).assertEqual(vp2px(300));
expect(Math.round(columnNesting_justifyContent_01.right - columnNesting_justifyContent_01.left)).assertEqual(vp2px(350));
expect(Math.round(columnNesting_justifyContent_02.right - columnNesting_justifyContent_02.left)).assertEqual(vp2px(350));
console.info('[SUB_ACE_columnNesting_justifyContent_TEST_0100] END');
done();
});
})
}
\ No newline at end of file
/**
* Copyright (c) 2023 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium';
import router from '@ohos.router';
import CommonFunc from '../../../MainAbility/common/Common';
import {MessageManager,Callback} from '../../../MainAbility/common/MessageManager';
export default function flexBasis_Default() {
describe('flexBasis_Default', function () {
beforeEach(async function (done) {
console.info("flexBasis_Default beforeEach start");
let options = {
url: "MainAbility/pages/Column/flexBasis/flexBasis_Default",
}
try {
router.clear();
let pages = router.getState();
console.info("get flexBasis_Default state pages:" + JSON.stringify(pages));
if (!("flexBasis_Default" == pages.name)) {
console.info("get flexBasis_Default pages.name:" + JSON.stringify(pages.name));
let result = await router.push(options);
await CommonFunc.sleep(2000);
console.info("push flexBasis_Default page result:" + JSON.stringify(result));
}
} catch (err) {
console.error("push flexBasis_Default page error " + JSON.stringify(err));
expect().assertFail();
}
done();
});
afterEach(async function () {
await CommonFunc.sleep(2000);
console.info("flexBasis_Default after each called")
});
/**
* @tc.number SUB_ACE_flexBasis_Default_TEST_0100
* @tc.name testFlexBasis
* @tc.desc column1 is set to flexBasis(null) , the height of column1 is the original height
*/
it('SUB_ACE_flexBasis_Default_TEST_0100', 0, async function (done) {
console.info('[SUB_ACE_flexBasis_Default_TEST_0100] START');
globalThis.value.message.notify({name:'addflexBasis', value:null});
await CommonFunc.sleep(3000);
let Column_flexBasis_011 = CommonFunc.getComponentRect('Column_flexBasis_011');
let Column_flexBasis_012 = CommonFunc.getComponentRect('Column_flexBasis_012');
let Column_flexBasis_013 = CommonFunc.getComponentRect('Column_flexBasis_013');
let Column_flexBasis_01 = CommonFunc.getComponentRect('Column_flexBasis_01');
console.log('assert position')
expect(Math.round(Column_flexBasis_011.left - Column_flexBasis_01.left)).assertEqual(Math.round(Column_flexBasis_01.right - Column_flexBasis_011.right));
expect(Math.round(Column_flexBasis_012.left - Column_flexBasis_01.left)).assertEqual(Math.round(Column_flexBasis_01.right - Column_flexBasis_012.right));
expect(Math.round(Column_flexBasis_013.left - Column_flexBasis_01.left)).assertEqual(Math.round(Column_flexBasis_01.right - Column_flexBasis_013.right));
expect(Math.round(Column_flexBasis_012.top - Column_flexBasis_011.bottom)).assertEqual(Math.round(Column_flexBasis_013.top - Column_flexBasis_012.bottom))
console.log('assert space')
expect(Math.round(Column_flexBasis_012.top - Column_flexBasis_011.bottom)).assertEqual(vp2px(10));
expect(Math.round(Column_flexBasis_013.top - Column_flexBasis_012.bottom)).assertEqual(vp2px(10));
console.log('Column_flexBasis_012.top - Column_flexBasis_011.bottom', + Column_flexBasis_012.top - Column_flexBasis_011.bottom)
console.log('Column_flexBasis_013.top - Column_flexBasis_012.bottom', + Column_flexBasis_013.top - Column_flexBasis_012.bottom)
expect(Column_flexBasis_01.top).assertEqual(Column_flexBasis_011.top);
console.log('assert height')
expect(Math.round(Column_flexBasis_011.bottom - Column_flexBasis_011.top)).assertEqual(vp2px(200));
console.log('Column_flexBasis_011.bottom - Column_flexBasis_011.top', + Column_flexBasis_011.bottom - Column_flexBasis_011.top)
expect(Math.round(Column_flexBasis_012.bottom - Column_flexBasis_012.top)).assertEqual(vp2px(100));
console.log('Column_flexBasis_012.bottom - Column_flexBasis_012.top', + Column_flexBasis_012.bottom - Column_flexBasis_012.top)
expect(Math.round(Column_flexBasis_013.bottom - Column_flexBasis_013.top)).assertEqual(vp2px(100));
console.log('Column_flexBasis_013.bottom - Column_flexBasis_013.top', + Column_flexBasis_013.bottom - Column_flexBasis_013.top)
console.log('assert weight')
expect(Math.round(Column_flexBasis_011.right - Column_flexBasis_011.left)).assertEqual(vp2px(300));
expect(Math.round(Column_flexBasis_012.right - Column_flexBasis_012.left)).assertEqual(vp2px(300));
expect(Math.round(Column_flexBasis_013.right - Column_flexBasis_013.left)).assertEqual(vp2px(300));
console.info('[SUB_ACE_flexBasis_Default_TEST_0100] END');
done();
});
/**
* @tc.number SUB_ACE_flexBasis_Default_TEST_0200
* @tc.name testFlexBasis
* @tc.desc column1 is set to flexBasis(undefined) , the height of column1 is the original height
*/
it('SUB_ACE_flexBasis_Default_TEST_0200', 0, async function (done) {
console.info('[SUB_ACE_flexBasis_Default_TEST_0200] START');
globalThis.value.message.notify({name:'addflexBasis', value:undefined});
await CommonFunc.sleep(3000);
let Column_flexBasis_011 = CommonFunc.getComponentRect('Column_flexBasis_011');
let Column_flexBasis_012 = CommonFunc.getComponentRect('Column_flexBasis_012');
let Column_flexBasis_013 = CommonFunc.getComponentRect('Column_flexBasis_013');
let Column_flexBasis_01 = CommonFunc.getComponentRect('Column_flexBasis_01');
console.log('assert position')
expect(Math.round(Column_flexBasis_011.left - Column_flexBasis_01.left)).assertEqual(Math.round(Column_flexBasis_01.right - Column_flexBasis_011.right));
expect(Math.round(Column_flexBasis_012.left - Column_flexBasis_01.left)).assertEqual(Math.round(Column_flexBasis_01.right - Column_flexBasis_012.right));
expect(Math.round(Column_flexBasis_013.left - Column_flexBasis_01.left)).assertEqual(Math.round(Column_flexBasis_01.right - Column_flexBasis_013.right));
expect(Math.round(Column_flexBasis_012.top - Column_flexBasis_011.bottom)).assertEqual(Math.round(Column_flexBasis_013.top - Column_flexBasis_012.bottom))
console.log('assert space')
expect(Math.round(Column_flexBasis_012.top - Column_flexBasis_011.bottom)).assertEqual(vp2px(10));
expect(Math.round(Column_flexBasis_013.top - Column_flexBasis_012.bottom)).assertEqual(vp2px(10));
console.log('Column_flexBasis_012.top - Column_flexBasis_011.bottom', + Column_flexBasis_012.top - Column_flexBasis_011.bottom)
console.log('Column_flexBasis_013.top - Column_flexBasis_012.bottom', + Column_flexBasis_013.top - Column_flexBasis_012.bottom)
expect(Column_flexBasis_01.top).assertEqual(Column_flexBasis_011.top);
console.log('assert height')
expect(Math.round(Column_flexBasis_011.bottom - Column_flexBasis_011.top)).assertEqual(vp2px(200));
console.log('Column_flexBasis_011.bottom - Column_flexBasis_011.top', + Column_flexBasis_011.bottom - Column_flexBasis_011.top)
expect(Math.round(Column_flexBasis_012.bottom - Column_flexBasis_012.top)).assertEqual(vp2px(100));
console.log('Column_flexBasis_012.bottom - Column_flexBasis_012.top', + Column_flexBasis_012.bottom - Column_flexBasis_012.top)
expect(Math.round(Column_flexBasis_013.bottom - Column_flexBasis_013.top)).assertEqual(vp2px(100));
console.log('Column_flexBasis_013.bottom - Column_flexBasis_013.top', + Column_flexBasis_013.bottom - Column_flexBasis_013.top)
console.log('assert weight')
expect(Math.round(Column_flexBasis_011.right - Column_flexBasis_011.left)).assertEqual(vp2px(300));
expect(Math.round(Column_flexBasis_012.right - Column_flexBasis_012.left)).assertEqual(vp2px(300));
expect(Math.round(Column_flexBasis_013.right - Column_flexBasis_013.left)).assertEqual(vp2px(300));
console.info('[SUB_ACE_flexBasis_Default_TEST_0200] END');
done();
});
/**
* @tc.number SUB_ACE_flexBasis_Default_TEST_0300
* @tc.name testFlexBasis
* @tc.desc column1 is set to flexBasis(-5) , the height of column1 is the original height
*/
it('SUB_ACE_flexBasis_Default_TEST_0300', 0, async function (done) {
console.info('[SUB_ACE_flexBasis_Default_TEST_0300] START');
globalThis.value.message.notify({name:'addflexBasis', value:-5});
await CommonFunc.sleep(3000);
let Column_flexBasis_011 = CommonFunc.getComponentRect('Column_flexBasis_011');
let Column_flexBasis_012 = CommonFunc.getComponentRect('Column_flexBasis_012');
let Column_flexBasis_013 = CommonFunc.getComponentRect('Column_flexBasis_013');
let Column_flexBasis_01 = CommonFunc.getComponentRect('Column_flexBasis_01');
console.log('assert position')
expect(Math.round(Column_flexBasis_011.left - Column_flexBasis_01.left)).assertEqual(Math.round(Column_flexBasis_01.right - Column_flexBasis_011.right));
expect(Math.round(Column_flexBasis_012.left - Column_flexBasis_01.left)).assertEqual(Math.round(Column_flexBasis_01.right - Column_flexBasis_012.right));
expect(Math.round(Column_flexBasis_013.left - Column_flexBasis_01.left)).assertEqual(Math.round(Column_flexBasis_01.right - Column_flexBasis_013.right));
expect(Math.round(Column_flexBasis_012.top - Column_flexBasis_011.bottom)).assertEqual(Math.round(Column_flexBasis_013.top - Column_flexBasis_012.bottom))
console.log('assert space')
expect(Math.round(Column_flexBasis_012.top - Column_flexBasis_011.bottom)).assertEqual(vp2px(10));
expect(Math.round(Column_flexBasis_013.top - Column_flexBasis_012.bottom)).assertEqual(vp2px(10));
console.log('Column_flexBasis_012.top - Column_flexBasis_011.bottom', + Column_flexBasis_012.top - Column_flexBasis_011.bottom)
console.log('Column_flexBasis_013.top - Column_flexBasis_012.bottom', + Column_flexBasis_013.top - Column_flexBasis_012.bottom)
expect(Column_flexBasis_01.top).assertEqual(Column_flexBasis_011.top);
console.log('assert height')
expect(Math.round(Column_flexBasis_011.bottom - Column_flexBasis_011.top)).assertEqual(vp2px(200));
console.log('Column_flexBasis_011.bottom - Column_flexBasis_011.top', + Column_flexBasis_011.bottom - Column_flexBasis_011.top)
expect(Math.round(Column_flexBasis_012.bottom - Column_flexBasis_012.top)).assertEqual(vp2px(100));
console.log('Column_flexBasis_012.bottom - Column_flexBasis_012.top', + Column_flexBasis_012.bottom - Column_flexBasis_012.top)
expect(Math.round(Column_flexBasis_013.bottom - Column_flexBasis_013.top)).assertEqual(vp2px(100));
console.log('Column_flexBasis_013.bottom - Column_flexBasis_013.top', + Column_flexBasis_013.bottom - Column_flexBasis_013.top)
console.log('assert weight')
expect(Math.round(Column_flexBasis_011.right - Column_flexBasis_011.left)).assertEqual(vp2px(300));
expect(Math.round(Column_flexBasis_012.right - Column_flexBasis_012.left)).assertEqual(vp2px(300));
expect(Math.round(Column_flexBasis_013.right - Column_flexBasis_013.left)).assertEqual(vp2px(300));
console.info('[SUB_ACE_flexBasis_Default_TEST_0300] END');
done();
});
/**
* @tc.number SUB_ACE_flexBasis_Default_TEST_0400
* @tc.name testFlexBasis
* @tc.desc column1、column2 and column3 do not set flexBasis, the height of column1 is the original height
*/
it('SUB_ACE_flexBasis_Default_TEST_0400', 0, async function (done) {
console.info('[SUB_ACE_flexBasis_Default_TEST_0400] START');
await CommonFunc.sleep(3000);
let Column_flexBasis_021 = CommonFunc.getComponentRect('Column_flexBasis_021');
let Column_flexBasis_022 = CommonFunc.getComponentRect('Column_flexBasis_022');
let Column_flexBasis_023 = CommonFunc.getComponentRect('Column_flexBasis_023');
let Column_flexBasis_02 = CommonFunc.getComponentRect('Column_flexBasis_02');
console.log('assert position')
expect(Math.round(Column_flexBasis_021.left - Column_flexBasis_02.left)).assertEqual(Math.round(Column_flexBasis_02.right - Column_flexBasis_021.right));
expect(Math.round(Column_flexBasis_022.left - Column_flexBasis_02.left)).assertEqual(Math.round(Column_flexBasis_02.right - Column_flexBasis_022.right));
expect(Math.round(Column_flexBasis_023.left - Column_flexBasis_02.left)).assertEqual(Math.round(Column_flexBasis_02.right - Column_flexBasis_023.right));
expect(Math.round(Column_flexBasis_022.top - Column_flexBasis_021.bottom)).assertEqual(Math.round(Column_flexBasis_023.top - Column_flexBasis_022.bottom))
console.log('assert space')
expect(Math.round(Column_flexBasis_022.top - Column_flexBasis_021.bottom)).assertEqual(vp2px(10));
expect(Math.round(Column_flexBasis_023.top - Column_flexBasis_022.bottom)).assertEqual(vp2px(10));
expect(Column_flexBasis_02.top).assertEqual(Column_flexBasis_021.top);
console.log('assert height')
expect(Math.round(Column_flexBasis_021.bottom - Column_flexBasis_021.top)).assertEqual(vp2px(200));
console.log('Column_flexBasis_021.bottom - Column_flexBasis_021.top', + Column_flexBasis_021.bottom - Column_flexBasis_021.top)
expect(Math.round(Column_flexBasis_022.bottom - Column_flexBasis_022.top)).assertEqual(vp2px(100));
console.log('Column_flexBasis_022.bottom - Column_flexBasis_022.top', + Column_flexBasis_022.bottom - Column_flexBasis_022.top)
expect(Math.round(Column_flexBasis_023.bottom - Column_flexBasis_023.top)).assertEqual(vp2px(100));
console.log('Column_flexBasis_023.bottom - Column_flexBasis_023.top', + Column_flexBasis_023.bottom - Column_flexBasis_023.top)
console.log('assert weight')
expect(Math.round(Column_flexBasis_021.right - Column_flexBasis_021.left)).assertEqual(vp2px(300));
expect(Math.round(Column_flexBasis_022.right - Column_flexBasis_022.left)).assertEqual(vp2px(300));
expect(Math.round(Column_flexBasis_023.right - Column_flexBasis_023.left)).assertEqual(vp2px(300));
console.info('[SUB_ACE_flexBasis_Default_TEST_0400] END');
done();
});
})
}
\ No newline at end of file
/**
* Copyright (c) 2023 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium';
import router from '@ohos.router';
import CommonFunc from '../../../MainAbility/common/Common';
import {MessageManager,Callback} from '../../../MainAbility/common/MessageManager';
export default function flexGrow_Default() {
describe('flexGrow_Default', function () {
beforeEach(async function (done) {
console.info("flexGrow_Default beforeEach start");
let options = {
url: "MainAbility/pages/Column/flexGrow/flexGrow_Default",
}
try {
router.clear();
let pages = router.getState();
console.info("get flexGrow_Default state pages:" + JSON.stringify(pages));
if (!("flexGrow_Default" == pages.name)) {
console.info("get flexGrow_Default pages.name:" + JSON.stringify(pages.name));
let result = await router.push(options);
await CommonFunc.sleep(2000);
console.info("push flexGrow_Default page result:" + JSON.stringify(result));
}
} catch (err) {
console.error("push flexGrow_Default page error " + JSON.stringify(err));
expect().assertFail();
}
done();
});
afterEach(async function () {
await CommonFunc.sleep(2000);
console.info("flexGrow_Default after each called")
});
/**
* @tc.number SUB_ACE_flexGrow_Default_TEST_0100
* @tc.name testFlexGrow
* @tc.desc colum1、colum2、colum3 set flexGrow(null)
*/
it('SUB_ACE_flexGrow_Default_TEST_0100', 0, async function (done) {
console.info('[SUB_ACE_flexGrow_Default_TEST_0100] START');
globalThis.value.message.notify({name:'addflexGrow', value:null});
await CommonFunc.sleep(3000);
console.log('get Initial value')
let Column_flexGrow_Default_011 = CommonFunc.getComponentRect('Column_flexGrow_Default_011');
let Column_flexGrow_Default_012 = CommonFunc.getComponentRect('Column_flexGrow_Default_012');
let Column_flexGrow_Default_013 = CommonFunc.getComponentRect('Column_flexGrow_Default_013');
let Column_flexGrow_Default_01 = CommonFunc.getComponentRect('Column_flexGrow_Default_01');
console.log('assert position')
expect(Math.round(Column_flexGrow_Default_011.left - Column_flexGrow_Default_01.left)).assertEqual(Math.round(Column_flexGrow_Default_01.right - Column_flexGrow_Default_011.right));
expect(Math.round(Column_flexGrow_Default_012.left - Column_flexGrow_Default_01.left)).assertEqual(Math.round(Column_flexGrow_Default_01.right - Column_flexGrow_Default_012.right));
expect(Math.round(Column_flexGrow_Default_013.left - Column_flexGrow_Default_01.left)).assertEqual(Math.round(Column_flexGrow_Default_01.right - Column_flexGrow_Default_013.right));
expect(Math.round(Column_flexGrow_Default_012.top - Column_flexGrow_Default_011.bottom)).assertEqual(Math.round(Column_flexGrow_Default_013.top - Column_flexGrow_Default_012.bottom))
console.log('assert space')
expect(Math.round(Column_flexGrow_Default_012.top - Column_flexGrow_Default_011.bottom)).assertEqual(vp2px(10));
expect(Math.round(Column_flexGrow_Default_013.top - Column_flexGrow_Default_012.bottom)).assertEqual(vp2px(10));
console.log('Column_flexGrow_Default_012.top - Column_flexGrow_Default_011.bottom', + Column_flexGrow_Default_012.top - Column_flexGrow_Default_011.bottom)
console.log('Column_flexGrow_Default_013.top - Column_flexGrow_Default_012.bottom', + Column_flexGrow_Default_013.top - Column_flexGrow_Default_012.bottom)
expect(Column_flexGrow_Default_01.top).assertEqual(Column_flexGrow_Default_011.top);
console.log('assert height')
expect(Math.round(Column_flexGrow_Default_011.bottom - Column_flexGrow_Default_011.top)).assertEqual(vp2px(100));
console.log('Column_flexGrow_Default_011.bottom - Column_flexGrow_Default_011.top', + Column_flexGrow_Default_011.bottom - Column_flexGrow_Default_011.top)
expect(Math.round(Column_flexGrow_Default_012.bottom - Column_flexGrow_Default_012.top)).assertEqual(vp2px(100));
console.log('Column_flexGrow_Default_012.bottom - Column_flexGrow_Default_012.top', + Column_flexGrow_Default_012.bottom - Column_flexGrow_Default_012.top)
expect(Math.round(Column_flexGrow_Default_013.bottom - Column_flexGrow_Default_013.top)).assertEqual(vp2px(100));
console.log('Column_flexGrow_Default_013.bottom - Column_flexGrow_Default_013.top', + Column_flexGrow_Default_013.bottom - Column_flexGrow_Default_013.top)
console.log('assert weight')
expect(Math.round(Column_flexGrow_Default_011.right - Column_flexGrow_Default_011.left)).assertEqual(vp2px(300));
expect(Math.round(Column_flexGrow_Default_012.right - Column_flexGrow_Default_012.left)).assertEqual(vp2px(300));
expect(Math.round(Column_flexGrow_Default_013.right - Column_flexGrow_Default_013.left)).assertEqual(vp2px(300));
console.info('[SUB_ACE_flexGrow_Default_TEST_0100] END');
done();
});
/**
* @tc.number SUB_ACE_flexGrow_Default_TEST_0200
* @tc.name testFlexGrow
* @tc.desc colum1、colum2、colum3 set flexGrow(undefined)
*/
it('SUB_ACE_flexGrow_Default_TEST_0200', 0, async function (done) {
console.info('[SUB_ACE_flexGrow_Default_TEST_0200] START');
globalThis.value.message.notify({name:'addflexGrow', value:undefined});
await CommonFunc.sleep(3000);
console.log('get Initial value')
let Column_flexGrow_Default_011 = CommonFunc.getComponentRect('Column_flexGrow_Default_011');
let Column_flexGrow_Default_012 = CommonFunc.getComponentRect('Column_flexGrow_Default_012');
let Column_flexGrow_Default_013 = CommonFunc.getComponentRect('Column_flexGrow_Default_013');
let Column_flexGrow_Default_01 = CommonFunc.getComponentRect('Column_flexGrow_Default_01');
console.log('assert position')
expect(Math.round(Column_flexGrow_Default_011.left - Column_flexGrow_Default_01.left)).assertEqual(Math.round(Column_flexGrow_Default_01.right - Column_flexGrow_Default_011.right));
expect(Math.round(Column_flexGrow_Default_012.left - Column_flexGrow_Default_01.left)).assertEqual(Math.round(Column_flexGrow_Default_01.right - Column_flexGrow_Default_012.right));
expect(Math.round(Column_flexGrow_Default_013.left - Column_flexGrow_Default_01.left)).assertEqual(Math.round(Column_flexGrow_Default_01.right - Column_flexGrow_Default_013.right));
expect(Math.round(Column_flexGrow_Default_012.top - Column_flexGrow_Default_011.bottom)).assertEqual(Math.round(Column_flexGrow_Default_013.top - Column_flexGrow_Default_012.bottom))
console.log('assert space')
expect(Math.round(Column_flexGrow_Default_012.top - Column_flexGrow_Default_011.bottom)).assertEqual(vp2px(10));
expect(Math.round(Column_flexGrow_Default_013.top - Column_flexGrow_Default_012.bottom)).assertEqual(vp2px(10));
console.log('Column_flexGrow_Default_012.top - Column_flexGrow_Default_011.bottom', + Column_flexGrow_Default_012.top - Column_flexGrow_Default_011.bottom)
console.log('Column_flexGrow_Default_013.top - Column_flexGrow_Default_012.bottom', + Column_flexGrow_Default_013.top - Column_flexGrow_Default_012.bottom)
expect(Column_flexGrow_Default_01.top).assertEqual(Column_flexGrow_Default_011.top);
console.log('assert height')
expect(Math.round(Column_flexGrow_Default_011.bottom - Column_flexGrow_Default_011.top)).assertEqual(vp2px(100));
console.log('Column_flexGrow_Default_011.bottom - Column_flexGrow_Default_011.top', + Column_flexGrow_Default_011.bottom - Column_flexGrow_Default_011.top)
expect(Math.round(Column_flexGrow_Default_012.bottom - Column_flexGrow_Default_012.top)).assertEqual(vp2px(100));
console.log('Column_flexGrow_Default_012.bottom - Column_flexGrow_Default_012.top', + Column_flexGrow_Default_012.bottom - Column_flexGrow_Default_012.top)
expect(Math.round(Column_flexGrow_Default_013.bottom - Column_flexGrow_Default_013.top)).assertEqual(vp2px(100));
console.log('Column_flexGrow_Default_013.bottom - Column_flexGrow_Default_013.top', + Column_flexGrow_Default_013.bottom - Column_flexGrow_Default_013.top)
console.log('assert weight')
expect(Math.round(Column_flexGrow_Default_011.right - Column_flexGrow_Default_011.left)).assertEqual(vp2px(300));
expect(Math.round(Column_flexGrow_Default_012.right - Column_flexGrow_Default_012.left)).assertEqual(vp2px(300));
expect(Math.round(Column_flexGrow_Default_013.right - Column_flexGrow_Default_013.left)).assertEqual(vp2px(300));
console.info('[SUB_ACE_flexGrow_Default_TEST_0200] END');
done();
});
/**
* @tc.number SUB_ACE_flexGrow_Default_TEST_0300
* @tc.name testFlexGrow
* @tc.desc colum1、colum2、colum3 set flexGrow(-5)
*/
it('SUB_ACE_flexGrow_Default_TEST_0300', 0, async function (done) {
console.info('[SUB_ACE_flexGrow_Default_TEST_0300] START');
globalThis.value.message.notify({name:'addflexGrow', value:-5});
await CommonFunc.sleep(3000);
console.log('get Initial value')
let Column_flexGrow_Default_011 = CommonFunc.getComponentRect('Column_flexGrow_Default_011');
let Column_flexGrow_Default_012 = CommonFunc.getComponentRect('Column_flexGrow_Default_012');
let Column_flexGrow_Default_013 = CommonFunc.getComponentRect('Column_flexGrow_Default_013');
let Column_flexGrow_Default_01 = CommonFunc.getComponentRect('Column_flexGrow_Default_01');
console.log('assert position')
expect(Math.round(Column_flexGrow_Default_011.left - Column_flexGrow_Default_01.left)).assertEqual(Math.round(Column_flexGrow_Default_01.right - Column_flexGrow_Default_011.right));
expect(Math.round(Column_flexGrow_Default_012.left - Column_flexGrow_Default_01.left)).assertEqual(Math.round(Column_flexGrow_Default_01.right - Column_flexGrow_Default_012.right));
expect(Math.round(Column_flexGrow_Default_013.left - Column_flexGrow_Default_01.left)).assertEqual(Math.round(Column_flexGrow_Default_01.right - Column_flexGrow_Default_013.right));
expect(Math.round(Column_flexGrow_Default_012.top - Column_flexGrow_Default_011.bottom)).assertEqual(Math.round(Column_flexGrow_Default_013.top - Column_flexGrow_Default_012.bottom))
console.log('assert space')
expect(Math.round(Column_flexGrow_Default_012.top - Column_flexGrow_Default_011.bottom)).assertEqual(vp2px(10));
expect(Math.round(Column_flexGrow_Default_013.top - Column_flexGrow_Default_012.bottom)).assertEqual(vp2px(10));
console.log('Column_flexGrow_Default_012.top - Column_flexGrow_Default_011.bottom', + Column_flexGrow_Default_012.top - Column_flexGrow_Default_011.bottom)
console.log('Column_flexGrow_Default_013.top - Column_flexGrow_Default_012.bottom', + Column_flexGrow_Default_013.top - Column_flexGrow_Default_012.bottom)
expect(Column_flexGrow_Default_01.top).assertEqual(Column_flexGrow_Default_011.top);
console.log('assert height')
expect(Math.round(Column_flexGrow_Default_011.bottom - Column_flexGrow_Default_011.top)).assertEqual(vp2px(100));
console.log('Column_flexGrow_Default_011.bottom - Column_flexGrow_Default_011.top', + Column_flexGrow_Default_011.bottom - Column_flexGrow_Default_011.top)
expect(Math.round(Column_flexGrow_Default_012.bottom - Column_flexGrow_Default_012.top)).assertEqual(vp2px(100));
console.log('Column_flexGrow_Default_012.bottom - Column_flexGrow_Default_012.top', + Column_flexGrow_Default_012.bottom - Column_flexGrow_Default_012.top)
expect(Math.round(Column_flexGrow_Default_013.bottom - Column_flexGrow_Default_013.top)).assertEqual(vp2px(100));
console.log('Column_flexGrow_Default_013.bottom - Column_flexGrow_Default_013.top', + Column_flexGrow_Default_013.bottom - Column_flexGrow_Default_013.top)
console.log('assert weight')
expect(Math.round(Column_flexGrow_Default_011.right - Column_flexGrow_Default_011.left)).assertEqual(vp2px(300));
expect(Math.round(Column_flexGrow_Default_012.right - Column_flexGrow_Default_012.left)).assertEqual(vp2px(300));
expect(Math.round(Column_flexGrow_Default_013.right - Column_flexGrow_Default_013.left)).assertEqual(vp2px(300));
console.info('[SUB_ACE_flexGrow_Default_TEST_0300] END');
done();
});
/**
* @tc.number SUB_ACE_flexGrow_Default_TEST_0400
* @tc.name testFlexGrow
* @tc.desc colum1、colum2 and colum3 do not set flexGrow
*/
it('SUB_ACE_flexGrow_Default_TEST_0400', 0, async function (done) {
console.info('[SUB_ACE_flexGrow_Default_TEST_0400] START');
await CommonFunc.sleep(3000);
console.log('get Initial value')
let Column_flexGrow_Default_021 = CommonFunc.getComponentRect('Column_flexGrow_Default_021');
let Column_flexGrow_Default_022 = CommonFunc.getComponentRect('Column_flexGrow_Default_022');
let Column_flexGrow_Default_023 = CommonFunc.getComponentRect('Column_flexGrow_Default_023');
let Column_flexGrow_Default_02 = CommonFunc.getComponentRect('Column_flexGrow_Default_02');
console.log('assert position')
expect(Math.round(Column_flexGrow_Default_021.left - Column_flexGrow_Default_02.left)).assertEqual(Math.round(Column_flexGrow_Default_02.right - Column_flexGrow_Default_021.right));
expect(Math.round(Column_flexGrow_Default_022.left - Column_flexGrow_Default_02.left)).assertEqual(Math.round(Column_flexGrow_Default_02.right - Column_flexGrow_Default_022.right));
expect(Math.round(Column_flexGrow_Default_023.left - Column_flexGrow_Default_02.left)).assertEqual(Math.round(Column_flexGrow_Default_02.right - Column_flexGrow_Default_023.right));
expect(Math.round(Column_flexGrow_Default_022.top - Column_flexGrow_Default_021.bottom)).assertEqual(Math.round(Column_flexGrow_Default_023.top - Column_flexGrow_Default_022.bottom))
console.log('assert space')
expect(Math.round(Column_flexGrow_Default_022.top - Column_flexGrow_Default_021.bottom)).assertEqual(vp2px(10));
expect(Math.round(Column_flexGrow_Default_023.top - Column_flexGrow_Default_022.bottom)).assertEqual(vp2px(10));
expect(Column_flexGrow_Default_02.top).assertEqual(Column_flexGrow_Default_021.top);
console.log('assert height')
expect(Math.round(Column_flexGrow_Default_021.bottom - Column_flexGrow_Default_021.top)).assertEqual(vp2px(100));
console.log('Column_flexGrow_Default_021.bottom - Column_flexGrow_Default_021.top', + Column_flexGrow_Default_021.bottom - Column_flexGrow_Default_021.top)
expect(Math.round(Column_flexGrow_Default_022.bottom - Column_flexGrow_Default_022.top)).assertEqual(vp2px(100));
console.log('Column_flexGrow_Default_022.bottom - Column_flexGrow_Default_022.top', + Column_flexGrow_Default_022.bottom - Column_flexGrow_Default_022.top)
expect(Math.round(Column_flexGrow_Default_023.bottom - Column_flexGrow_Default_023.top)).assertEqual(vp2px(100));
console.log('Column_flexGrow_Default_023.bottom - Column_flexGrow_Default_023.top', + Column_flexGrow_Default_023.bottom - Column_flexGrow_Default_023.top)
console.log('assert weight')
expect(Math.round(Column_flexGrow_Default_021.right - Column_flexGrow_Default_021.left)).assertEqual(vp2px(300));
expect(Math.round(Column_flexGrow_Default_022.right - Column_flexGrow_Default_022.left)).assertEqual(vp2px(300));
expect(Math.round(Column_flexGrow_Default_023.right - Column_flexGrow_Default_023.left)).assertEqual(vp2px(300));
console.info('[SUB_ACE_flexGrow_Default_TEST_0400] END');
done();
});
})
}
\ No newline at end of file
/**
* Copyright (c) 2023 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium';
import router from '@ohos.router';
import CommonFunc from '../../../MainAbility/common/Common';
import {MessageManager,Callback} from '../../../MainAbility/common/MessageManager';
export default function flexGrow_Part() {
describe('flexGrow_Part', function () {
beforeEach(async function (done) {
console.info("flexGrow_Part beforeEach start");
let options = {
url: "MainAbility/pages/Column/flexGrow/flexGrow_Part",
}
try {
router.clear();
let pages = router.getState();
console.info("get flexGrow_Part state pages:" + JSON.stringify(pages));
if (!("flexGrow_Part" == pages.name)) {
console.info("get flexGrow_Part pages.name:" + JSON.stringify(pages.name));
let result = await router.push(options);
await CommonFunc.sleep(2000);
console.info("push flexGrow_Part page result:" + JSON.stringify(result));
}
} catch (err) {
console.error("push flexGrow_Part page error " + JSON.stringify(err));
expect().assertFail();
}
done();
});
afterEach(async function () {
await CommonFunc.sleep(2000);
console.info("flexGrow_Part after each called")
});
/**
* @tc.number SUB_ACE_flexGrow_Part_TEST_0100
* @tc.name testFlexGrow
* @tc.desc colum1 set layoutWeight(1), colum2、colum3 set flexGrow(1)
*/
it('SUB_ACE_flexGrow_Part_TEST_0100', 0, async function (done) {
console.info('[SUB_ACE_flexGrow_Part_TEST_0100] START');
globalThis.value.message.notify({name:'addflexGrow2', value:1});
globalThis.value.message.notify({name:'addflexGrow3', value:1});
await CommonFunc.sleep(3000);
console.log('get Initial value')
let Column_flexGrow_011 = CommonFunc.getComponentRect('Column_flexGrow_011');
let Column_flexGrow_012 = CommonFunc.getComponentRect('Column_flexGrow_012');
let Column_flexGrow_013 = CommonFunc.getComponentRect('Column_flexGrow_013');
let Column_flexGrow_01 = CommonFunc.getComponentRect('Column_flexGrow_01');
console.log('assert position')
expect(Math.round(Column_flexGrow_011.left - Column_flexGrow_01.left)).assertEqual(Math.round(Column_flexGrow_01.right - Column_flexGrow_011.right));
expect(Math.round(Column_flexGrow_012.left - Column_flexGrow_01.left)).assertEqual(Math.round(Column_flexGrow_01.right - Column_flexGrow_012.right));
expect(Math.round(Column_flexGrow_013.left - Column_flexGrow_01.left)).assertEqual(Math.round(Column_flexGrow_01.right - Column_flexGrow_013.right));
expect(Math.round(Column_flexGrow_012.top - Column_flexGrow_011.bottom)).assertEqual(Math.round(Column_flexGrow_013.top - Column_flexGrow_012.bottom))
console.log('assert space')
expect(Math.round(Column_flexGrow_012.top - Column_flexGrow_011.bottom)).assertEqual(vp2px(10));
expect(Math.round(Column_flexGrow_013.top - Column_flexGrow_012.bottom)).assertEqual(vp2px(10));
console.log('Column_flexGrow_012.top - Column_flexGrow_011.bottom', + Column_flexGrow_012.top - Column_flexGrow_011.bottom)
console.log('Column_flexGrow_013.top - Column_flexGrow_012.bottom', + Column_flexGrow_013.top - Column_flexGrow_012.bottom)
expect(Column_flexGrow_01.top).assertEqual(Column_flexGrow_011.top);
expect(Column_flexGrow_013.bottom).assertEqual(Column_flexGrow_01.bottom);
console.log('assert height')
expect(Math.round(Column_flexGrow_011.bottom - Column_flexGrow_011.top)).assertEqual(vp2px(250));
console.log('Column_flexGrow_011.bottom - Column_flexGrow_011.top', + Column_flexGrow_011.bottom - Column_flexGrow_011.top)
expect(Math.round(Column_flexGrow_012.bottom - Column_flexGrow_012.top)).assertEqual(vp2px(100));
console.log('Column_flexGrow_012.bottom - Column_flexGrow_012.top', + Column_flexGrow_012.bottom - Column_flexGrow_012.top)
expect(Math.round(Column_flexGrow_013.bottom - Column_flexGrow_013.top)).assertEqual(vp2px(100));
console.log('Column_flexGrow_013.bottom - Column_flexGrow_013.top', + Column_flexGrow_013.bottom - Column_flexGrow_013.top)
console.log('assert weight')
expect(Math.round(Column_flexGrow_011.right - Column_flexGrow_011.left)).assertEqual(vp2px(300));
expect(Math.round(Column_flexGrow_012.right - Column_flexGrow_012.left)).assertEqual(vp2px(300));
expect(Math.round(Column_flexGrow_013.right - Column_flexGrow_013.left)).assertEqual(vp2px(300));
console.info('[SUB_ACE_flexGrow_Part_TEST_0100] END');
done();
});
/**
* @tc.number SUB_ACE_flexGrow_Part_TEST_0200
* @tc.name testFlexGrow
* @tc.desc colum1 set layoutWeight(1),colum2、colum3 set flexGrow(2)
*/
it('SUB_ACE_flexGrow_Part_TEST_0200', 0, async function (done) {
console.info('[SUB_ACE_flexGrow_Part_TEST_0200] START');
globalThis.value.message.notify({name:'addflexGrow2', value:2});
globalThis.value.message.notify({name:'addflexGrow3', value:2});
await CommonFunc.sleep(3000);
console.log('get Initial value')
let Column_flexGrow_011 = CommonFunc.getComponentRect('Column_flexGrow_011');
let Column_flexGrow_012 = CommonFunc.getComponentRect('Column_flexGrow_012');
let Column_flexGrow_013 = CommonFunc.getComponentRect('Column_flexGrow_013');
let Column_flexGrow_01 = CommonFunc.getComponentRect('Column_flexGrow_01');
console.log('assert position')
expect(Math.round(Column_flexGrow_011.left - Column_flexGrow_01.left)).assertEqual(Math.round(Column_flexGrow_01.right - Column_flexGrow_011.right));
expect(Math.round(Column_flexGrow_012.left - Column_flexGrow_01.left)).assertEqual(Math.round(Column_flexGrow_01.right - Column_flexGrow_012.right));
expect(Math.round(Column_flexGrow_013.left - Column_flexGrow_01.left)).assertEqual(Math.round(Column_flexGrow_01.right - Column_flexGrow_013.right));
expect(Math.round(Column_flexGrow_012.top - Column_flexGrow_011.bottom)).assertEqual(Math.round(Column_flexGrow_013.top - Column_flexGrow_012.bottom))
console.log('assert space')
expect(Math.round(Column_flexGrow_012.top - Column_flexGrow_011.bottom)).assertEqual(vp2px(10));
expect(Math.round(Column_flexGrow_013.top - Column_flexGrow_012.bottom)).assertEqual(vp2px(10));
console.log('Column_flexGrow_012.top - Column_flexGrow_011.bottom', + Column_flexGrow_012.top - Column_flexGrow_011.bottom)
console.log('Column_flexGrow_013.top - Column_flexGrow_012.bottom', + Column_flexGrow_013.top - Column_flexGrow_012.bottom)
expect(Column_flexGrow_01.top).assertEqual(Column_flexGrow_011.top);
expect(Column_flexGrow_013.bottom).assertEqual(Column_flexGrow_01.bottom);
console.log('assert height')
expect(Math.round(Column_flexGrow_011.bottom - Column_flexGrow_011.top)).assertEqual(vp2px(250));
console.log('Column_flexGrow_011.bottom - Column_flexGrow_011.top', + Column_flexGrow_011.bottom - Column_flexGrow_011.top)
expect(Math.round(Column_flexGrow_012.bottom - Column_flexGrow_012.top)).assertEqual(vp2px(100));
console.log('Column_flexGrow_012.bottom - Column_flexGrow_012.top', + Column_flexGrow_012.bottom - Column_flexGrow_012.top)
expect(Math.round(Column_flexGrow_013.bottom - Column_flexGrow_013.top)).assertEqual(vp2px(100));
console.log('Column_flexGrow_013.bottom - Column_flexGrow_013.top', + Column_flexGrow_013.bottom - Column_flexGrow_013.top)
console.log('assert weight')
expect(Math.round(Column_flexGrow_011.right - Column_flexGrow_011.left)).assertEqual(vp2px(300));
expect(Math.round(Column_flexGrow_012.right - Column_flexGrow_012.left)).assertEqual(vp2px(300));
expect(Math.round(Column_flexGrow_013.right - Column_flexGrow_013.left)).assertEqual(vp2px(300));
console.info('[SUB_ACE_flexGrow_Part_TEST_0200] END');
done();
});
/**
* @tc.number SUB_ACE_flexGrow_Part_TEST_0300
* @tc.name testFlexGrow
* @tc.desc colum1 set layoutWeight(1),colum2、colum3 set flexGrow(3)
*/
it('SUB_ACE_flexGrow_Part_TEST_0300', 0, async function (done) {
console.info('[SUB_ACE_flexGrow_Part_TEST_0300] START');
globalThis.value.message.notify({name:'addflexGrow2', value:3});
globalThis.value.message.notify({name:'addflexGrow3', value:3});
await CommonFunc.sleep(3000);
console.log('get Initial value')
let Column_flexGrow_011 = CommonFunc.getComponentRect('Column_flexGrow_011');
let Column_flexGrow_012 = CommonFunc.getComponentRect('Column_flexGrow_012');
let Column_flexGrow_013 = CommonFunc.getComponentRect('Column_flexGrow_013');
let Column_flexGrow_01 = CommonFunc.getComponentRect('Column_flexGrow_01');
console.log('assert position')
expect(Math.round(Column_flexGrow_011.left - Column_flexGrow_01.left)).assertEqual(Math.round(Column_flexGrow_01.right - Column_flexGrow_011.right));
expect(Math.round(Column_flexGrow_012.left - Column_flexGrow_01.left)).assertEqual(Math.round(Column_flexGrow_01.right - Column_flexGrow_012.right));
expect(Math.round(Column_flexGrow_013.left - Column_flexGrow_01.left)).assertEqual(Math.round(Column_flexGrow_01.right - Column_flexGrow_013.right));
expect(Math.round(Column_flexGrow_012.top - Column_flexGrow_011.bottom)).assertEqual(Math.round(Column_flexGrow_013.top - Column_flexGrow_012.bottom))
console.log('assert space')
expect(Math.round(Column_flexGrow_012.top - Column_flexGrow_011.bottom)).assertEqual(vp2px(10));
expect(Math.round(Column_flexGrow_013.top - Column_flexGrow_012.bottom)).assertEqual(vp2px(10));
console.log('Column_flexGrow_012.top - Column_flexGrow_011.bottom', + Column_flexGrow_012.top - Column_flexGrow_011.bottom)
console.log('Column_flexGrow_013.top - Column_flexGrow_012.bottom', + Column_flexGrow_013.top - Column_flexGrow_012.bottom)
expect(Column_flexGrow_01.top).assertEqual(Column_flexGrow_011.top);
expect(Column_flexGrow_013.bottom).assertEqual(Column_flexGrow_01.bottom);
console.log('assert height')
expect(Math.round(Column_flexGrow_011.bottom - Column_flexGrow_011.top)).assertEqual(vp2px(250));
console.log('Column_flexGrow_011.bottom - Column_flexGrow_011.top', + Column_flexGrow_011.bottom - Column_flexGrow_011.top)
expect(Math.round(Column_flexGrow_012.bottom - Column_flexGrow_012.top)).assertEqual(vp2px(100));
console.log('Column_flexGrow_012.bottom - Column_flexGrow_012.top', + Column_flexGrow_012.bottom - Column_flexGrow_012.top)
expect(Math.round(Column_flexGrow_013.bottom - Column_flexGrow_013.top)).assertEqual(vp2px(100));
console.log('Column_flexGrow_013.bottom - Column_flexGrow_013.top', + Column_flexGrow_013.bottom - Column_flexGrow_013.top)
console.log('assert weight')
expect(Math.round(Column_flexGrow_011.right - Column_flexGrow_011.left)).assertEqual(vp2px(300));
expect(Math.round(Column_flexGrow_012.right - Column_flexGrow_012.left)).assertEqual(vp2px(300));
expect(Math.round(Column_flexGrow_013.right - Column_flexGrow_013.left)).assertEqual(vp2px(300));
console.info('[SUB_ACE_flexGrow_Part_TEST_0300] END');
done();
});
/**
* @tc.number SUB_ACE_flexGrow_Part_TEST_0400
* @tc.name testFlexGrow
* @tc.desc colum1 set layoutWeight(1),colum2、colum3 set flexGrow(3)
*/
it('SUB_ACE_flexGrow_Part_TEST_0400', 0, async function (done) {
console.info('[SUB_ACE_flexGrow_Part_TEST_0400] START');
globalThis.value.message.notify({name:'addflexGrow1', value:3});
globalThis.value.message.notify({name:'addflexGrow2', value:2});
globalThis.value.message.notify({name:'addflexGrow3', value:1});
await CommonFunc.sleep(3000);
console.log('get Initial value')
let Column_flexGrow_011 = CommonFunc.getComponentRect('Column_flexGrow_011');
let Column_flexGrow_012 = CommonFunc.getComponentRect('Column_flexGrow_012');
let Column_flexGrow_013 = CommonFunc.getComponentRect('Column_flexGrow_013');
let Column_flexGrow_01 = CommonFunc.getComponentRect('Column_flexGrow_01');
console.log('assert position')
expect(Math.round(Column_flexGrow_011.left - Column_flexGrow_01.left)).assertEqual(Math.round(Column_flexGrow_01.right - Column_flexGrow_011.right));
expect(Math.round(Column_flexGrow_012.left - Column_flexGrow_01.left)).assertEqual(Math.round(Column_flexGrow_01.right - Column_flexGrow_012.right));
expect(Math.round(Column_flexGrow_013.left - Column_flexGrow_01.left)).assertEqual(Math.round(Column_flexGrow_01.right - Column_flexGrow_013.right));
expect(Math.round(Column_flexGrow_012.top - Column_flexGrow_011.bottom)).assertEqual(Math.round(Column_flexGrow_013.top - Column_flexGrow_012.bottom))
console.log('assert space')
expect(Math.round(Column_flexGrow_012.top - Column_flexGrow_011.bottom)).assertEqual(vp2px(10));
expect(Math.round(Column_flexGrow_013.top - Column_flexGrow_012.bottom)).assertEqual(vp2px(10));
console.log('Column_flexGrow_012.top - Column_flexGrow_011.bottom', + Column_flexGrow_012.top - Column_flexGrow_011.bottom)
console.log('Column_flexGrow_013.top - Column_flexGrow_012.bottom', + Column_flexGrow_013.top - Column_flexGrow_012.bottom)
expect(Column_flexGrow_01.top).assertEqual(Column_flexGrow_011.top);
expect(Column_flexGrow_013.bottom).assertEqual(Column_flexGrow_01.bottom);
console.log('assert height')
expect(Math.round(Column_flexGrow_011.bottom - Column_flexGrow_011.top)).assertEqual(vp2px(250));
console.log('Column_flexGrow_011.bottom - Column_flexGrow_011.top', + Column_flexGrow_011.bottom - Column_flexGrow_011.top)
expect(Math.round(Column_flexGrow_012.bottom - Column_flexGrow_012.top)).assertEqual(vp2px(100));
console.log('Column_flexGrow_012.bottom - Column_flexGrow_012.top', + Column_flexGrow_012.bottom - Column_flexGrow_012.top)
expect(Math.round(Column_flexGrow_013.bottom - Column_flexGrow_013.top)).assertEqual(vp2px(100));
console.log('Column_flexGrow_013.bottom - Column_flexGrow_013.top', + Column_flexGrow_013.bottom - Column_flexGrow_013.top)
console.log('assert weight')
expect(Math.round(Column_flexGrow_011.right - Column_flexGrow_011.left)).assertEqual(vp2px(300));
expect(Math.round(Column_flexGrow_012.right - Column_flexGrow_012.left)).assertEqual(vp2px(300));
expect(Math.round(Column_flexGrow_013.right - Column_flexGrow_013.left)).assertEqual(vp2px(300));
console.info('[SUB_ACE_flexGrow_Part_TEST_0400] END');
done();
});
/**
* @tc.number SUB_ACE_flexGrow_Part_TEST_0500
* @tc.name testFlexGrow
* @tc.desc colum1、colum2 and colum3 do not set flexGrow
*/
it('SUB_ACE_flexGrow_Part_TEST_0500', 0, async function (done) {
console.info('[SUB_ACE_flexGrow_Part_TEST_0500] START');
await CommonFunc.sleep(3000);
console.log('get Initial value')
let Column_flexGrow_021 = CommonFunc.getComponentRect('Column_flexGrow_021');
let Column_flexGrow_022 = CommonFunc.getComponentRect('Column_flexGrow_022');
let Column_flexGrow_023 = CommonFunc.getComponentRect('Column_flexGrow_023');
let Column_flexGrow_02 = CommonFunc.getComponentRect('Column_flexGrow_02');
console.log('assert position')
expect(Math.round(Column_flexGrow_021.left - Column_flexGrow_02.left)).assertEqual(Math.round(Column_flexGrow_02.right - Column_flexGrow_021.right));
expect(Math.round(Column_flexGrow_022.left - Column_flexGrow_02.left)).assertEqual(Math.round(Column_flexGrow_02.right - Column_flexGrow_022.right));
expect(Math.round(Column_flexGrow_023.left - Column_flexGrow_02.left)).assertEqual(Math.round(Column_flexGrow_02.right - Column_flexGrow_023.right));
expect(Math.round(Column_flexGrow_022.top - Column_flexGrow_021.bottom)).assertEqual(Math.round(Column_flexGrow_023.top - Column_flexGrow_022.bottom))
console.log('assert space')
expect(Math.round(Column_flexGrow_022.top - Column_flexGrow_021.bottom)).assertEqual(vp2px(10));
expect(Math.round(Column_flexGrow_023.top - Column_flexGrow_022.bottom)).assertEqual(vp2px(10));
expect(Column_flexGrow_02.top).assertEqual(Column_flexGrow_021.top);
console.log('assert height')
expect(Math.round(Column_flexGrow_021.bottom - Column_flexGrow_021.top)).assertEqual(vp2px(100));
console.log('Column_flexGrow_021.bottom - Column_flexGrow_021.top', + Column_flexGrow_021.bottom - Column_flexGrow_021.top)
expect(Math.round(Column_flexGrow_022.bottom - Column_flexGrow_022.top)).assertEqual(vp2px(100));
console.log('Column_flexGrow_022.bottom - Column_flexGrow_022.top', + Column_flexGrow_022.bottom - Column_flexGrow_022.top)
expect(Math.round(Column_flexGrow_023.bottom - Column_flexGrow_023.top)).assertEqual(vp2px(100));
console.log('Column_flexGrow_023.bottom - Column_flexGrow_023.top', + Column_flexGrow_023.bottom - Column_flexGrow_023.top)
console.log('assert weight')
expect(Math.round(Column_flexGrow_021.right - Column_flexGrow_021.left)).assertEqual(vp2px(300));
expect(Math.round(Column_flexGrow_022.right - Column_flexGrow_022.left)).assertEqual(vp2px(300));
expect(Math.round(Column_flexGrow_023.right - Column_flexGrow_023.left)).assertEqual(vp2px(300));
console.info('[SUB_ACE_flexGrow_Part_TEST_0500] END');
done();
});
})
}
\ No newline at end of file
/**
* Copyright (c) 2023 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium';
import router from '@ohos.router';
import CommonFunc from '../../../MainAbility/common/Common';
import {MessageManager,Callback} from '../../../MainAbility/common/MessageManager';
export default function flexShrink_Default() {
describe('flexShrink_Default', function () {
beforeEach(async function (done) {
console.info("flexShrink_Default beforeEach start");
let options = {
url: "MainAbility/pages/Column/flexShrink/flexShrink_Default",
}
try {
router.clear();
let pages = router.getState();
console.info("get flexShrink_Default state pages:" + JSON.stringify(pages));
if (!("flexShrink_Default" == pages.name)) {
console.info("get flexShrink_Default pages.name:" + JSON.stringify(pages.name));
let result = await router.push(options);
await CommonFunc.sleep(2000);
console.info("push flexShrink_Default page result:" + JSON.stringify(result));
}
} catch (err) {
console.error("push flexShrink_Default page error " + JSON.stringify(err));
expect().assertFail();
}
done();
});
afterEach(async function () {
await CommonFunc.sleep(2000);
console.info("flexShrink_Default after each called")
});
/**
* @tc.number SUB_ACE_flexShrink_Default_TEST_0100
* @tc.name testflexShrink
* @tc.desc column1、column2、column3 set flexShrink(null)
*/
it('SUB_ACE_flexShrink_Default_TEST_0100', 0, async function (done) {
console.info('[SUB_ACE_flexShrink_Default_TEST_0100] START');
globalThis.value.message.notify({name:'addflexShrink', value:null});
await CommonFunc.sleep(3000);
console.log('get Initial value')
let Column_flexShrink_011 = CommonFunc.getComponentRect('Column_flexShrink_011');
let Column_flexShrink_012 = CommonFunc.getComponentRect('Column_flexShrink_012');
let Column_flexShrink_013 = CommonFunc.getComponentRect('Column_flexShrink_013');
let Column_flexShrink_01 = CommonFunc.getComponentRect('Column_flexShrink_01');
console.log('assert position')
expect(Math.round(Column_flexShrink_011.left - Column_flexShrink_01.left)).assertEqual(Math.round(Column_flexShrink_01.right - Column_flexShrink_011.right));
expect(Math.round(Column_flexShrink_012.left - Column_flexShrink_01.left)).assertEqual(Math.round(Column_flexShrink_01.right - Column_flexShrink_012.right));
expect(Math.round(Column_flexShrink_013.left - Column_flexShrink_01.left)).assertEqual(Math.round(Column_flexShrink_01.right - Column_flexShrink_013.right));
expect(Math.round(Column_flexShrink_012.top - Column_flexShrink_011.bottom)).assertEqual(Math.round(Column_flexShrink_013.top - Column_flexShrink_012.bottom))
console.log('assert space')
expect(Math.round(Column_flexShrink_012.top - Column_flexShrink_011.bottom)).assertEqual(vp2px(10));
expect(Math.round(Column_flexShrink_013.top - Column_flexShrink_012.bottom)).assertEqual(vp2px(10));
console.log('Column_flexShrink_012.top - Column_flexShrink_011.bottom', + Column_flexShrink_012.top - Column_flexShrink_011.bottom)
console.log('Column_flexShrink_013.top - Column_flexShrink_012.bottom', + Column_flexShrink_013.top - Column_flexShrink_012.bottom)
expect(Column_flexShrink_01.top).assertEqual(Column_flexShrink_011.top);
expect(Column_flexShrink_013.bottom).assertLess(Column_flexShrink_01.bottom);
console.log('assert height')
expect(Math.round(Column_flexShrink_011.bottom - Column_flexShrink_011.top)).assertEqual(vp2px(200));
console.log('Column_flexShrink_011.bottom - Column_flexShrink_011.top', + Column_flexShrink_011.bottom - Column_flexShrink_011.top)
expect(Math.round(Column_flexShrink_012.bottom - Column_flexShrink_012.top)).assertEqual(vp2px(100));
console.log('Column_flexShrink_012.bottom - Column_flexShrink_012.top', + Column_flexShrink_012.bottom - Column_flexShrink_012.top)
expect(Math.round(Column_flexShrink_013.bottom - Column_flexShrink_013.top)).assertEqual(vp2px(100));
console.log('Column_flexShrink_013.bottom - Column_flexShrink_013.top', + Column_flexShrink_013.bottom - Column_flexShrink_013.top)
console.log('assert weight')
expect(Math.round(Column_flexShrink_011.right - Column_flexShrink_011.left)).assertEqual(vp2px(300));
expect(Math.round(Column_flexShrink_012.right - Column_flexShrink_012.left)).assertEqual(vp2px(300));
expect(Math.round(Column_flexShrink_013.right - Column_flexShrink_013.left)).assertEqual(vp2px(300));
console.info('[SUB_ACE_flexShrink_Default_TEST_0100] END');
done();
});
/**
* @tc.number SUB_ACE_flexShrink_Default_TEST_0200
* @tc.name testflexShrink
* @tc.desc column1、column2、column3 set flexShrink(undefined)
*/
it('SUB_ACE_flexShrink_Default_TEST_0200', 0, async function (done) {
console.info('[SUB_ACE_flexShrink_Default_TEST_0200] START');
globalThis.value.message.notify({name:'addflexShrink', value:undefined});
await CommonFunc.sleep(3000);
console.log('get Initial value')
let Column_flexShrink_011 = CommonFunc.getComponentRect('Column_flexShrink_011');
let Column_flexShrink_012 = CommonFunc.getComponentRect('Column_flexShrink_012');
let Column_flexShrink_013 = CommonFunc.getComponentRect('Column_flexShrink_013');
let Column_flexShrink_01 = CommonFunc.getComponentRect('Column_flexShrink_01');
console.log('assert position')
expect(Math.round(Column_flexShrink_011.left - Column_flexShrink_01.left)).assertEqual(Math.round(Column_flexShrink_01.right - Column_flexShrink_011.right));
expect(Math.round(Column_flexShrink_012.left - Column_flexShrink_01.left)).assertEqual(Math.round(Column_flexShrink_01.right - Column_flexShrink_012.right));
expect(Math.round(Column_flexShrink_013.left - Column_flexShrink_01.left)).assertEqual(Math.round(Column_flexShrink_01.right - Column_flexShrink_013.right));
expect(Math.round(Column_flexShrink_012.top - Column_flexShrink_011.bottom)).assertEqual(Math.round(Column_flexShrink_013.top - Column_flexShrink_012.bottom))
console.log('assert space')
expect(Math.round(Column_flexShrink_012.top - Column_flexShrink_011.bottom)).assertEqual(vp2px(10));
expect(Math.round(Column_flexShrink_013.top - Column_flexShrink_012.bottom)).assertEqual(vp2px(10));
console.log('Column_flexShrink_012.top - Column_flexShrink_011.bottom', + Column_flexShrink_012.top - Column_flexShrink_011.bottom)
console.log('Column_flexShrink_013.top - Column_flexShrink_012.bottom', + Column_flexShrink_013.top - Column_flexShrink_012.bottom)
expect(Column_flexShrink_01.top).assertEqual(Column_flexShrink_011.top);
expect(Column_flexShrink_013.bottom).assertLess(Column_flexShrink_01.bottom);
console.log('assert height')
expect(Math.round(Column_flexShrink_011.bottom - Column_flexShrink_011.top)).assertEqual(vp2px(200));
console.log('Column_flexShrink_011.bottom - Column_flexShrink_011.top', + Column_flexShrink_011.bottom - Column_flexShrink_011.top)
expect(Math.round(Column_flexShrink_012.bottom - Column_flexShrink_012.top)).assertEqual(vp2px(100));
console.log('Column_flexShrink_012.bottom - Column_flexShrink_012.top', + Column_flexShrink_012.bottom - Column_flexShrink_012.top)
expect(Math.round(Column_flexShrink_013.bottom - Column_flexShrink_013.top)).assertEqual(vp2px(100));
console.log('Column_flexShrink_013.bottom - Column_flexShrink_013.top', + Column_flexShrink_013.bottom - Column_flexShrink_013.top)
console.log('assert weight')
expect(Math.round(Column_flexShrink_011.right - Column_flexShrink_011.left)).assertEqual(vp2px(300));
expect(Math.round(Column_flexShrink_012.right - Column_flexShrink_012.left)).assertEqual(vp2px(300));
expect(Math.round(Column_flexShrink_013.right - Column_flexShrink_013.left)).assertEqual(vp2px(300));
console.info('[SUB_ACE_flexShrink_Default_TEST_0200] END');
done();
});
/**
* @tc.number SUB_ACE_flexShrink_Default_TEST_0300
* @tc.name testflexShrink
* @tc.desc column1、column2、column3 set flexShrink(undefined)
*/
it('SUB_ACE_flexShrink_Default_TEST_0300', 0, async function (done) {
console.info('[SUB_ACE_flexShrink_Default_TEST_0300] START');
globalThis.value.message.notify({name:'addflexShrink', value:-5});
await CommonFunc.sleep(3000);
console.log('get Initial value')
let Column_flexShrink_011 = CommonFunc.getComponentRect('Column_flexShrink_011');
let Column_flexShrink_012 = CommonFunc.getComponentRect('Column_flexShrink_012');
let Column_flexShrink_013 = CommonFunc.getComponentRect('Column_flexShrink_013');
let Column_flexShrink_01 = CommonFunc.getComponentRect('Column_flexShrink_01');
console.log('assert position')
expect(Math.round(Column_flexShrink_011.left - Column_flexShrink_01.left)).assertEqual(Math.round(Column_flexShrink_01.right - Column_flexShrink_011.right));
expect(Math.round(Column_flexShrink_012.left - Column_flexShrink_01.left)).assertEqual(Math.round(Column_flexShrink_01.right - Column_flexShrink_012.right));
expect(Math.round(Column_flexShrink_013.left - Column_flexShrink_01.left)).assertEqual(Math.round(Column_flexShrink_01.right - Column_flexShrink_013.right));
expect(Math.round(Column_flexShrink_012.top - Column_flexShrink_011.bottom)).assertEqual(Math.round(Column_flexShrink_013.top - Column_flexShrink_012.bottom))
console.log('assert space')
expect(Math.round(Column_flexShrink_012.top - Column_flexShrink_011.bottom)).assertEqual(vp2px(10));
expect(Math.round(Column_flexShrink_013.top - Column_flexShrink_012.bottom)).assertEqual(vp2px(10));
console.log('Column_flexShrink_012.top - Column_flexShrink_011.bottom', + Column_flexShrink_012.top - Column_flexShrink_011.bottom)
console.log('Column_flexShrink_013.top - Column_flexShrink_012.bottom', + Column_flexShrink_013.top - Column_flexShrink_012.bottom)
expect(Column_flexShrink_01.top).assertEqual(Column_flexShrink_011.top);
expect(Column_flexShrink_013.bottom).assertLess(Column_flexShrink_01.bottom);
console.log('assert height')
expect(Math.round(Column_flexShrink_011.bottom - Column_flexShrink_011.top)).assertEqual(vp2px(200));
console.log('Column_flexShrink_011.bottom - Column_flexShrink_011.top', + Column_flexShrink_011.bottom - Column_flexShrink_011.top)
expect(Math.round(Column_flexShrink_012.bottom - Column_flexShrink_012.top)).assertEqual(vp2px(100));
console.log('Column_flexShrink_012.bottom - Column_flexShrink_012.top', + Column_flexShrink_012.bottom - Column_flexShrink_012.top)
expect(Math.round(Column_flexShrink_013.bottom - Column_flexShrink_013.top)).assertEqual(vp2px(100));
console.log('Column_flexShrink_013.bottom - Column_flexShrink_013.top', + Column_flexShrink_013.bottom - Column_flexShrink_013.top)
console.log('assert weight')
expect(Math.round(Column_flexShrink_011.right - Column_flexShrink_011.left)).assertEqual(vp2px(300));
expect(Math.round(Column_flexShrink_012.right - Column_flexShrink_012.left)).assertEqual(vp2px(300));
expect(Math.round(Column_flexShrink_013.right - Column_flexShrink_013.left)).assertEqual(vp2px(300));
console.info('[SUB_ACE_flexShrink_Default_TEST_0300] END');
done();
});
/**
* @tc.number SUB_ACE_flexShrink_Default_TEST_0400
* @tc.name testflexShrink
* @tc.desc column1、column2 and column3 do not set flexShrink
*/
it('SUB_ACE_flexShrink_Default_TEST_0400', 0, async function (done) {
console.info('[SUB_ACE_flexShrink_Default_TEST_0400] START');
await CommonFunc.sleep(3000);
console.log('get Initial value')
let Column_flexShrink_021 = CommonFunc.getComponentRect('Column_flexShrink_021');
let Column_flexShrink_022 = CommonFunc.getComponentRect('Column_flexShrink_022');
let Column_flexShrink_023 = CommonFunc.getComponentRect('Column_flexShrink_023');
let Column_flexShrink_02 = CommonFunc.getComponentRect('Column_flexShrink_02');
console.log('assert position')
expect(Math.round(Column_flexShrink_021.left - Column_flexShrink_02.left)).assertEqual(Math.round(Column_flexShrink_02.right - Column_flexShrink_021.right));
expect(Math.round(Column_flexShrink_022.left - Column_flexShrink_02.left)).assertEqual(Math.round(Column_flexShrink_02.right - Column_flexShrink_022.right));
expect(Math.round(Column_flexShrink_023.left - Column_flexShrink_02.left)).assertEqual(Math.round(Column_flexShrink_02.right - Column_flexShrink_023.right));
expect(Math.round(Column_flexShrink_022.top - Column_flexShrink_021.bottom)).assertEqual(Math.round(Column_flexShrink_023.top - Column_flexShrink_022.bottom))
console.log('assert space')
expect(Math.round(Column_flexShrink_022.top - Column_flexShrink_021.bottom)).assertEqual(vp2px(10));
expect(Math.round(Column_flexShrink_023.top - Column_flexShrink_022.bottom)).assertEqual(vp2px(10));
expect(Column_flexShrink_02.top).assertEqual(Column_flexShrink_021.top);
expect(Column_flexShrink_023.bottom).assertLess(Column_flexShrink_02.bottom);
console.log('assert height')
expect(Math.round(Column_flexShrink_021.bottom - Column_flexShrink_021.top)).assertEqual(vp2px(200));
console.log('Column_flexShrink_021.bottom - Column_flexShrink_021.top', + Column_flexShrink_021.bottom - Column_flexShrink_021.top)
expect(Math.round(Column_flexShrink_022.bottom - Column_flexShrink_022.top)).assertEqual(vp2px(100));
console.log('Column_flexShrink_022.bottom - Column_flexShrink_022.top', + Column_flexShrink_022.bottom - Column_flexShrink_022.top)
expect(Math.round(Column_flexShrink_023.bottom - Column_flexShrink_023.top)).assertEqual(vp2px(100));
console.log('Column_flexShrink_023.bottom - Column_flexShrink_023.top', + Column_flexShrink_023.bottom - Column_flexShrink_023.top)
console.log('assert weight')
expect(Math.round(Column_flexShrink_021.right - Column_flexShrink_021.left)).assertEqual(vp2px(300));
expect(Math.round(Column_flexShrink_022.right - Column_flexShrink_022.left)).assertEqual(vp2px(300));
expect(Math.round(Column_flexShrink_023.right - Column_flexShrink_023.left)).assertEqual(vp2px(300));
console.info('[SUB_ACE_flexShrink_Default_TEST_0400] END');
done();
});
})
}
\ No newline at end of file
/**
* Copyright (c) 2023 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium';
import router from '@ohos.router';
import CommonFunc from '../../../MainAbility/common/Common';
import {MessageManager,Callback} from '../../../MainAbility/common/MessageManager';
export default function flexShrink_Part() {
describe('flexShrink_Part', function () {
beforeEach(async function (done) {
console.info("flexShrink_Part beforeEach start");
let options = {
url: "MainAbility/pages/Column/flexShrink/flexShrink_Part",
}
try {
router.clear();
let pages = router.getState();
console.info("get flexShrink_Part state pages:" + JSON.stringify(pages));
if (!("flexShrink_Part" == pages.name)) {
console.info("get flexShrink_Part pages.name:" + JSON.stringify(pages.name));
let result = await router.push(options);
await CommonFunc.sleep(2000);
console.info("push flexShrink_Part page result:" + JSON.stringify(result));
}
} catch (err) {
console.error("push flexShrink_Part page error " + JSON.stringify(err));
expect().assertFail();
}
done();
});
afterEach(async function () {
await CommonFunc.sleep(2000);
console.info("flexShrink_Part after each called")
});
/**
* @tc.number SUB_ACE_flexShrink_Part_TEST_0100
* @tc.name testflexShrink
* @tc.desc colum2、colum3 set flexShrink(1)
*/
it('SUB_ACE_flexShrink_Part_TEST_0100', 0, async function (done) {
console.info('[SUB_ACE_flexShrink_Part_TEST_0100] START');
globalThis.value.message.notify({name:'addflexShrink', value:1});
await CommonFunc.sleep(3000);
console.log('get Initial value')
let Column_flexShrink_011 = CommonFunc.getComponentRect('Column_flexShrink_011');
let Column_flexShrink_012 = CommonFunc.getComponentRect('Column_flexShrink_012');
let Column_flexShrink_013 = CommonFunc.getComponentRect('Column_flexShrink_013');
let Column_flexShrink_01 = CommonFunc.getComponentRect('Column_flexShrink_01');
console.log('assert position')
expect(Math.round(Column_flexShrink_011.left - Column_flexShrink_01.left)).assertEqual(Math.round(Column_flexShrink_01.right - Column_flexShrink_011.right));
expect(Math.round(Column_flexShrink_012.left - Column_flexShrink_01.left)).assertEqual(Math.round(Column_flexShrink_01.right - Column_flexShrink_012.right));
expect(Math.round(Column_flexShrink_013.left - Column_flexShrink_01.left)).assertEqual(Math.round(Column_flexShrink_01.right - Column_flexShrink_013.right));
expect(Math.round(Column_flexShrink_012.top - Column_flexShrink_011.bottom)).assertEqual(Math.round(Column_flexShrink_013.top - Column_flexShrink_012.bottom))
console.log('assert space')
expect(Math.round(Column_flexShrink_012.top - Column_flexShrink_011.bottom)).assertEqual(vp2px(10));
expect(Math.round(Column_flexShrink_013.top - Column_flexShrink_012.bottom)).assertEqual(vp2px(10));
console.log('Column_flexShrink_012.top - Column_flexShrink_011.bottom', + Column_flexShrink_012.top - Column_flexShrink_011.bottom)
console.log('Column_flexShrink_013.top - Column_flexShrink_012.bottom', + Column_flexShrink_013.top - Column_flexShrink_012.bottom)
expect(Column_flexShrink_01.top).assertEqual(Column_flexShrink_011.top);
expect(Column_flexShrink_013.bottom).assertEqual(Column_flexShrink_01.bottom);
console.log('assert height')
expect(Math.round(Column_flexShrink_011.bottom - Column_flexShrink_011.top)).assertEqual(vp2px(300));
console.log('Column_flexShrink_011.bottom - Column_flexShrink_011.top', + Column_flexShrink_011.bottom - Column_flexShrink_011.top)
expect(Column_flexShrink_012.bottom - Column_flexShrink_012.top).assertEqual(vp2px(65));
console.log('Column_flexShrink_012.bottom - Column_flexShrink_012.top', + Column_flexShrink_012.bottom - Column_flexShrink_012.top)
expect(Column_flexShrink_013.bottom - Column_flexShrink_013.top).assertEqual(vp2px(65));
console.log('Column_flexShrink_013.bottom - Column_flexShrink_013.top', + Column_flexShrink_013.bottom - Column_flexShrink_013.top)
console.log('assert weight')
expect(Math.round(Column_flexShrink_011.right - Column_flexShrink_011.left)).assertEqual(vp2px(300));
expect(Math.round(Column_flexShrink_012.right - Column_flexShrink_012.left)).assertEqual(vp2px(300));
expect(Math.round(Column_flexShrink_013.right - Column_flexShrink_013.left)).assertEqual(vp2px(300));
console.info('[SUB_ACE_flexShrink_Part_TEST_0100] END');
done();
});
/**
* @tc.number SUB_ACE_flexShrink_Part_TEST_0200
* @tc.name testflexShrink
* @tc.desc colum2、colum3 set flexShrink(2)
*/
it('SUB_ACE_flexShrink_Part_TEST_0200', 0, async function (done) {
console.info('[SUB_ACE_flexShrink_Part_TEST_0200] START');
globalThis.value.message.notify({name:'addflexShrink', value:2});
await CommonFunc.sleep(3000);
console.log('get Initial value')
let Column_flexShrink_011 = CommonFunc.getComponentRect('Column_flexShrink_011');
let Column_flexShrink_012 = CommonFunc.getComponentRect('Column_flexShrink_012');
let Column_flexShrink_013 = CommonFunc.getComponentRect('Column_flexShrink_013');
let Column_flexShrink_01 = CommonFunc.getComponentRect('Column_flexShrink_01');
console.log('assert position')
expect(Math.round(Column_flexShrink_011.left - Column_flexShrink_01.left)).assertEqual(Math.round(Column_flexShrink_01.right - Column_flexShrink_011.right));
expect(Math.round(Column_flexShrink_012.left - Column_flexShrink_01.left)).assertEqual(Math.round(Column_flexShrink_01.right - Column_flexShrink_012.right));
expect(Math.round(Column_flexShrink_013.left - Column_flexShrink_01.left)).assertEqual(Math.round(Column_flexShrink_01.right - Column_flexShrink_013.right));
expect(Math.round(Column_flexShrink_012.top - Column_flexShrink_011.bottom)).assertEqual(Math.round(Column_flexShrink_013.top - Column_flexShrink_012.bottom))
console.log('assert space')
expect(Math.round(Column_flexShrink_012.top - Column_flexShrink_011.bottom)).assertEqual(vp2px(10));
expect(Math.round(Column_flexShrink_013.top - Column_flexShrink_012.bottom)).assertEqual(vp2px(10));
console.log('Column_flexShrink_012.top - Column_flexShrink_011.bottom', + Column_flexShrink_012.top - Column_flexShrink_011.bottom)
console.log('Column_flexShrink_013.top - Column_flexShrink_012.bottom', + Column_flexShrink_013.top - Column_flexShrink_012.bottom)
expect(Column_flexShrink_01.top).assertEqual(Column_flexShrink_011.top);
expect(Column_flexShrink_013.bottom).assertEqual(Column_flexShrink_01.bottom);
console.log('assert height')
expect(Math.round(Column_flexShrink_011.bottom - Column_flexShrink_011.top)).assertEqual(vp2px(300));
console.log('Column_flexShrink_011.bottom - Column_flexShrink_011.top', + Column_flexShrink_011.bottom - Column_flexShrink_011.top)
expect(Column_flexShrink_012.bottom - Column_flexShrink_012.top).assertEqual(vp2px(65));
console.log('Column_flexShrink_012.bottom - Column_flexShrink_012.top', + Column_flexShrink_012.bottom - Column_flexShrink_012.top)
expect(Column_flexShrink_013.bottom - Column_flexShrink_013.top).assertEqual(vp2px(65));
console.log('Column_flexShrink_013.bottom - Column_flexShrink_013.top', + Column_flexShrink_013.bottom - Column_flexShrink_013.top)
console.log('assert weight')
expect(Math.round(Column_flexShrink_011.right - Column_flexShrink_011.left)).assertEqual(vp2px(300));
expect(Math.round(Column_flexShrink_012.right - Column_flexShrink_012.left)).assertEqual(vp2px(300));
expect(Math.round(Column_flexShrink_013.right - Column_flexShrink_013.left)).assertEqual(vp2px(300));
console.info('[SUB_ACE_flexShrink_Part_TEST_0200] END');
done();
});
})
}
\ No newline at end of file
/**
* Copyright (c) 2023 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium';
import router from '@ohos.router';
import CommonFunc from '../../../MainAbility/common/Common';
import {MessageManager,Callback} from '../../../MainAbility/common/MessageManager';
export default function layoutWeight_All() {
describe('layoutWeight_All', function () {
beforeEach(async function (done) {
console.info("layoutWeight_All beforeEach start");
let options = {
url: "MainAbility/pages/Column/layoutWeight/layoutWeight_All",
}
try {
router.clear();
let pages = router.getState();
console.info("get layoutWeight_All state pages:" + JSON.stringify(pages));
if (!("layoutWeight_All" == pages.name)) {
console.info("get layoutWeight_All pages.name:" + JSON.stringify(pages.name));
let result = await router.push(options);
await CommonFunc.sleep(2000);
console.info("push layoutWeight_All page result:" + JSON.stringify(result));
}
} catch (err) {
console.error("push layoutWeight_All page error " + JSON.stringify(err));
expect().assertFail();
}
done();
});
afterEach(async function () {
await CommonFunc.sleep(2000);
console.info("layoutWeight_All after each called")
});
/**
* @tc.number SUB_ACE_layoutWeight_All_TEST_0100
* @tc.name testLayoutWeight
* @tc.desc colum1 ,column2 and column3 set layoutWeight('3')
*/
it('SUB_ACE_layoutWeight_All_TEST_0100', 0, async function (done) {
console.info('[SUB_ACE_layoutWeight_All_TEST_0100] START');
globalThis.value.message.notify({name:'layoutWeight1', value:'3'});
globalThis.value.message.notify({name:'layoutWeight2', value:'3'});
globalThis.value.message.notify({name:'layoutWeight3', value:'3'});
await CommonFunc.sleep(3000);
console.log('get Initial value')
let Column_layoutWeight_All_021 = CommonFunc.getComponentRect('Column_layoutWeight_All_021');
let Column_layoutWeight_All_022 = CommonFunc.getComponentRect('Column_layoutWeight_All_022');
let Column_layoutWeight_All_023 = CommonFunc.getComponentRect('Column_layoutWeight_All_023');
let Column_layoutWeight_All_02 = CommonFunc.getComponentRect('Column_layoutWeight_All_02');
console.log('assert position')
expect(Math.round(Column_layoutWeight_All_021.left - Column_layoutWeight_All_02.left)).assertEqual(Math.round(Column_layoutWeight_All_02.right - Column_layoutWeight_All_021.right));
expect(Math.round(Column_layoutWeight_All_022.left - Column_layoutWeight_All_02.left)).assertEqual(Math.round(Column_layoutWeight_All_02.right - Column_layoutWeight_All_022.right));
expect(Math.round(Column_layoutWeight_All_023.left - Column_layoutWeight_All_02.left)).assertEqual(Math.round(Column_layoutWeight_All_02.right - Column_layoutWeight_All_023.right));
expect(Math.round(Column_layoutWeight_All_022.top - Column_layoutWeight_All_021.bottom)).assertEqual(Math.round(Column_layoutWeight_All_023.top - Column_layoutWeight_All_022.bottom))
console.log('assert space')
expect(Math.round(Column_layoutWeight_All_022.top - Column_layoutWeight_All_021.bottom)).assertEqual(vp2px(10));
expect(Math.round(Column_layoutWeight_All_023.top - Column_layoutWeight_All_022.bottom)).assertEqual(vp2px(10));
expect(Column_layoutWeight_All_02.top).assertEqual(Column_layoutWeight_All_021.top);
expect(Column_layoutWeight_All_023.bottom).assertEqual(Column_layoutWeight_All_02.bottom);
console.log('assert height')
expect(Math.round(Column_layoutWeight_All_021.bottom - Column_layoutWeight_All_021.top)).assertEqual(vp2px(150));
console.log('Column_layoutWeight_All_021.bottom - Column_layoutWeight_All_021.top', + Column_layoutWeight_All_021.bottom - Column_layoutWeight_All_021.top)
expect(Math.round(Column_layoutWeight_All_022.bottom - Column_layoutWeight_All_022.top)).assertEqual(vp2px(150));
console.log('Column_layoutWeight_All_022.bottom - Column_layoutWeight_All_022.top', + Column_layoutWeight_All_022.bottom - Column_layoutWeight_All_022.top)
expect(Math.round(Column_layoutWeight_All_023.bottom - Column_layoutWeight_All_023.top)).assertEqual(vp2px(150));
console.log('Column_layoutWeight_All_023.bottom - Column_layoutWeight_All_023.top', + Column_layoutWeight_All_023.bottom - Column_layoutWeight_All_023.top)
console.log('assert weight')
expect(Math.round(Column_layoutWeight_All_021.right - Column_layoutWeight_All_021.left)).assertEqual(vp2px(300));
expect(Math.round(Column_layoutWeight_All_022.right - Column_layoutWeight_All_022.left)).assertEqual(vp2px(300));
expect(Math.round(Column_layoutWeight_All_023.right - Column_layoutWeight_All_023.left)).assertEqual(vp2px(300));
console.info('[SUB_ACE_layoutWeight_All_TEST_0100] END');
done();
});
/**
* @tc.number SUB_ACE_layoutWeight_All_TEST_0200
* @tc.name testLayoutWeight
* @tc.desc colum1 set layoutWeight('3') , column2 set layoutWeight('2'),column3 set layoutWeight('1')
*/
it('SUB_ACE_layoutWeight_All_TEST_0200', 0, async function (done) {
console.info('[SUB_ACE_layoutWeight_All_TEST_0200] START');
globalThis.value.message.notify({name:'layoutWeight1', value:'3'});
globalThis.value.message.notify({name:'layoutWeight2', value:'2'});
globalThis.value.message.notify({name:'layoutWeight3', value:'1'});
await CommonFunc.sleep(3000);
console.log('get Initial value')
let Column_layoutWeight_All_021 = CommonFunc.getComponentRect('Column_layoutWeight_All_021');
let Column_layoutWeight_All_022 = CommonFunc.getComponentRect('Column_layoutWeight_All_022');
let Column_layoutWeight_All_023 = CommonFunc.getComponentRect('Column_layoutWeight_All_023');
let Column_layoutWeight_All_02 = CommonFunc.getComponentRect('Column_layoutWeight_All_02');
console.log('assert position')
expect(Math.round(Column_layoutWeight_All_021.left - Column_layoutWeight_All_02.left)).assertEqual(Math.round(Column_layoutWeight_All_02.right - Column_layoutWeight_All_021.right));
expect(Math.round(Column_layoutWeight_All_022.left - Column_layoutWeight_All_02.left)).assertEqual(Math.round(Column_layoutWeight_All_02.right - Column_layoutWeight_All_022.right));
expect(Math.round(Column_layoutWeight_All_023.left - Column_layoutWeight_All_02.left)).assertEqual(Math.round(Column_layoutWeight_All_02.right - Column_layoutWeight_All_023.right));
expect(Math.round(Column_layoutWeight_All_022.top - Column_layoutWeight_All_021.bottom)).assertEqual(Math.round(Column_layoutWeight_All_023.top - Column_layoutWeight_All_022.bottom))
console.log('assert space')
expect(Math.round(Column_layoutWeight_All_022.top - Column_layoutWeight_All_021.bottom)).assertEqual(vp2px(10));
expect(Math.round(Column_layoutWeight_All_023.top - Column_layoutWeight_All_022.bottom)).assertEqual(vp2px(10));
expect(Column_layoutWeight_All_02.top).assertEqual(Column_layoutWeight_All_021.top);
expect(Column_layoutWeight_All_023.bottom).assertEqual(Column_layoutWeight_All_02.bottom);
console.log('assert height')
expect(Column_layoutWeight_All_021.bottom - Column_layoutWeight_All_021.top).assertEqual(vp2px(225));
console.log('Column_layoutWeight_All_021.bottom - Column_layoutWeight_All_021.top', + Column_layoutWeight_All_021.bottom - Column_layoutWeight_All_021.top)
expect(Column_layoutWeight_All_022.bottom - Column_layoutWeight_All_022.top).assertEqual(vp2px(150));
console.log('Column_layoutWeight_All_022.bottom - Column_layoutWeight_All_022.top', + Column_layoutWeight_All_022.bottom - Column_layoutWeight_All_022.top)
expect(Column_layoutWeight_All_023.bottom - Column_layoutWeight_All_023.top).assertEqual(vp2px(75));
console.log('Column_layoutWeight_All_023.bottom - Column_layoutWeight_All_023.top', + Column_layoutWeight_All_023.bottom - Column_layoutWeight_All_023.top)
console.log('assert weight')
expect(Math.round(Column_layoutWeight_All_021.right - Column_layoutWeight_All_021.left)).assertEqual(vp2px(300));
expect(Math.round(Column_layoutWeight_All_022.right - Column_layoutWeight_All_022.left)).assertEqual(vp2px(300));
expect(Math.round(Column_layoutWeight_All_023.right - Column_layoutWeight_All_023.left)).assertEqual(vp2px(300));
console.info('[SUB_ACE_layoutWeight_All_TEST_0200] END');
done();
});
})
}
\ No newline at end of file
/**
* Copyright (c) 2023 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium';
import router from '@ohos.router';
import CommonFunc from '../../../MainAbility/common/Common';
import {MessageManager,Callback} from '../../../MainAbility/common/MessageManager';
export default function layoutWeight_Default() {
describe('layoutWeight_Default', function () {
beforeEach(async function (done) {
console.info("layoutWeight_Default beforeEach start");
let options = {
url: "MainAbility/pages/Column/layoutWeight/layoutWeight_Default",
}
try {
router.clear();
let pages = router.getState();
console.info("get layoutWeight_Default state pages:" + JSON.stringify(pages));
if (!("layoutWeight_Default" == pages.name)) {
console.info("get layoutWeight_Default pages.name:" + JSON.stringify(pages.name));
let result = await router.push(options);
await CommonFunc.sleep(2000);
console.info("push layoutWeight_Default page result:" + JSON.stringify(result));
}
} catch (err) {
console.error("push layoutWeight_Default page error " + JSON.stringify(err));
expect().assertFail();
}
done();
});
afterEach(async function () {
await CommonFunc.sleep(2000);
console.info("layoutWeight_Default after each called")
});
/**
* @tc.number SUB_ACE_layoutWeight_Default_TEST_0100
* @tc.name testLayoutWeight
* @tc.desc colum1 set layoutWeight(undefined),column1, column2, and column3 are displayed according to their own height
*/
it('SUB_ACE_layoutWeight_Default_TEST_0100', 0, async function (done) {
console.info('[SUB_ACE_layoutWeight_Default_TEST_0100] START');
globalThis.value.message.notify({name:'layoutWeight1', value:undefined});
await CommonFunc.sleep(3000);
console.log('get Initial value')
let Column_layoutWeight_011 = CommonFunc.getComponentRect('Column_layoutWeight_011');
let Column_layoutWeight_012 = CommonFunc.getComponentRect('Column_layoutWeight_012');
let Column_layoutWeight_013 = CommonFunc.getComponentRect('Column_layoutWeight_013');
let Column_layoutWeight_01 = CommonFunc.getComponentRect('Column_layoutWeight_01');
console.log('assert position')
expect(Math.round(Column_layoutWeight_011.left - Column_layoutWeight_01.left)).assertEqual(Math.round(Column_layoutWeight_01.right - Column_layoutWeight_011.right));
expect(Math.round(Column_layoutWeight_012.left - Column_layoutWeight_01.left)).assertEqual(Math.round(Column_layoutWeight_01.right - Column_layoutWeight_012.right));
expect(Math.round(Column_layoutWeight_013.left - Column_layoutWeight_01.left)).assertEqual(Math.round(Column_layoutWeight_01.right - Column_layoutWeight_013.right));
expect(Math.round(Column_layoutWeight_012.top - Column_layoutWeight_011.bottom)).assertEqual(Math.round(Column_layoutWeight_013.top - Column_layoutWeight_012.bottom))
console.log('assert space')
expect(Math.round(Column_layoutWeight_012.top - Column_layoutWeight_011.bottom)).assertEqual(vp2px(10));
expect(Math.round(Column_layoutWeight_013.top - Column_layoutWeight_012.bottom)).assertEqual(vp2px(10));
console.log('Column_layoutWeight_012.top - Column_layoutWeight_011.bottom', + Column_layoutWeight_012.top - Column_layoutWeight_011.bottom)
console.log('Column_layoutWeight_013.top - Column_layoutWeight_012.bottom', + Column_layoutWeight_013.top - Column_layoutWeight_012.bottom)
expect(Column_layoutWeight_01.top).assertEqual(Column_layoutWeight_011.top);
console.log('assert height')
expect(Math.round(Column_layoutWeight_011.bottom - Column_layoutWeight_011.top)).assertEqual(vp2px(100));
console.log('Column_layoutWeight_011.bottom - Column_layoutWeight_011.top', + Column_layoutWeight_011.bottom - Column_layoutWeight_011.top)
expect(Math.round(Column_layoutWeight_012.bottom - Column_layoutWeight_012.top)).assertEqual(vp2px(100));
console.log('Column_layoutWeight_012.bottom - Column_layoutWeight_012.top', + Column_layoutWeight_012.bottom - Column_layoutWeight_012.top)
expect(Math.round(Column_layoutWeight_013.bottom - Column_layoutWeight_013.top)).assertEqual(vp2px(100));
console.log('Column_layoutWeight_013.bottom - Column_layoutWeight_013.top', + Column_layoutWeight_013.bottom - Column_layoutWeight_013.top)
console.log('assert weight')
expect(Math.round(Column_layoutWeight_011.right - Column_layoutWeight_011.left)).assertEqual(vp2px(300));
expect(Math.round(Column_layoutWeight_012.right - Column_layoutWeight_012.left)).assertEqual(vp2px(300));
expect(Math.round(Column_layoutWeight_013.right - Column_layoutWeight_013.left)).assertEqual(vp2px(300));
console.info('[SUB_ACE_layoutWeight_Default_TEST_0100] END');
done();
});
/**
* @tc.number SUB_ACE_layoutWeight_Default_TEST_0200
* @tc.name testLayoutWeight
* @tc.desc colum1 set layoutWeight(null),column1, column2, and column3 are displayed according to their own height
*/
it('SUB_ACE_layoutWeight_Default_TEST_0200', 0, async function (done) {
console.info('[SUB_ACE_layoutWeight_Default_TEST_0200] START');
globalThis.value.message.notify({name:'layoutWeight1', value:null});
await CommonFunc.sleep(3000);
console.log('get Initial value')
let Column_layoutWeight_011 = CommonFunc.getComponentRect('Column_layoutWeight_011');
let Column_layoutWeight_012 = CommonFunc.getComponentRect('Column_layoutWeight_012');
let Column_layoutWeight_013 = CommonFunc.getComponentRect('Column_layoutWeight_013');
let Column_layoutWeight_01 = CommonFunc.getComponentRect('Column_layoutWeight_01');
console.log('assert position')
expect(Math.round(Column_layoutWeight_011.left - Column_layoutWeight_01.left)).assertEqual(Math.round(Column_layoutWeight_01.right - Column_layoutWeight_011.right));
expect(Math.round(Column_layoutWeight_012.left - Column_layoutWeight_01.left)).assertEqual(Math.round(Column_layoutWeight_01.right - Column_layoutWeight_012.right));
expect(Math.round(Column_layoutWeight_013.left - Column_layoutWeight_01.left)).assertEqual(Math.round(Column_layoutWeight_01.right - Column_layoutWeight_013.right));
expect(Math.round(Column_layoutWeight_012.top - Column_layoutWeight_011.bottom)).assertEqual(Math.round(Column_layoutWeight_013.top - Column_layoutWeight_012.bottom))
console.log('assert space')
expect(Math.round(Column_layoutWeight_012.top - Column_layoutWeight_011.bottom)).assertEqual(vp2px(10));
expect(Math.round(Column_layoutWeight_013.top - Column_layoutWeight_012.bottom)).assertEqual(vp2px(10));
console.log('Column_layoutWeight_012.top - Column_layoutWeight_011.bottom', + Column_layoutWeight_012.top - Column_layoutWeight_011.bottom)
console.log('Column_layoutWeight_013.top - Column_layoutWeight_012.bottom', + Column_layoutWeight_013.top - Column_layoutWeight_012.bottom)
expect(Column_layoutWeight_01.top).assertEqual(Column_layoutWeight_011.top);
console.log('assert height')
expect(Math.round(Column_layoutWeight_011.bottom - Column_layoutWeight_011.top)).assertEqual(vp2px(100));
console.log('Column_layoutWeight_011.bottom - Column_layoutWeight_011.top', + Column_layoutWeight_011.bottom - Column_layoutWeight_011.top)
expect(Math.round(Column_layoutWeight_012.bottom - Column_layoutWeight_012.top)).assertEqual(vp2px(100));
console.log('Column_layoutWeight_012.bottom - Column_layoutWeight_012.top', + Column_layoutWeight_012.bottom - Column_layoutWeight_012.top)
expect(Math.round(Column_layoutWeight_013.bottom - Column_layoutWeight_013.top)).assertEqual(vp2px(100));
console.log('Column_layoutWeight_013.bottom - Column_layoutWeight_013.top', + Column_layoutWeight_013.bottom - Column_layoutWeight_013.top)
console.log('assert weight')
expect(Math.round(Column_layoutWeight_011.right - Column_layoutWeight_011.left)).assertEqual(vp2px(300));
expect(Math.round(Column_layoutWeight_012.right - Column_layoutWeight_012.left)).assertEqual(vp2px(300));
expect(Math.round(Column_layoutWeight_013.right - Column_layoutWeight_013.left)).assertEqual(vp2px(300));
console.info('[SUB_ACE_layoutWeight_Default_TEST_0200] END');
done();
});
/**
* @tc.number SUB_ACE_layoutWeight_Default_TEST_0300
* @tc.name testLayoutWeight
* @tc.desc colum1 set layoutWeight(-10),column1, column2, and column3 are displayed according to their own height
*/
it('SUB_ACE_layoutWeight_Default_TEST_0300', 0, async function (done) {
console.info('[SUB_ACE_layoutWeight_Default_TEST_0300] START');
globalThis.value.message.notify({name:'layoutWeight1', value:-10});
await CommonFunc.sleep(3000);
console.log('get Initial value')
let Column_layoutWeight_011 = CommonFunc.getComponentRect('Column_layoutWeight_011');
let Column_layoutWeight_012 = CommonFunc.getComponentRect('Column_layoutWeight_012');
let Column_layoutWeight_013 = CommonFunc.getComponentRect('Column_layoutWeight_013');
let Column_layoutWeight_01 = CommonFunc.getComponentRect('Column_layoutWeight_01');
console.log('assert position')
expect(Math.round(Column_layoutWeight_011.left - Column_layoutWeight_01.left)).assertEqual(Math.round(Column_layoutWeight_01.right - Column_layoutWeight_011.right));
expect(Math.round(Column_layoutWeight_012.left - Column_layoutWeight_01.left)).assertEqual(Math.round(Column_layoutWeight_01.right - Column_layoutWeight_012.right));
expect(Math.round(Column_layoutWeight_013.left - Column_layoutWeight_01.left)).assertEqual(Math.round(Column_layoutWeight_01.right - Column_layoutWeight_013.right));
expect(Math.round(Column_layoutWeight_012.top - Column_layoutWeight_011.bottom)).assertEqual(Math.round(Column_layoutWeight_013.top - Column_layoutWeight_012.bottom))
console.log('assert space')
expect(Math.round(Column_layoutWeight_012.top - Column_layoutWeight_011.bottom)).assertEqual(vp2px(10));
expect(Math.round(Column_layoutWeight_013.top - Column_layoutWeight_012.bottom)).assertEqual(vp2px(10));
console.log('Column_layoutWeight_012.top - Column_layoutWeight_011.bottom', + Column_layoutWeight_012.top - Column_layoutWeight_011.bottom)
console.log('Column_layoutWeight_013.top - Column_layoutWeight_012.bottom', + Column_layoutWeight_013.top - Column_layoutWeight_012.bottom)
expect(Column_layoutWeight_01.top).assertEqual(Column_layoutWeight_011.top);
console.log('assert height')
expect(Math.round(Column_layoutWeight_011.bottom - Column_layoutWeight_011.top)).assertEqual(vp2px(100));
console.log('Column_layoutWeight_011.bottom - Column_layoutWeight_011.top', + Column_layoutWeight_011.bottom - Column_layoutWeight_011.top)
expect(Math.round(Column_layoutWeight_012.bottom - Column_layoutWeight_012.top)).assertEqual(vp2px(100));
console.log('Column_layoutWeight_012.bottom - Column_layoutWeight_012.top', + Column_layoutWeight_012.bottom - Column_layoutWeight_012.top)
expect(Math.round(Column_layoutWeight_013.bottom - Column_layoutWeight_013.top)).assertEqual(vp2px(100));
console.log('Column_layoutWeight_013.bottom - Column_layoutWeight_013.top', + Column_layoutWeight_013.bottom - Column_layoutWeight_013.top)
console.log('assert weight')
expect(Math.round(Column_layoutWeight_011.right - Column_layoutWeight_011.left)).assertEqual(vp2px(300));
expect(Math.round(Column_layoutWeight_012.right - Column_layoutWeight_012.left)).assertEqual(vp2px(300));
expect(Math.round(Column_layoutWeight_013.right - Column_layoutWeight_013.left)).assertEqual(vp2px(300));
console.info('[SUB_ACE_layoutWeight_Default_TEST_0300] END');
done();
});
/**
* @tc.number SUB_ACE_layoutWeight_Default_TEST_0400
* @tc.name testLayoutWeight
* @tc.desc colum1 set layoutWeight('aaa'),column1, column2, and column3 are displayed according to their own height
*/
it('SUB_ACE_layoutWeight_Default_TEST_0400', 0, async function (done) {
console.info('[SUB_ACE_layoutWeight_Default_TEST_0400] START');
globalThis.value.message.notify({name:'layoutWeight2', value:'aaa'});
await CommonFunc.sleep(3000);
console.log('get Initial value')
let Column_layoutWeight_021 = CommonFunc.getComponentRect('Column_layoutWeight_021');
let Column_layoutWeight_022 = CommonFunc.getComponentRect('Column_layoutWeight_022');
let Column_layoutWeight_023 = CommonFunc.getComponentRect('Column_layoutWeight_023');
let Column_layoutWeight_02 = CommonFunc.getComponentRect('Column_layoutWeight_02');
console.log('assert position')
expect(Math.round(Column_layoutWeight_021.left - Column_layoutWeight_02.left)).assertEqual(Math.round(Column_layoutWeight_02.right - Column_layoutWeight_021.right));
expect(Math.round(Column_layoutWeight_022.left - Column_layoutWeight_02.left)).assertEqual(Math.round(Column_layoutWeight_02.right - Column_layoutWeight_022.right));
expect(Math.round(Column_layoutWeight_023.left - Column_layoutWeight_02.left)).assertEqual(Math.round(Column_layoutWeight_02.right - Column_layoutWeight_023.right));
expect(Math.round(Column_layoutWeight_022.top - Column_layoutWeight_021.bottom)).assertEqual(Math.round(Column_layoutWeight_023.top - Column_layoutWeight_022.bottom))
console.log('assert space')
expect(Math.round(Column_layoutWeight_022.top - Column_layoutWeight_021.bottom)).assertEqual(vp2px(10));
expect(Math.round(Column_layoutWeight_023.top - Column_layoutWeight_022.bottom)).assertEqual(vp2px(10));
expect(Column_layoutWeight_02.top).assertEqual(Column_layoutWeight_021.top);
console.log('assert height')
expect(Math.round(Column_layoutWeight_021.bottom - Column_layoutWeight_021.top)).assertEqual(vp2px(100));
console.log('Column_layoutWeight_021.bottom - Column_layoutWeight_021.top', + Column_layoutWeight_021.bottom - Column_layoutWeight_021.top)
expect(Math.round(Column_layoutWeight_022.bottom - Column_layoutWeight_022.top)).assertEqual(vp2px(100));
console.log('Column_layoutWeight_022.bottom - Column_layoutWeight_022.top', + Column_layoutWeight_022.bottom - Column_layoutWeight_022.top)
expect(Math.round(Column_layoutWeight_023.bottom - Column_layoutWeight_023.top)).assertEqual(vp2px(100));
console.log('Column_layoutWeight_023.bottom - Column_layoutWeight_023.top', + Column_layoutWeight_023.bottom - Column_layoutWeight_023.top)
console.log('assert weight')
expect(Math.round(Column_layoutWeight_021.right - Column_layoutWeight_021.left)).assertEqual(vp2px(300));
expect(Math.round(Column_layoutWeight_022.right - Column_layoutWeight_022.left)).assertEqual(vp2px(300));
expect(Math.round(Column_layoutWeight_023.right - Column_layoutWeight_023.left)).assertEqual(vp2px(300));
console.info('[SUB_ACE_layoutWeight_Default_TEST_0400] END');
done();
});
})
}
\ No newline at end of file
/**
* Copyright (c) 2023 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium';
import router from '@ohos.router';
import CommonFunc from '../../../MainAbility/common/Common';
import {MessageManager,Callback} from '../../../MainAbility/common/MessageManager';
export default function layoutWeight_Part() {
describe('layoutWeight_Part', function () {
beforeEach(async function (done) {
console.info("layoutWeight_Part beforeEach start");
let options = {
url: "MainAbility/pages/Column/layoutWeight/layoutWeight_Part",
}
try {
router.clear();
let pages = router.getState();
console.info("get layoutWeight_Part state pages:" + JSON.stringify(pages));
if (!("layoutWeight_Part" == pages.name)) {
console.info("get layoutWeight_Part pages.name:" + JSON.stringify(pages.name));
let result = await router.push(options);
await CommonFunc.sleep(2000);
console.info("push layoutWeight_Part page result:" + JSON.stringify(result));
}
} catch (err) {
console.error("push layoutWeight_Part page error " + JSON.stringify(err));
expect().assertFail();
}
done();
});
afterEach(async function () {
await CommonFunc.sleep(2000);
console.info("layoutWeight_Part after each called")
});
/**
* @tc.number SUB_ACE_layoutWeight_Part_TEST_0100
* @tc.name testLayoutWeight
* @tc.desc colum1 and column2 set layoutWeight('2'),the cloumn3 placeholder remains unchanged
*/
it('SUB_ACE_layoutWeight_Part_TEST_0100', 0, async function (done) {
console.info('[SUB_ACE_layoutWeight_Part_TEST_0100] START');
globalThis.value.message.notify({name:'layoutWeight1', value:'2'});
globalThis.value.message.notify({name:'layoutWeight2', value:'2'});
await CommonFunc.sleep(3000);
console.log('get Initial value')
let Column_layoutWeight_021 = CommonFunc.getComponentRect('Column_layoutWeight_021');
let Column_layoutWeight_022 = CommonFunc.getComponentRect('Column_layoutWeight_022');
let Column_layoutWeight_023 = CommonFunc.getComponentRect('Column_layoutWeight_023');
let Column_layoutWeight_02 = CommonFunc.getComponentRect('Column_layoutWeight_02');
console.log('assert position')
expect(Math.round(Column_layoutWeight_021.left - Column_layoutWeight_02.left)).assertEqual(Math.round(Column_layoutWeight_02.right - Column_layoutWeight_021.right));
expect(Math.round(Column_layoutWeight_022.left - Column_layoutWeight_02.left)).assertEqual(Math.round(Column_layoutWeight_02.right - Column_layoutWeight_022.right));
expect(Math.round(Column_layoutWeight_023.left - Column_layoutWeight_02.left)).assertEqual(Math.round(Column_layoutWeight_02.right - Column_layoutWeight_023.right));
expect(Math.round(Column_layoutWeight_022.top - Column_layoutWeight_021.bottom)).assertEqual(Math.round(Column_layoutWeight_023.top - Column_layoutWeight_022.bottom))
console.log('assert space')
expect(Math.round(Column_layoutWeight_022.top - Column_layoutWeight_021.bottom)).assertEqual(vp2px(10));
expect(Math.round(Column_layoutWeight_023.top - Column_layoutWeight_022.bottom)).assertEqual(vp2px(10));
expect(Column_layoutWeight_02.top).assertEqual(Column_layoutWeight_021.top);
expect(Column_layoutWeight_023.bottom).assertEqual(Column_layoutWeight_02.bottom);
console.log('assert height')
expect(Column_layoutWeight_021.bottom - Column_layoutWeight_021.top).assertEqual(vp2px(165));
console.log('Column_layoutWeight_021.bottom - Column_layoutWeight_021.top', + Column_layoutWeight_021.bottom - Column_layoutWeight_021.top)
expect(Column_layoutWeight_022.bottom - Column_layoutWeight_022.top).assertEqual(vp2px(165));
console.log('Column_layoutWeight_022.bottom - Column_layoutWeight_022.top', + Column_layoutWeight_022.bottom - Column_layoutWeight_022.top)
expect(Column_layoutWeight_023.bottom - Column_layoutWeight_023.top).assertEqual(vp2px(100));
console.log('Column_layoutWeight_023.bottom - Column_layoutWeight_023.top', + Column_layoutWeight_023.bottom - Column_layoutWeight_023.top)
console.log('assert weight')
expect(Math.round(Column_layoutWeight_021.right - Column_layoutWeight_021.left)).assertEqual(vp2px(300));
expect(Math.round(Column_layoutWeight_022.right - Column_layoutWeight_022.left)).assertEqual(vp2px(300));
expect(Math.round(Column_layoutWeight_023.right - Column_layoutWeight_023.left)).assertEqual(vp2px(300));
console.info('[SUB_ACE_layoutWeight_Part_TEST_0100] END');
done();
});
/**
* @tc.number SUB_ACE_layoutWeight_Part_TEST_0200
* @tc.name testLayoutWeight
* @tc.desc colum1 and column2 set layoutWeight('3'), the cloumn3 placeholder remains unchanged
*/
it('SUB_ACE_layoutWeight_Part_TEST_0200', 0, async function (done) {
console.info('[SUB_ACE_layoutWeight_Part_TEST_0200] START');
globalThis.value.message.notify({name:'layoutWeight1', value:'3'});
globalThis.value.message.notify({name:'layoutWeight2', value:'3'});
await CommonFunc.sleep(3000);
console.log('get Initial value')
let Column_layoutWeight_021 = CommonFunc.getComponentRect('Column_layoutWeight_021');
let Column_layoutWeight_022 = CommonFunc.getComponentRect('Column_layoutWeight_022');
let Column_layoutWeight_023 = CommonFunc.getComponentRect('Column_layoutWeight_023');
let Column_layoutWeight_02 = CommonFunc.getComponentRect('Column_layoutWeight_02');
console.log('assert position')
expect(Math.round(Column_layoutWeight_021.left - Column_layoutWeight_02.left)).assertEqual(Math.round(Column_layoutWeight_02.right - Column_layoutWeight_021.right));
expect(Math.round(Column_layoutWeight_022.left - Column_layoutWeight_02.left)).assertEqual(Math.round(Column_layoutWeight_02.right - Column_layoutWeight_022.right));
expect(Math.round(Column_layoutWeight_023.left - Column_layoutWeight_02.left)).assertEqual(Math.round(Column_layoutWeight_02.right - Column_layoutWeight_023.right));
expect(Math.round(Column_layoutWeight_022.top - Column_layoutWeight_021.bottom)).assertEqual(Math.round(Column_layoutWeight_023.top - Column_layoutWeight_022.bottom))
console.log('assert space')
expect(Math.round(Column_layoutWeight_022.top - Column_layoutWeight_021.bottom)).assertEqual(vp2px(10));
expect(Math.round(Column_layoutWeight_023.top - Column_layoutWeight_022.bottom)).assertEqual(vp2px(10));
expect(Column_layoutWeight_02.top).assertEqual(Column_layoutWeight_021.top);
expect(Column_layoutWeight_023.bottom).assertEqual(Column_layoutWeight_02.bottom);
console.log('assert height')
expect(Column_layoutWeight_021.bottom - Column_layoutWeight_021.top).assertEqual(vp2px(165));
console.log('Column_layoutWeight_021.bottom - Column_layoutWeight_021.top', + Column_layoutWeight_021.bottom - Column_layoutWeight_021.top)
expect(Column_layoutWeight_022.bottom - Column_layoutWeight_022.top).assertEqual(vp2px(165));
console.log('Column_layoutWeight_022.bottom - Column_layoutWeight_022.top', + Column_layoutWeight_022.bottom - Column_layoutWeight_022.top)
expect(Column_layoutWeight_023.bottom - Column_layoutWeight_023.top).assertEqual(vp2px(100));
console.log('Column_layoutWeight_023.bottom - Column_layoutWeight_023.top', + Column_layoutWeight_023.bottom - Column_layoutWeight_023.top)
console.log('assert weight')
expect(Math.round(Column_layoutWeight_021.right - Column_layoutWeight_021.left)).assertEqual(vp2px(300));
expect(Math.round(Column_layoutWeight_022.right - Column_layoutWeight_022.left)).assertEqual(vp2px(300));
expect(Math.round(Column_layoutWeight_023.right - Column_layoutWeight_023.left)).assertEqual(vp2px(300));
console.info('[SUB_ACE_layoutWeight_Part_TEST_0200] END');
done();
});
/**
* @tc.number SUB_ACE_layoutWeight_Part_TEST_0300
* @tc.name testLayoutWeight
* @tc.desc colum1 set layoutWeight('3') and column2 set layoutWeight('2')
*/
it('SUB_ACE_layoutWeight_Part_TEST_0300', 0, async function (done) {
console.info('[SUB_ACE_layoutWeight_Part_TEST_0300] START');
globalThis.value.message.notify({name:'layoutWeight1', value:'3'});
globalThis.value.message.notify({name:'layoutWeight2', value:'2'});
await CommonFunc.sleep(3000);
console.log('get Initial value')
let Column_layoutWeight_021 = CommonFunc.getComponentRect('Column_layoutWeight_021');
let Column_layoutWeight_022 = CommonFunc.getComponentRect('Column_layoutWeight_022');
let Column_layoutWeight_023 = CommonFunc.getComponentRect('Column_layoutWeight_023');
let Column_layoutWeight_02 = CommonFunc.getComponentRect('Column_layoutWeight_02');
console.log('assert position')
expect(Math.round(Column_layoutWeight_021.left - Column_layoutWeight_02.left)).assertEqual(Math.round(Column_layoutWeight_02.right - Column_layoutWeight_021.right));
expect(Math.round(Column_layoutWeight_022.left - Column_layoutWeight_02.left)).assertEqual(Math.round(Column_layoutWeight_02.right - Column_layoutWeight_022.right));
expect(Math.round(Column_layoutWeight_023.left - Column_layoutWeight_02.left)).assertEqual(Math.round(Column_layoutWeight_02.right - Column_layoutWeight_023.right));
expect(Math.round(Column_layoutWeight_022.top - Column_layoutWeight_021.bottom)).assertEqual(Math.round(Column_layoutWeight_023.top - Column_layoutWeight_022.bottom))
console.log('assert space')
expect(Math.round(Column_layoutWeight_022.top - Column_layoutWeight_021.bottom)).assertEqual(vp2px(10));
expect(Math.round(Column_layoutWeight_023.top - Column_layoutWeight_022.bottom)).assertEqual(vp2px(10));
expect(Column_layoutWeight_02.top).assertEqual(Column_layoutWeight_021.top);
expect(Column_layoutWeight_023.bottom).assertEqual(Column_layoutWeight_02.bottom);
console.log('assert height')
expect(Column_layoutWeight_021.bottom - Column_layoutWeight_021.top).assertEqual(vp2px(198));
console.log('Column_layoutWeight_021.bottom - Column_layoutWeight_021.top', + Column_layoutWeight_021.bottom - Column_layoutWeight_021.top)
expect(Column_layoutWeight_022.bottom - Column_layoutWeight_022.top).assertEqual(vp2px(132));
console.log('Column_layoutWeight_022.bottom - Column_layoutWeight_022.top', + Column_layoutWeight_022.bottom - Column_layoutWeight_022.top)
expect(Column_layoutWeight_023.bottom - Column_layoutWeight_023.top).assertEqual(vp2px(100));
console.log('Column_layoutWeight_023.bottom - Column_layoutWeight_023.top', + Column_layoutWeight_023.bottom - Column_layoutWeight_023.top)
console.log('assert weight')
expect(Math.round(Column_layoutWeight_021.right - Column_layoutWeight_021.left)).assertEqual(vp2px(300));
expect(Math.round(Column_layoutWeight_022.right - Column_layoutWeight_022.left)).assertEqual(vp2px(300));
expect(Math.round(Column_layoutWeight_023.right - Column_layoutWeight_023.left)).assertEqual(vp2px(300));
console.info('[SUB_ACE_layoutWeight_Part_TEST_0300] END');
done();
});
})
}
\ No newline at end of file
/**
* Copyright (c) 2023 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium';
import router from '@ohos.router';
import CommonFunc from '../../../MainAbility/common/Common';
import {MessageManager,Callback} from '../../../MainAbility/common/MessageManager';
export default function layoutWeight_flexGrow() {
describe('layoutWeight_flexGrow', function () {
beforeEach(async function (done) {
console.info("layoutWeight_flexGrow beforeEach start");
let options = {
url: "MainAbility/pages/Column/layoutWeight/layoutWeight_flexGrow",
}
try {
router.clear();
let pages = router.getState();
console.info("get layoutWeight_flexGrow state pages:" + JSON.stringify(pages));
if (!("layoutWeight_flexGrow" == pages.name)) {
console.info("get layoutWeight_flexGrow pages.name:" + JSON.stringify(pages.name));
let result = await router.push(options);
await CommonFunc.sleep(2000);
console.info("push layoutWeight_flexGrow page result:" + JSON.stringify(result));
}
} catch (err) {
console.error("push layoutWeight_flexGrow page error " + JSON.stringify(err));
expect().assertFail();
}
done();
});
afterEach(async function () {
await CommonFunc.sleep(2000);
console.info("layoutWeight_flexGrow after each called")
});
/**
* @tc.number SUB_ACE_layoutWeight_flexGrow_TEST_0100
* @tc.name testLayoutWeight
* @tc.desc colum1, column2 and column3 set layoutWeight(1),the layoutWeight property takes precedence over flexGrow
*/
it('SUB_ACE_layoutWeight_flexGrow_TEST_0100', 0, async function (done) {
console.info('[SUB_ACE_layoutWeight_flexGrow_TEST_0100] START');
globalThis.value.message.notify({name:'addLayoutWeight', value:1});
await CommonFunc.sleep(3000);
let Column_layoutWeight_011 = CommonFunc.getComponentRect('Column_layoutWeight_011');
let Column_layoutWeight_012 = CommonFunc.getComponentRect('Column_layoutWeight_012');
let Column_layoutWeight_013 = CommonFunc.getComponentRect('Column_layoutWeight_013');
let Column_layoutWeight_01 = CommonFunc.getComponentRect('Column_layoutWeight_01');
console.log('assert position')
expect(Math.round(Column_layoutWeight_011.left - Column_layoutWeight_01.left)).assertEqual(Math.round(Column_layoutWeight_01.right - Column_layoutWeight_011.right));
expect(Math.round(Column_layoutWeight_012.left - Column_layoutWeight_01.left)).assertEqual(Math.round(Column_layoutWeight_01.right - Column_layoutWeight_012.right));
expect(Math.round(Column_layoutWeight_013.left - Column_layoutWeight_01.left)).assertEqual(Math.round(Column_layoutWeight_01.right - Column_layoutWeight_013.right));
expect(Math.round(Column_layoutWeight_012.top - Column_layoutWeight_011.bottom)).assertEqual(Math.round(Column_layoutWeight_013.top - Column_layoutWeight_012.bottom))
console.log('assert space')
expect(Math.round(Column_layoutWeight_012.top - Column_layoutWeight_011.bottom)).assertEqual(vp2px(10));
expect(Math.round(Column_layoutWeight_013.top - Column_layoutWeight_012.bottom)).assertEqual(vp2px(10));
console.log('Column_layoutWeight_012.top - Column_layoutWeight_011.bottom', + Column_layoutWeight_012.top - Column_layoutWeight_011.bottom)
console.log('Column_layoutWeight_013.top - Column_layoutWeight_012.bottom', + Column_layoutWeight_013.top - Column_layoutWeight_012.bottom)
expect(Column_layoutWeight_01.top).assertEqual(Column_layoutWeight_011.top);
expect(Column_layoutWeight_013.bottom).assertEqual(Column_layoutWeight_01.bottom);
console.log('assert height')
expect(Math.round(Column_layoutWeight_011.bottom - Column_layoutWeight_011.top)).assertEqual(vp2px(150));
console.log('Column_layoutWeight_011.bottom - Column_layoutWeight_011.top', + Column_layoutWeight_011.bottom - Column_layoutWeight_011.top)
expect(Math.round(Column_layoutWeight_012.bottom - Column_layoutWeight_012.top)).assertEqual(vp2px(150));
console.log('Column_layoutWeight_012.bottom - Column_layoutWeight_012.top', + Column_layoutWeight_012.bottom - Column_layoutWeight_012.top)
expect(Math.round(Column_layoutWeight_013.bottom - Column_layoutWeight_013.top)).assertEqual(vp2px(150));
console.log('Column_layoutWeight_013.bottom - Column_layoutWeight_013.top', + Column_layoutWeight_013.bottom - Column_layoutWeight_013.top)
console.log('assert weight')
expect(Math.round(Column_layoutWeight_011.right - Column_layoutWeight_011.left)).assertEqual(vp2px(300));
expect(Math.round(Column_layoutWeight_012.right - Column_layoutWeight_012.left)).assertEqual(vp2px(300));
expect(Math.round(Column_layoutWeight_013.right - Column_layoutWeight_013.left)).assertEqual(vp2px(300));
console.info('[SUB_ACE_layoutWeight_flexGrow_TEST_0100] END');
done();
});
/**
* @tc.number SUB_ACE_layoutWeight_flexGrow_TEST_0200
* @tc.name testLayoutWeight
* @tc.desc colum1, column2 and column3 set layoutWeight(2), the layoutWeight property takes precedence over flexGrow
*/
it('SUB_ACE_layoutWeight_flexGrow_TEST_0200', 0, async function (done) {
console.info('[SUB_ACE_layoutWeight_flexGrow_TEST_0200] START');
globalThis.value.message.notify({name:'addLayoutWeight', value:2});
await CommonFunc.sleep(3000);
let Column_layoutWeight_011 = CommonFunc.getComponentRect('Column_layoutWeight_011');
let Column_layoutWeight_012 = CommonFunc.getComponentRect('Column_layoutWeight_012');
let Column_layoutWeight_013 = CommonFunc.getComponentRect('Column_layoutWeight_013');
let Column_layoutWeight_01 = CommonFunc.getComponentRect('Column_layoutWeight_01');
console.log('assert position')
expect(Math.round(Column_layoutWeight_011.left - Column_layoutWeight_01.left)).assertEqual(Math.round(Column_layoutWeight_01.right - Column_layoutWeight_011.right));
expect(Math.round(Column_layoutWeight_012.left - Column_layoutWeight_01.left)).assertEqual(Math.round(Column_layoutWeight_01.right - Column_layoutWeight_012.right));
expect(Math.round(Column_layoutWeight_013.left - Column_layoutWeight_01.left)).assertEqual(Math.round(Column_layoutWeight_01.right - Column_layoutWeight_013.right));
expect(Math.round(Column_layoutWeight_012.top - Column_layoutWeight_011.bottom)).assertEqual(Math.round(Column_layoutWeight_013.top - Column_layoutWeight_012.bottom))
console.log('assert space')
expect(Math.round(Column_layoutWeight_012.top - Column_layoutWeight_011.bottom)).assertEqual(vp2px(10));
expect(Math.round(Column_layoutWeight_013.top - Column_layoutWeight_012.bottom)).assertEqual(vp2px(10));
console.log('Column_layoutWeight_012.top - Column_layoutWeight_011.bottom', + Column_layoutWeight_012.top - Column_layoutWeight_011.bottom)
console.log('Column_layoutWeight_013.top - Column_layoutWeight_012.bottom', + Column_layoutWeight_013.top - Column_layoutWeight_012.bottom)
expect(Column_layoutWeight_01.top).assertEqual(Column_layoutWeight_011.top);
expect(Column_layoutWeight_013.bottom).assertEqual(Column_layoutWeight_01.bottom);
console.log('assert height')
expect(Math.round(Column_layoutWeight_011.bottom - Column_layoutWeight_011.top)).assertEqual(vp2px(150));
console.log('Column_layoutWeight_011.bottom - Column_layoutWeight_011.top', + Column_layoutWeight_011.bottom - Column_layoutWeight_011.top)
expect(Math.round(Column_layoutWeight_012.bottom - Column_layoutWeight_012.top)).assertEqual(vp2px(150));
console.log('Column_layoutWeight_012.bottom - Column_layoutWeight_012.top', + Column_layoutWeight_012.bottom - Column_layoutWeight_012.top)
expect(Math.round(Column_layoutWeight_013.bottom - Column_layoutWeight_013.top)).assertEqual(vp2px(150));
console.log('Column_layoutWeight_013.bottom - Column_layoutWeight_013.top', + Column_layoutWeight_013.bottom - Column_layoutWeight_013.top)
console.log('assert weight')
expect(Math.round(Column_layoutWeight_011.right - Column_layoutWeight_011.left)).assertEqual(vp2px(300));
expect(Math.round(Column_layoutWeight_012.right - Column_layoutWeight_012.left)).assertEqual(vp2px(300));
expect(Math.round(Column_layoutWeight_013.right - Column_layoutWeight_013.left)).assertEqual(vp2px(300));
console.info('[SUB_ACE_layoutWeight_flexGrow_TEST_0200] END');
done();
});
/**
* @tc.number SUB_ACE_layoutWeight_flexGrow_TEST_0300
* @tc.name testLayoutWeight
* @tc.desc colum1, column2 and column3 set layoutWeight(3), the layoutWeight property takes precedence over flexGrow
*/
it('SUB_ACE_layoutWeight_flexGrow_TEST_0300', 0, async function (done) {
console.info('[SUB_ACE_layoutWeight_flexGrow_TEST_0300] START');
globalThis.value.message.notify({name:'addLayoutWeight', value:3});
await CommonFunc.sleep(3000);
let Column_layoutWeight_011 = CommonFunc.getComponentRect('Column_layoutWeight_011');
let Column_layoutWeight_012 = CommonFunc.getComponentRect('Column_layoutWeight_012');
let Column_layoutWeight_013 = CommonFunc.getComponentRect('Column_layoutWeight_013');
let Column_layoutWeight_01 = CommonFunc.getComponentRect('Column_layoutWeight_01');
console.log('assert position')
expect(Math.round(Column_layoutWeight_011.left - Column_layoutWeight_01.left)).assertEqual(Math.round(Column_layoutWeight_01.right - Column_layoutWeight_011.right));
expect(Math.round(Column_layoutWeight_012.left - Column_layoutWeight_01.left)).assertEqual(Math.round(Column_layoutWeight_01.right - Column_layoutWeight_012.right));
expect(Math.round(Column_layoutWeight_013.left - Column_layoutWeight_01.left)).assertEqual(Math.round(Column_layoutWeight_01.right - Column_layoutWeight_013.right));
expect(Math.round(Column_layoutWeight_012.top - Column_layoutWeight_011.bottom)).assertEqual(Math.round(Column_layoutWeight_013.top - Column_layoutWeight_012.bottom))
console.log('assert space')
expect(Math.round(Column_layoutWeight_012.top - Column_layoutWeight_011.bottom)).assertEqual(vp2px(10));
expect(Math.round(Column_layoutWeight_013.top - Column_layoutWeight_012.bottom)).assertEqual(vp2px(10));
console.log('Column_layoutWeight_012.top - Column_layoutWeight_011.bottom', + Column_layoutWeight_012.top - Column_layoutWeight_011.bottom)
console.log('Column_layoutWeight_013.top - Column_layoutWeight_012.bottom', + Column_layoutWeight_013.top - Column_layoutWeight_012.bottom)
expect(Column_layoutWeight_01.top).assertEqual(Column_layoutWeight_011.top);
expect(Column_layoutWeight_013.bottom).assertEqual(Column_layoutWeight_01.bottom);
console.log('assert height')
expect(Math.round(Column_layoutWeight_011.bottom - Column_layoutWeight_011.top)).assertEqual(vp2px(150));
console.log('Column_layoutWeight_011.bottom - Column_layoutWeight_011.top', + Column_layoutWeight_011.bottom - Column_layoutWeight_011.top)
expect(Math.round(Column_layoutWeight_012.bottom - Column_layoutWeight_012.top)).assertEqual(vp2px(150));
console.log('Column_layoutWeight_012.bottom - Column_layoutWeight_012.top', + Column_layoutWeight_012.bottom - Column_layoutWeight_012.top)
expect(Math.round(Column_layoutWeight_013.bottom - Column_layoutWeight_013.top)).assertEqual(vp2px(150));
console.log('Column_layoutWeight_013.bottom - Column_layoutWeight_013.top', + Column_layoutWeight_013.bottom - Column_layoutWeight_013.top)
console.log('assert weight')
expect(Math.round(Column_layoutWeight_011.right - Column_layoutWeight_011.left)).assertEqual(vp2px(300));
expect(Math.round(Column_layoutWeight_012.right - Column_layoutWeight_012.left)).assertEqual(vp2px(300));
expect(Math.round(Column_layoutWeight_013.right - Column_layoutWeight_013.left)).assertEqual(vp2px(300));
console.info('[SUB_ACE_layoutWeight_flexGrow_TEST_0300] END');
done();
});
})
}
\ No newline at end of file
/**
* Copyright (c) 2023 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium';
import router from '@ohos.router';
import CommonFunc from '../../../MainAbility/common/Common';
import {MessageManager,Callback} from '../../../MainAbility/common/MessageManager';
export default function layoutWeight_flexShrink() {
describe('layoutWeight_flexShrink', function () {
beforeEach(async function (done) {
console.info("layoutWeight_flexShrink beforeEach start");
let options = {
url: "MainAbility/pages/Column/layoutWeight/layoutWeight_flexShrink",
}
try {
router.clear();
let pages = router.getState();
console.info("get layoutWeight_flexShrink state pages:" + JSON.stringify(pages));
if (!("layoutWeight_flexShrink" == pages.name)) {
console.info("get layoutWeight_flexShrink pages.name:" + JSON.stringify(pages.name));
let result = await router.push(options);
await CommonFunc.sleep(2000);
console.info("push layoutWeight_flexShrink page result:" + JSON.stringify(result));
}
} catch (err) {
console.error("push layoutWeight_flexShrink page error " + JSON.stringify(err));
expect().assertFail();
}
done();
});
afterEach(async function () {
await CommonFunc.sleep(2000);
console.info("layoutWeight_flexShrink after each called")
});
/**
* @tc.number SUB_ACE_layoutWeight_flexShrink_TEST_0100
* @tc.name testLayoutWeight
* @tc.desc colum1, column2, column3 set layoutWeight(3), layoutWeight(2), layoutWeight(1),the layoutWeight property takes precedence over flexShrink,the height ratio of colum1, column2, and column3 is 3:2:1
*/
it('SUB_ACE_layoutWeight_flexShrink_TEST_0100', 0, async function (done) {
console.info('[SUB_ACE_layoutWeight_flexShrink_TEST_0100] START');
globalThis.value.message.notify({name:'addLayoutWeight', value:1});
await CommonFunc.sleep(3000);
let Column_layoutWeight_011 = CommonFunc.getComponentRect('Column_layoutWeight_011');
let Column_layoutWeight_012 = CommonFunc.getComponentRect('Column_layoutWeight_012');
let Column_layoutWeight_013 = CommonFunc.getComponentRect('Column_layoutWeight_013');
let Column_layoutWeight_01 = CommonFunc.getComponentRect('Column_layoutWeight_01');
console.log('assert position')
expect(Math.round(Column_layoutWeight_011.left - Column_layoutWeight_01.left)).assertEqual(Math.round(Column_layoutWeight_01.right - Column_layoutWeight_011.right));
expect(Math.round(Column_layoutWeight_012.left - Column_layoutWeight_01.left)).assertEqual(Math.round(Column_layoutWeight_01.right - Column_layoutWeight_012.right));
expect(Math.round(Column_layoutWeight_013.left - Column_layoutWeight_01.left)).assertEqual(Math.round(Column_layoutWeight_01.right - Column_layoutWeight_013.right));
expect(Math.round(Column_layoutWeight_012.top - Column_layoutWeight_011.bottom)).assertEqual(Math.round(Column_layoutWeight_013.top - Column_layoutWeight_012.bottom))
console.log('assert space')
expect(Math.round(Column_layoutWeight_012.top - Column_layoutWeight_011.bottom)).assertEqual(vp2px(10));
expect(Math.round(Column_layoutWeight_013.top - Column_layoutWeight_012.bottom)).assertEqual(vp2px(10));
console.log('Column_layoutWeight_012.top - Column_layoutWeight_011.bottom', + Column_layoutWeight_012.top - Column_layoutWeight_011.bottom)
console.log('Column_layoutWeight_013.top - Column_layoutWeight_012.bottom', + Column_layoutWeight_013.top - Column_layoutWeight_012.bottom)
expect(Column_layoutWeight_01.top).assertEqual(Column_layoutWeight_011.top);
expect(Column_layoutWeight_013.bottom).assertEqual(Column_layoutWeight_01.bottom);
console.log('assert height')
expect(Math.round(Column_layoutWeight_011.bottom - Column_layoutWeight_011.top)).assertEqual(vp2px(150));
console.log('Column_layoutWeight_011.bottom - Column_layoutWeight_011.top', + Column_layoutWeight_011.bottom - Column_layoutWeight_011.top)
expect(Math.round(Column_layoutWeight_012.bottom - Column_layoutWeight_012.top)).assertEqual(vp2px(150));
console.log('Column_layoutWeight_012.bottom - Column_layoutWeight_012.top', + Column_layoutWeight_012.bottom - Column_layoutWeight_012.top)
expect(Math.round(Column_layoutWeight_013.bottom - Column_layoutWeight_013.top)).assertEqual(vp2px(150));
console.log('Column_layoutWeight_013.bottom - Column_layoutWeight_013.top', + Column_layoutWeight_013.bottom - Column_layoutWeight_013.top)
console.log('assert weight')
expect(Math.round(Column_layoutWeight_011.right - Column_layoutWeight_011.left)).assertEqual(vp2px(300));
expect(Math.round(Column_layoutWeight_012.right - Column_layoutWeight_012.left)).assertEqual(vp2px(300));
expect(Math.round(Column_layoutWeight_013.right - Column_layoutWeight_013.left)).assertEqual(vp2px(300));
console.info('[SUB_ACE_layoutWeight_flexShrink_TEST_0100] END');
done();
});
/**
* @tc.number SUB_ACE_layoutWeight_flexShrink_TEST_0200
* @tc.name testLayoutWeight
* @tc.desc colum1, column2, column3 set layoutWeight(3), layoutWeight(2), layoutWeight(1),the layoutWeight property takes precedence over flexShrink,the height ratio of colum1, column2, and column3 is 3:2:1
*/
it('SUB_ACE_layoutWeight_flexShrink_TEST_0200', 0, async function (done) {
console.info('[SUB_ACE_layoutWeight_flexShrink_TEST_0200] START');
globalThis.value.message.notify({name:'addLayoutWeight', value:2});
await CommonFunc.sleep(3000);
let Column_layoutWeight_011 = CommonFunc.getComponentRect('Column_layoutWeight_011');
let Column_layoutWeight_012 = CommonFunc.getComponentRect('Column_layoutWeight_012');
let Column_layoutWeight_013 = CommonFunc.getComponentRect('Column_layoutWeight_013');
let Column_layoutWeight_01 = CommonFunc.getComponentRect('Column_layoutWeight_01');
console.log('assert position')
expect(Math.round(Column_layoutWeight_011.left - Column_layoutWeight_01.left)).assertEqual(Math.round(Column_layoutWeight_01.right - Column_layoutWeight_011.right));
expect(Math.round(Column_layoutWeight_012.left - Column_layoutWeight_01.left)).assertEqual(Math.round(Column_layoutWeight_01.right - Column_layoutWeight_012.right));
expect(Math.round(Column_layoutWeight_013.left - Column_layoutWeight_01.left)).assertEqual(Math.round(Column_layoutWeight_01.right - Column_layoutWeight_013.right));
expect(Math.round(Column_layoutWeight_012.top - Column_layoutWeight_011.bottom)).assertEqual(Math.round(Column_layoutWeight_013.top - Column_layoutWeight_012.bottom))
console.log('assert space')
expect(Math.round(Column_layoutWeight_012.top - Column_layoutWeight_011.bottom)).assertEqual(vp2px(10));
expect(Math.round(Column_layoutWeight_013.top - Column_layoutWeight_012.bottom)).assertEqual(vp2px(10));
console.log('Column_layoutWeight_012.top - Column_layoutWeight_011.bottom', + Column_layoutWeight_012.top - Column_layoutWeight_011.bottom)
console.log('Column_layoutWeight_013.top - Column_layoutWeight_012.bottom', + Column_layoutWeight_013.top - Column_layoutWeight_012.bottom)
expect(Column_layoutWeight_01.top).assertEqual(Column_layoutWeight_011.top);
expect(Column_layoutWeight_013.bottom).assertEqual(Column_layoutWeight_01.bottom);
console.log('assert height')
expect(Math.round(Column_layoutWeight_011.bottom - Column_layoutWeight_011.top)).assertEqual(vp2px(150));
console.log('Column_layoutWeight_011.bottom - Column_layoutWeight_011.top', + Column_layoutWeight_011.bottom - Column_layoutWeight_011.top)
expect(Math.round(Column_layoutWeight_012.bottom - Column_layoutWeight_012.top)).assertEqual(vp2px(150));
console.log('Column_layoutWeight_012.bottom - Column_layoutWeight_012.top', + Column_layoutWeight_012.bottom - Column_layoutWeight_012.top)
expect(Math.round(Column_layoutWeight_013.bottom - Column_layoutWeight_013.top)).assertEqual(vp2px(150));
console.log('Column_layoutWeight_013.bottom - Column_layoutWeight_013.top', + Column_layoutWeight_013.bottom - Column_layoutWeight_013.top)
console.log('assert weight')
expect(Math.round(Column_layoutWeight_011.right - Column_layoutWeight_011.left)).assertEqual(vp2px(300));
expect(Math.round(Column_layoutWeight_012.right - Column_layoutWeight_012.left)).assertEqual(vp2px(300));
expect(Math.round(Column_layoutWeight_013.right - Column_layoutWeight_013.left)).assertEqual(vp2px(300));
console.info('[SUB_ACE_layoutWeight_flexShrink_TEST_0200] END');
done();
});
/**
* @tc.number SUB_ACE_layoutWeight_flexShrink_TEST_0300
* @tc.name testLayoutWeight
* @tc.desc colum1, column2, column3 set layoutWeight(3), layoutWeight(2), layoutWeight(1),the layoutWeight property takes precedence over flexShrink,the height ratio of colum1, column2, and column3 is 3:2:1
*/
it('SUB_ACE_layoutWeight_flexShrink_TEST_0300', 0, async function (done) {
console.info('[SUB_ACE_layoutWeight_flexShrink_TEST_0300] START');
globalThis.value.message.notify({name:'addLayoutWeight', value:3});
await CommonFunc.sleep(3000);
let Column_layoutWeight_011 = CommonFunc.getComponentRect('Column_layoutWeight_011');
let Column_layoutWeight_012 = CommonFunc.getComponentRect('Column_layoutWeight_012');
let Column_layoutWeight_013 = CommonFunc.getComponentRect('Column_layoutWeight_013');
let Column_layoutWeight_01 = CommonFunc.getComponentRect('Column_layoutWeight_01');
console.log('assert position')
expect(Math.round(Column_layoutWeight_011.left - Column_layoutWeight_01.left)).assertEqual(Math.round(Column_layoutWeight_01.right - Column_layoutWeight_011.right));
expect(Math.round(Column_layoutWeight_012.left - Column_layoutWeight_01.left)).assertEqual(Math.round(Column_layoutWeight_01.right - Column_layoutWeight_012.right));
expect(Math.round(Column_layoutWeight_013.left - Column_layoutWeight_01.left)).assertEqual(Math.round(Column_layoutWeight_01.right - Column_layoutWeight_013.right));
expect(Math.round(Column_layoutWeight_012.top - Column_layoutWeight_011.bottom)).assertEqual(Math.round(Column_layoutWeight_013.top - Column_layoutWeight_012.bottom))
console.log('assert space')
expect(Math.round(Column_layoutWeight_012.top - Column_layoutWeight_011.bottom)).assertEqual(vp2px(10));
expect(Math.round(Column_layoutWeight_013.top - Column_layoutWeight_012.bottom)).assertEqual(vp2px(10));
console.log('Column_layoutWeight_012.top - Column_layoutWeight_011.bottom', + Column_layoutWeight_012.top - Column_layoutWeight_011.bottom)
console.log('Column_layoutWeight_013.top - Column_layoutWeight_012.bottom', + Column_layoutWeight_013.top - Column_layoutWeight_012.bottom)
expect(Column_layoutWeight_01.top).assertEqual(Column_layoutWeight_011.top);
expect(Column_layoutWeight_013.bottom).assertEqual(Column_layoutWeight_01.bottom);
console.log('assert height')
expect(Math.round(Column_layoutWeight_011.bottom - Column_layoutWeight_011.top)).assertEqual(vp2px(150));
console.log('Column_layoutWeight_011.bottom - Column_layoutWeight_011.top', + Column_layoutWeight_011.bottom - Column_layoutWeight_011.top)
expect(Math.round(Column_layoutWeight_012.bottom - Column_layoutWeight_012.top)).assertEqual(vp2px(150));
console.log('Column_layoutWeight_012.bottom - Column_layoutWeight_012.top', + Column_layoutWeight_012.bottom - Column_layoutWeight_012.top)
expect(Math.round(Column_layoutWeight_013.bottom - Column_layoutWeight_013.top)).assertEqual(vp2px(150));
console.log('Column_layoutWeight_013.bottom - Column_layoutWeight_013.top', + Column_layoutWeight_013.bottom - Column_layoutWeight_013.top)
console.log('assert weight')
expect(Math.round(Column_layoutWeight_011.right - Column_layoutWeight_011.left)).assertEqual(vp2px(300));
expect(Math.round(Column_layoutWeight_012.right - Column_layoutWeight_012.left)).assertEqual(vp2px(300));
expect(Math.round(Column_layoutWeight_013.right - Column_layoutWeight_013.left)).assertEqual(vp2px(300));
console.info('[SUB_ACE_layoutWeight_flexShrink_TEST_0300] END');
done();
});
})
}
\ No newline at end of file
/**
* Copyright (c) 2023 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium';
import router from '@ohos.router';
import CommonFunc from '../../../MainAbility/common/Common';
import {MessageManager,Callback} from '../../../MainAbility/common/MessageManager';
export default function Column_Space_Default() {
describe('Column_Space_Default', function () {
beforeEach(async function (done) {
console.info("Column_Space_Default beforeEach start");
let options = {
url: "MainAbility/pages/Column/spaceChanged/Column_Space_Default",
}
try {
router.clear();
let pages = router.getState();
console.info("get Column_Space_Default state pages:" + JSON.stringify(pages));
if (!("Column_Space_Default" == pages.name)) {
console.info("get Column_Space_Default pages.name:" + JSON.stringify(pages.name));
let result = await router.push(options);
await CommonFunc.sleep(2000);
console.info("push Column_Space_Default page result:" + JSON.stringify(result));
}
} catch (err) {
console.error("push Column_Space_Default page error " + JSON.stringify(err));
expect().assertFail();
}
done();
});
afterEach(async function () {
await CommonFunc.sleep(2000);
console.info("Column_Space_Default after each called")
});
/**
* @tc.number SUB_ACE_Column_Space_Default_TEST_0200
* @tc.name testColumnSpace
* @tc.desc The value of space is set to undefined
*/
it('SUB_ACE_Column_Space_Default_TEST_0200', 0, async function (done) {
console.info('[SUB_ACE_Column_Space_Default_TEST_0200] START');
globalThis.value.message.notify({name:'addSpace1', value:null});
await CommonFunc.sleep(3000);
console.log('get Initial value')
let Column_Space_Default_011 = CommonFunc.getComponentRect('Column_Space_Default_011');
let Column_Space_Default_012 = CommonFunc.getComponentRect('Column_Space_Default_012');
let Column_Space_Default_013 = CommonFunc.getComponentRect('Column_Space_Default_013');
let Column_Space_Default_01 = CommonFunc.getComponentRect('Column_Space_Default_01');
console.log('assert position')
expect(Math.round(Column_Space_Default_011.left - Column_Space_Default_01.left)).assertEqual(Math.round(Column_Space_Default_01.right - Column_Space_Default_011.right));
expect(Math.round(Column_Space_Default_012.left - Column_Space_Default_01.left)).assertEqual(Math.round(Column_Space_Default_01.right - Column_Space_Default_012.right));
expect(Math.round(Column_Space_Default_013.left - Column_Space_Default_01.left)).assertEqual(Math.round(Column_Space_Default_01.right - Column_Space_Default_013.right));
expect(Math.round(Column_Space_Default_012.top - Column_Space_Default_011.bottom)).assertEqual(Math.round(Column_Space_Default_013.top - Column_Space_Default_012.bottom))
console.log('assert space')
expect(Math.round(Column_Space_Default_012.top - Column_Space_Default_011.bottom)).assertEqual(vp2px(0));
expect(Math.round(Column_Space_Default_013.top - Column_Space_Default_012.bottom)).assertEqual(vp2px(0));
console.log('Column_Space_Default_012.top - Column_Space_Default_011.bottom', + Column_Space_Default_012.top - Column_Space_Default_011.bottom)
console.log('Column_Space_Default_013.top - Column_Space_Default_012.bottom', + Column_Space_Default_013.top - Column_Space_Default_012.bottom)
expect(Column_Space_Default_01.top).assertEqual(Column_Space_Default_011.top);
expect(Column_Space_Default_013.bottom).assertLess(Column_Space_Default_01.bottom);
console.log('assert height')
expect(Math.round(Column_Space_Default_011.bottom - Column_Space_Default_011.top)).assertEqual(vp2px(50));
expect(Math.round(Column_Space_Default_012.bottom - Column_Space_Default_012.top)).assertEqual(vp2px(100));
expect(Math.round(Column_Space_Default_013.bottom - Column_Space_Default_013.top)).assertEqual(vp2px(150));
console.log('assert weight')
expect(Math.round(Column_Space_Default_011.right - Column_Space_Default_011.left)).assertEqual(vp2px(300));
expect(Math.round(Column_Space_Default_012.right - Column_Space_Default_012.left)).assertEqual(vp2px(300));
expect(Math.round(Column_Space_Default_013.right - Column_Space_Default_013.left)).assertEqual(vp2px(300));
console.info('[SUB_ACE_Column_Space_Default_TEST_0200] END');
done();
});
/**
* @tc.number SUB_ACE_Column_Space_Default_TEST_0200
* @tc.name testColumnSpace
* @tc.desc The value of space is set to -10
*/
it('SUB_ACE_Column_Space_Default_TEST_0300', 0, async function (done) {
console.info('[SUB_ACE_Column_Space_Default_TEST_0300] START');
globalThis.value.message.notify({name:'addSpace1', value:-10});
await CommonFunc.sleep(3000);
console.log('get Initial value')
let Column_Space_Default_011 = CommonFunc.getComponentRect('Column_Space_Default_011');
let Column_Space_Default_012 = CommonFunc.getComponentRect('Column_Space_Default_012');
let Column_Space_Default_013 = CommonFunc.getComponentRect('Column_Space_Default_013');
let Column_Space_Default_01 = CommonFunc.getComponentRect('Column_Space_Default_01');
console.log('assert position')
expect(Math.round(Column_Space_Default_011.left - Column_Space_Default_01.left)).assertEqual(Math.round(Column_Space_Default_01.right - Column_Space_Default_011.right));
expect(Math.round(Column_Space_Default_012.left - Column_Space_Default_01.left)).assertEqual(Math.round(Column_Space_Default_01.right - Column_Space_Default_012.right));
expect(Math.round(Column_Space_Default_013.left - Column_Space_Default_01.left)).assertEqual(Math.round(Column_Space_Default_01.right - Column_Space_Default_013.right));
expect(Math.round(Column_Space_Default_012.top - Column_Space_Default_011.bottom)).assertEqual(Math.round(Column_Space_Default_013.top - Column_Space_Default_012.bottom))
console.log('assert space')
expect(Math.round(Column_Space_Default_012.top - Column_Space_Default_011.bottom)).assertEqual(vp2px(0));
expect(Math.round(Column_Space_Default_013.top - Column_Space_Default_012.bottom)).assertEqual(vp2px(0));
console.log('Column_Space_Default_012.top - Column_Space_Default_011.bottom', + Column_Space_Default_012.top - Column_Space_Default_011.bottom)
console.log('Column_Space_Default_013.top - Column_Space_Default_012.bottom', + Column_Space_Default_013.top - Column_Space_Default_012.bottom)
expect(Column_Space_Default_01.top).assertEqual(Column_Space_Default_011.top);
expect(Column_Space_Default_013.bottom).assertLess(Column_Space_Default_01.bottom);
console.log('assert height')
expect(Math.round(Column_Space_Default_011.bottom - Column_Space_Default_011.top)).assertEqual(vp2px(50));
expect(Math.round(Column_Space_Default_012.bottom - Column_Space_Default_012.top)).assertEqual(vp2px(100));
expect(Math.round(Column_Space_Default_013.bottom - Column_Space_Default_013.top)).assertEqual(vp2px(150));
console.log('assert weight')
expect(Math.round(Column_Space_Default_011.right - Column_Space_Default_011.left)).assertEqual(vp2px(300));
expect(Math.round(Column_Space_Default_012.right - Column_Space_Default_012.left)).assertEqual(vp2px(300));
expect(Math.round(Column_Space_Default_013.right - Column_Space_Default_013.left)).assertEqual(vp2px(300));
console.info('[SUB_ACE_Column_Space_Default_TEST_0300] END');
done();
});
/**
* @tc.number SUB_ACE_Column_Space_Default_TEST_0400
* @tc.name testColumnSpace
* @tc.desc The value of space is set to 'abc'
*/
it('SUB_ACE_Column_Space_Default_TEST_0400', 0, async function (done) {
console.info('[SUB_ACE_Column_Space_Default_TEST_0400] START');
globalThis.value.message.notify({name:'addSpace2', value:'abc'});
await CommonFunc.sleep(3000);
console.log('get Initial value')
let Column_Space_Default_021 = CommonFunc.getComponentRect('Column_Space_Default_021');
let Column_Space_Default_022 = CommonFunc.getComponentRect('Column_Space_Default_022');
let Column_Space_Default_023 = CommonFunc.getComponentRect('Column_Space_Default_023');
let Column_Space_Default_02 = CommonFunc.getComponentRect('Column_Space_Default_02');
console.log('assert position')
expect(Math.round(Column_Space_Default_021.left - Column_Space_Default_02.left)).assertEqual(Math.round(Column_Space_Default_02.right - Column_Space_Default_021.right));
expect(Math.round(Column_Space_Default_022.left - Column_Space_Default_02.left)).assertEqual(Math.round(Column_Space_Default_02.right - Column_Space_Default_022.right));
expect(Math.round(Column_Space_Default_023.left - Column_Space_Default_02.left)).assertEqual(Math.round(Column_Space_Default_02.right - Column_Space_Default_023.right));
expect(Math.round(Column_Space_Default_022.top - Column_Space_Default_021.bottom)).assertEqual(Math.round(Column_Space_Default_023.top - Column_Space_Default_022.bottom))
console.log('assert space')
expect(Math.round(Column_Space_Default_022.top - Column_Space_Default_021.bottom)).assertEqual(vp2px(0));
expect(Math.round(Column_Space_Default_023.top - Column_Space_Default_022.bottom)).assertEqual(vp2px(0));
console.log('Column_Space_Default_022.top - Column_Space_Default_021.bottom', + Column_Space_Default_022.top - Column_Space_Default_021.bottom)
console.log('Column_Space_Default_023.top - Column_Space_Default_022.bottom', + Column_Space_Default_023.top - Column_Space_Default_022.bottom)
expect(Column_Space_Default_02.top).assertEqual(Column_Space_Default_021.top);
expect(Column_Space_Default_023.bottom).assertLess(Column_Space_Default_02.bottom);
console.log('assert height')
expect(Math.round(Column_Space_Default_021.bottom - Column_Space_Default_021.top)).assertEqual(vp2px(50));
expect(Math.round(Column_Space_Default_022.bottom - Column_Space_Default_022.top)).assertEqual(vp2px(100));
expect(Math.round(Column_Space_Default_023.bottom - Column_Space_Default_023.top)).assertEqual(vp2px(150));
console.log('assert weight')
expect(Math.round(Column_Space_Default_021.right - Column_Space_Default_021.left)).assertEqual(vp2px(300));
expect(Math.round(Column_Space_Default_022.right - Column_Space_Default_022.left)).assertEqual(vp2px(300));
expect(Math.round(Column_Space_Default_023.right - Column_Space_Default_023.left)).assertEqual(vp2px(300));
console.info('[SUB_ACE_Column_Space_Default_TEST_0400] END');
done();
});
/**
* @tc.number SUB_ACE_Column_Space_Default_TEST_0500
* @tc.name testColumnSpace
* @tc.desc The value of space is set to '80%'
*/
it('SUB_ACE_Column_Space_Default_TEST_0500', 0, async function (done) {
console.info('[SUB_ACE_Column_Space_Default_TEST_0500] START');
globalThis.value.message.notify({name:'addSpace2', value:'80%'});
await CommonFunc.sleep(3000);
console.log('get Initial value')
let Column_Space_Default_021 = CommonFunc.getComponentRect('Column_Space_Default_021');
let Column_Space_Default_022 = CommonFunc.getComponentRect('Column_Space_Default_022');
let Column_Space_Default_023 = CommonFunc.getComponentRect('Column_Space_Default_023');
let Column_Space_Default_02 = CommonFunc.getComponentRect('Column_Space_Default_02');
console.log('assert position')
expect(Math.round(Column_Space_Default_021.left - Column_Space_Default_02.left)).assertEqual(Math.round(Column_Space_Default_02.right - Column_Space_Default_021.right));
expect(Math.round(Column_Space_Default_022.left - Column_Space_Default_02.left)).assertEqual(Math.round(Column_Space_Default_02.right - Column_Space_Default_022.right));
expect(Math.round(Column_Space_Default_023.left - Column_Space_Default_02.left)).assertEqual(Math.round(Column_Space_Default_02.right - Column_Space_Default_023.right));
expect(Math.round(Column_Space_Default_022.top - Column_Space_Default_021.bottom)).assertEqual(Math.round(Column_Space_Default_023.top - Column_Space_Default_022.bottom))
console.log('assert space')
expect(Math.round(Column_Space_Default_022.top - Column_Space_Default_021.bottom)).assertEqual(vp2px(0));
expect(Math.round(Column_Space_Default_023.top - Column_Space_Default_022.bottom)).assertEqual(vp2px(0));
console.log('Column_Space_Default_022.top - Column_Space_Default_021.bottom', + Column_Space_Default_022.top - Column_Space_Default_021.bottom)
console.log('Column_Space_Default_023.top - Column_Space_Default_022.bottom', + Column_Space_Default_023.top - Column_Space_Default_022.bottom)
expect(Column_Space_Default_02.top).assertEqual(Column_Space_Default_021.top);
expect(Column_Space_Default_023.bottom).assertLess(Column_Space_Default_02.bottom);
console.log('assert height')
expect(Math.round(Column_Space_Default_021.bottom - Column_Space_Default_021.top)).assertEqual(vp2px(50));
expect(Math.round(Column_Space_Default_022.bottom - Column_Space_Default_022.top)).assertEqual(vp2px(100));
expect(Math.round(Column_Space_Default_023.bottom - Column_Space_Default_023.top)).assertEqual(vp2px(150));
console.log('assert weight')
expect(Math.round(Column_Space_Default_021.right - Column_Space_Default_021.left)).assertEqual(vp2px(300));
expect(Math.round(Column_Space_Default_022.right - Column_Space_Default_022.left)).assertEqual(vp2px(300));
expect(Math.round(Column_Space_Default_023.right - Column_Space_Default_023.left)).assertEqual(vp2px(300));
console.info('[SUB_ACE_Column_Space_Default_TEST_0500] END');
done();
});
/**
* @tc.number SUB_ACE_Column_Space_Default_TEST_0100
* @tc.name testColumnSpace
* @tc.desc The value of space is set to null
*/
it('SUB_ACE_Column_Space_Default_TEST_0100', 0, async function (done) {
console.info('[SUB_ACE_Column_Space_Default_TEST_0100] START');
globalThis.value.message.notify({name:'addSpace1', value:undefined});
await CommonFunc.sleep(3000);
console.log('get Initial value')
let Column_Space_Default_011 = CommonFunc.getComponentRect('Column_Space_Default_011');
let Column_Space_Default_012 = CommonFunc.getComponentRect('Column_Space_Default_012');
let Column_Space_Default_013 = CommonFunc.getComponentRect('Column_Space_Default_013');
let Column_Space_Default_01 = CommonFunc.getComponentRect('Column_Space_Default_01');
console.log('assert position')
expect(Math.round(Column_Space_Default_011.left - Column_Space_Default_01.left)).assertEqual(Math.round(Column_Space_Default_01.right - Column_Space_Default_011.right));
expect(Math.round(Column_Space_Default_012.left - Column_Space_Default_01.left)).assertEqual(Math.round(Column_Space_Default_01.right - Column_Space_Default_012.right));
expect(Math.round(Column_Space_Default_013.left - Column_Space_Default_01.left)).assertEqual(Math.round(Column_Space_Default_01.right - Column_Space_Default_013.right));
expect(Math.round(Column_Space_Default_012.top - Column_Space_Default_011.bottom)).assertEqual(Math.round(Column_Space_Default_013.top - Column_Space_Default_012.bottom))
console.log('assert space')
expect(Math.round(Column_Space_Default_012.top - Column_Space_Default_011.bottom)).assertEqual(vp2px(0));
expect(Math.round(Column_Space_Default_013.top - Column_Space_Default_012.bottom)).assertEqual(vp2px(0));
console.log('Column_Space_Default_012.top - Column_Space_Default_011.bottom', + Column_Space_Default_012.top - Column_Space_Default_011.bottom)
console.log('Column_Space_Default_013.top - Column_Space_Default_012.bottom', + Column_Space_Default_013.top - Column_Space_Default_012.bottom)
expect(Column_Space_Default_01.top).assertEqual(Column_Space_Default_011.top);
expect(Column_Space_Default_013.bottom).assertLess(Column_Space_Default_01.bottom);
console.log('assert height')
expect(Math.round(Column_Space_Default_011.bottom - Column_Space_Default_011.top)).assertEqual(vp2px(50));
expect(Math.round(Column_Space_Default_012.bottom - Column_Space_Default_012.top)).assertEqual(vp2px(100));
expect(Math.round(Column_Space_Default_013.bottom - Column_Space_Default_013.top)).assertEqual(vp2px(150));
console.log('assert weight')
expect(Math.round(Column_Space_Default_011.right - Column_Space_Default_011.left)).assertEqual(vp2px(300));
expect(Math.round(Column_Space_Default_012.right - Column_Space_Default_012.left)).assertEqual(vp2px(300));
expect(Math.round(Column_Space_Default_013.right - Column_Space_Default_013.left)).assertEqual(vp2px(300));
console.info('[SUB_ACE_Column_Space_Default_TEST_0100] END');
done();
});
})
}
\ No newline at end of file
......@@ -23,6 +23,21 @@
import flexTextMargin_AutoJsunit from './Flex/alignItems/ItemAlign_Auto/FlexTextMarginJsunit.test.ets';
import Row_Space from './Row/spaceChanged/Row_Space.test.ets';
import Column_Space from './Column/spaceChanged/Column_Space.test.ets';
import Column_Space_String from './Column/spaceChanged/Column_Space_String.test.ets';
import Column_Space_Default from './Column/spaceChanged/Column_Space_Default.test.ets';
import layoutWeight_Part from './Column/layoutWeight/layoutWeight_Part.test';
import layoutWeight_All from './Column/layoutWeight/layoutWeight_All.test';
import layoutWeight_Default from './Column/layoutWeight/layoutWeight_Default.test.ets';
import layoutWeight_flexGrow from './Column/layoutWeight/layoutWeight_flexGrow.test.ets';
import layoutWeight_flexShrink from './Column/layoutWeight/layoutWeight_flexShrink.test.ets';
import flexGrow_Part from './Column/flexGrow/flexGrow_Part.test.ets';
import flexGrow_Default from './Column/flexGrow/flexGrow_Default.test.ets';
import flexShrink_Part from './Column/flexShrink/flexShrink_Part.test.ets';
import flexBasis_Type from './Column/flexBasis/flexBasis_Type.test.ets';
import flexBasis_Default from './Column/flexBasis/flexBasis_Default.test.ets';
import columnNesting_Space from './Column/columnNesting/columnNesting_Space.test.ets';
import columnNesting_alignItems from './Column/columnNesting/columnNesting_alignItems.test.ets';
import columnNesting_justifyContent from './Column/columnNesting/columnNesting_justifyContent.test.ets';
import Grid_RowCol_TemplateChange from './Grid/GridTemplatesAllSet/GridTemplateChange/Grid_RowCol_TemplateChange.test.ets';
import Grid_RowCol_GridSize from './Grid/GridTemplatesAllSet/GridChange/Grid_RowCol_GridSize.test.ets';
import Grid_RowCol_PadMar from './Grid/GridTemplatesAllSet/GridChange/Grid_RowCol_PadMar.test.ets';
......@@ -101,6 +116,21 @@ export default function testsuite() {
flexTextMargin_AutoJsunit()
Row_Space()
Column_Space()
Column_Space_String()
Column_Space_Default()
layoutWeight_Part()
layoutWeight_All()
layoutWeight_Default()
layoutWeight_flexGrow()
layoutWeight_flexShrink()
flexGrow_Part()
flexGrow_Default()
flexShrink_Part()
flexBasis_Type()
flexBasis_Default()
columnNesting_Space()
columnNesting_alignItems()
columnNesting_justifyContent()
Grid_RowCol_TemplateChange()
Grid_RowCol_GridSize()
Grid_RowCol_PadMar()
......
......@@ -12,6 +12,21 @@
"MainAbility/pages/Flex/alignItems/ItemAlign_Auto/FlexTextMargin",
"MainAbility/pages/Row/spaceChanged/Row_Space",
"MainAbility/pages/Column/spaceChanged/Column_Space",
"MainAbility/pages/Column/spaceChanged/Column_Space_String",
"MainAbility/pages/Column/spaceChanged/Column_Space_Default",
"MainAbility/pages/Column/layoutWeight/layoutWeight_Part",
"MainAbility/pages/Column/layoutWeight/layoutWeight_All",
"MainAbility/pages/Column/layoutWeight/layoutWeight_Default",
"MainAbility/pages/Column/layoutWeight/layoutWeight_flexGrow",
"MainAbility/pages/Column/layoutWeight/layoutWeight_flexShrink",
"MainAbility/pages/Column/flexGrow/flexGrow_Part",
"MainAbility/pages/Column/flexGrow/flexGrow_Default",
"MainAbility/pages/Column/flexShrink/flexShrink_Part",
"MainAbility/pages/Column/flexBasis/flexBasis_Type",
"MainAbility/pages/Column/flexBasis/flexBasis_Default",
"MainAbility/pages/Column/columnNesting/columnNesting_Space",
"MainAbility/pages/Column/columnNesting/columnNesting_alignItems",
"MainAbility/pages/Column/columnNesting/columnNesting_justifyContent",
"MainAbility/pages/Grid/GridTemplatesAllSet/GridTemplateChange/Grid_RowCol_TemplateChange",
"MainAbility/pages/Grid/GridTemplatesAllSet/GridChange/Grid_RowCol_GridSize",
"MainAbility/pages/Grid/GridTemplatesAllSet/GridChange/Grid_RowCol_PadMar",
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册