未验证 提交 b4127341 编写于 作者: O openharmony_ci 提交者: Gitee

!8676 新增relative组件

Merge pull request !8676 from zhangshuqi/master
/**
* 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.
*/
@Entry
@Component
struct RelativeContainer_AnchorPoint_Absent {
onPageShow() {
console.info('RelativeContainer_AnchorPoint_Absent onPageShow');
}
build() {
Row() {
RelativeContainer() {
Button("Button1")
.width(120)
.height(30)
.alignRules({
top: { anchor: "__container__", align: VerticalAlign.Top },
middle: { anchor: "__container__", align: HorizontalAlign.Center }
})
.key("RelativeContainer_AnchorPoint_Absent_bt1")
.id("RelativeContainer_AnchorPoint_Absent_bt1")
.borderWidth(5)
.borderColor(Color.Black)
Text("This is text")
.fontSize(20)
.padding(10)
.alignRules({
right: { anchor: "RelativeContainer_AnchorPoint_Absent_bt2", align: HorizontalAlign.Center },
top: { anchor: "RelativeContainer_AnchorPoint_Absent_bt2", align: VerticalAlign.Bottom },
bottom: { anchor: "__container__", align: VerticalAlign.Bottom },
})
.key("RelativeContainer_AnchorPoint_Absent_tx2")
.id("RelativeContainer_AnchorPoint_Absent_tx2")
.borderWidth(2)
.borderColor(Color.Green)
.height(30)
.width(150)
}
.key("RelativeContainer_AnchorPoint_Absent_r1")
.width(300).height(300)
}
.key("RelativeContainer_AnchorPoint_Absent_row1")
.height('100%')
}
}
\ 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.
*/
@Entry
@Component
struct RelativeContainer_AnchorPoint_Circular_Dependency {
onPageShow() {
console.info('RelativeContainer_AnchorPoint_Absent onPageShow');
}
build() {
Row() {
RelativeContainer() {
Row().width(100).height(100)
.backgroundColor("#FF3333")
.alignRules({
middle: {anchor: "RelativeContainer_AnchorPoint_Circular_Dependency_row3", align: HorizontalAlign.End},
bottom: {anchor: "RelativeContainer_AnchorPoint_Circular_Dependency_row3", align:VerticalAlign.Top}
})
.key("RelativeContainer_AnchorPoint_Circular_Dependency_row1")
.id("RelativeContainer_AnchorPoint_Circular_Dependency_row1")
Row().width(100).height(100)
.backgroundColor("#FFCC00")
.alignRules({
top: {anchor: "RelativeContainer_AnchorPoint_Circular_Dependency_row1", align: VerticalAlign.Bottom},
left: {anchor: "RelativeContainer_AnchorPoint_Circular_Dependency_row1", align: HorizontalAlign.End}
})
.key("RelativeContainer_AnchorPoint_Circular_Dependency_row2")
.id("RelativeContainer_AnchorPoint_Circular_Dependency_row2")
Row().width(100).height(100)
.backgroundColor("#FF6633")
.alignRules({
top: {anchor: "RelativeContainer_AnchorPoint_Circular_Dependency_row2", align: VerticalAlign.Top},
right: {anchor: "RelativeContainer_AnchorPoint_Circular_Dependency_row2", align: HorizontalAlign.Start},
})
.key("RelativeContainer_AnchorPoint_Circular_Dependency_row3")
.id("RelativeContainer_AnchorPoint_Circular_Dependency_row3")
Row().width(100).height(100)
.backgroundColor("#FF9966")
.alignRules({
top: {anchor: "__container__", align: VerticalAlign.Top},
bottom: {anchor: "__container__", align: VerticalAlign.Bottom},
left: {anchor: "__container__", align: HorizontalAlign.Start},
})
.key("RelativeContainer_AnchorPoint_Circular_Dependency_row4")
.id("RelativeContainer_AnchorPoint_Circular_Dependency_row4")
}
.key("RelativeContainer_AnchorPoint_Circular_Dependency_r1")
.width(300).height(300)
}
.height('100%')
}
}
\ 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.
*/
@Entry
@Component
struct RelativeContainer_AnchorPoint_Id_Null {
onPageShow() {
console.info('RelativeContainer_AnchorPoint_Id_Null onPageShow');
}
build() {
Row() {
RelativeContainer() {
Row()
.width(100)
.height(100)
.backgroundColor("#FF3333")
.alignRules({
left: { anchor: "__container__", align: HorizontalAlign.Start },
top: { anchor: "__container__", align: VerticalAlign.Top }
})
.key("RelativeContainer_AnchorPoint_Id_Null_row1")
.id("RelativeContainer_AnchorPoint_Id_Null_row1")
Row()
.width(100)
.height(100)
.backgroundColor("#FFCC00")
.alignRules({
top: { anchor: "__container__", align: VerticalAlign.Top },
right: { anchor: "__container__", align: HorizontalAlign.End }
})
.key("RelativeContainer_AnchorPoint_Id_Null_row2")
.id(null)
}
.key("RelativeContainer_AnchorPoint_Id_Null_r1")
.width(300).height(300)
.border({ color: "#6699FF" })
}
.height('100%')
}
}
\ 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.
*/
@Entry
@Component
struct RelativeContainer_AnchorPoint_Id_Undefined {
onPageShow() {
console.info('RelativeContainer_AnchorPoint_Id_Undefined onPageShow');
}
build() {
Row() {
RelativeContainer() {
Row()
.width(100)
.height(100)
.backgroundColor("#FF3333")
.alignRules({
left: { anchor: "__container__", align: HorizontalAlign.Start },
top: { anchor: "__container__", align: VerticalAlign.Top }
})
.key("RelativeContainer_AnchorPoint_Id_Undefined_row1")
.id("RelativeContainer_AnchorPoint_Id_Undefined_row1")
Row()
.width(100)
.height(100)
.backgroundColor("#FFCC00")
.alignRules({
top: { anchor: "__container__", align: VerticalAlign.Top },
right: { anchor: "__container__", align: HorizontalAlign.End }
})
.key("RelativeContainer_AnchorPoint_Id_Undefined_row2")
.id(undefined)
}
.key("RelativeContainer_AnchorPoint_Id_Undefined_r1")
.width(300).height(300)
.border({ color: "#6699FF" })
}
.height('100%')
}
}
/**
* 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.
*/
@Entry
@Component
struct RelativeContainer_AnchorPoint_Interdependence {
onPageShow() {
console.info('RelativeContainer_AnchorPoint_Interdependence onPageShow');
}
build() {
Row() {
RelativeContainer() {
Row()
.width(100)
.height(100)
.backgroundColor("#FF3333")
.alignRules({
right: { anchor: "RelativeContainer_AnchorPoint_Interdependence_row2", align: HorizontalAlign.Start },
bottom: { anchor: "RelativeContainer_AnchorPoint_Interdependence_row2", align: VerticalAlign.Top }
})
.key("RelativeContainer_AnchorPoint_Interdependence_row1")
.id("RelativeContainer_AnchorPoint_Interdependence_row1")
Row()
.width(100)
.height(100)
.backgroundColor("#FFCC00")
.alignRules({
top: { anchor: "RelativeContainer_AnchorPoint_Interdependence_row1", align: VerticalAlign.Bottom },
left: { anchor: "RelativeContainer_AnchorPoint_Interdependence_row1", align: HorizontalAlign.End }
})
.key("RelativeContainer_AnchorPoint_Interdependence_row2")
.id("RelativeContainer_AnchorPoint_Interdependence_row2")
Row()
.width(100)
.height(100)
.backgroundColor("#FF9966")
.alignRules({
top: {anchor: "__container__", align: VerticalAlign.Top},
bottom: { anchor: "__container__", align: VerticalAlign.Bottom },
left: { anchor: "__container__", align: HorizontalAlign.Start },
})
.key("RelativeContainer_AnchorPoint_Interdependence_row3")
.id("RelativeContainer_AnchorPoint_Interdependence_row3")
}
.key("RelativeContainer_AnchorPoint_Interdependence_re1")
.width(300).height(300)
}
.height('100%')
}
}
\ 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.
*/
@Entry
@Component
struct RelativeContainer_AnchorPoint_Margin {
onPageShow() {
console.info('RelativeContainer_AnchorPoint_Margin onPageShow');
}
build() {
Row() {
RelativeContainer() {
Button("Button1")
.width(120)
.height(30)
.alignRules({
top: { anchor: "__container__", align: VerticalAlign.Top },
middle: { anchor: "__container__", align: HorizontalAlign.Center }
})
.key("RelativeContainer_AnchorPoint_Margin_bt1")
.id("RelativeContainer_AnchorPoint_Margin_bt1")
.borderWidth(5)
.borderColor(Color.Black)
Text("This is text")
.fontSize(20)
.padding(10)
.alignRules({
right: { anchor: "RelativeContainer_AnchorPoint_Margin_bt1", align: HorizontalAlign.Center },
top: { anchor: "RelativeContainer_AnchorPoint_Margin_bt1", align: VerticalAlign.Bottom },
bottom: { anchor: "__container__", align: VerticalAlign.Bottom },
})
.key("RelativeContainer_AnchorPoint_Margin_tx2")
.id("RelativeContainer_AnchorPoint_Margin_tx2")
.borderWidth(2)
.borderColor(Color.Green)
.height(30)
.width(150)
}
.key("RelativeContainer_AnchorPoint_Margin_r1")
.width(300).height(300)
}
.key("RelativeContainer_AnchorPoint_Margin_row1")
.margin({ left: 100 })
.height('100%')
}
}
\ 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.
*/
@Entry
@Component
struct RelativeContainer_AnchorPoint_NoId {
onPageShow() {
console.info('RelativeContainer_AnchorPoint_NoId onPageShow');
}
build() {
Row() {
RelativeContainer() {
Row()
.width(100)
.height(100)
.backgroundColor("#FF3333")
.alignRules({
left: { anchor: "__container__", align: HorizontalAlign.Start },
top: { anchor: "__container__", align: VerticalAlign.Top }
})
.key("RelativeContainer_AnchorPoint_NoId_row1")
.id("RelativeContainer_AnchorPoint_NoId_row1")
Row()
.width(100)
.height(100)
.backgroundColor("#FFCC00")
.alignRules({
top: { anchor: "__container__", align: VerticalAlign.Top },
right: { anchor: "__container__", align: HorizontalAlign.End }
})
.key("RelativeContainer_AnchorPoint_NoId_row2")
// .id("RelativeContainer_AnchorPoint_NoId_row2")
}
.key("RelativeContainer_AnchorPoint_NoId_r1")
.width(300).height(300)
.border({ color: "#6699FF" })
}
.height('100%')
}
}
\ 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.
*/
@Entry
@Component
struct RelativeContainer_AnchorPoint_Offset {
onPageShow() {
console.info('RelativeContainer_AnchorPoint_Offset onPageShow');
}
build() {
Row() {
RelativeContainer() {
Button("Button1")
.width(120)
.height(30)
.alignRules({
middle: { anchor: "__container__", align: HorizontalAlign.Center }
})
.key("RelativeContainer_AnchorPoint_Offset_bt1")
.id("RelativeContainer_AnchorPoint_Offset_bt1")
.borderWidth(5)
.borderColor(Color.Black)
Text("This is text")
.fontSize(20)
.padding(10)
.alignRules({
right: { anchor: "RelativeContainer_AnchorPoint_Offset_bt1", align: HorizontalAlign.Center },
top: { anchor: "RelativeContainer_AnchorPoint_Offset_bt1", align: VerticalAlign.Bottom },
bottom: { anchor: "__container__", align: VerticalAlign.Bottom },
})
.key("RelativeContainer_AnchorPoint_Offset_tx2")
.id("RelativeContainer_AnchorPoint_Offset_tx2")
.borderWidth(2)
.borderColor(Color.Green)
.height(30)
.width(150)
.offset({ x: 50, y: 0 })
}
.key("RelativeContainer_AnchorPoint_Offset_r1")
.width(300).height(300)
}
.height('100%')
}
}
\ 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.
*/
@Entry
@Component
struct RelativeContainer_AnchorPoint_Padding {
onPageShow() {
console.info('RelativeContainer_AnchorPoint_Padding onPageShow');
}
build() {
Row() {
RelativeContainer() {
Button("Button1")
.width(120)
.height(30)
.alignRules({
top: { anchor: "__container__", align: VerticalAlign.Top },
middle: { anchor: "__container__", align: HorizontalAlign.Center }
})
.key("RelativeContainer_AnchorPoint_Padding_bt1")
.id("RelativeContainer_AnchorPoint_Padding_bt1")
.borderWidth(5)
.borderColor(Color.Black)
Text("This is text")
.fontSize(20)
.padding(10)
.alignRules({
right: { anchor: "RelativeContainer_AnchorPoint_Padding_bt1", align: HorizontalAlign.Center },
top: { anchor: "RelativeContainer_AnchorPoint_Padding_bt1", align: VerticalAlign.Bottom },
bottom: { anchor: "__container__", align: VerticalAlign.Bottom },
})
.key("RelativeContainer_AnchorPoint_Padding_tx2")
.id("RelativeContainer_AnchorPoint_Padding_tx2")
.borderWidth(2)
.borderColor(Color.Green)
.height(30)
.width(150)
}
.key("RelativeContainer_AnchorPoint_Padding_r1")
.width(300).height(300)
}
.key("RelativeContainer_AnchorPoint_Padding_row1")
.padding({ left: 100 })
.height('100%')
}
}
\ 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.
*/
@Entry
@Component
struct RelativeContainer_AnchorPoint_Position {
onPageShow() {
console.info('RelativeContainer_AnchorPoint_Position onPageShow');
}
build() {
Row() {
RelativeContainer() {
Button("Button1")
.width(120)
.height(30)
.alignRules({
middle: { anchor: "__container__", align: HorizontalAlign.Center }
})
.key("RelativeContainer_AnchorPoint_Position_bt1")
.id("RelativeContainer_AnchorPoint_Position_bt1")
.borderWidth(5)
.borderColor(Color.Black)
Text("This is text")
.fontSize(20)
.padding(10)
.alignRules({
right: { anchor: "RelativeContainer_AnchorPoint_Position_bt1", align: HorizontalAlign.Center },
top: { anchor: "RelativeContainer_AnchorPoint_Position_bt1", align: VerticalAlign.Bottom },
bottom: { anchor: "__container__", align: VerticalAlign.Bottom },
})
.key("RelativeContainer_AnchorPoint_Position_tx2")
.id("RelativeContainer_AnchorPoint_Position_tx2")
.borderWidth(2)
.borderColor(Color.Green)
.height(30)
.width(150)
.position({ x: 10, y: 10 })
}
.key("RelativeContainer_AnchorPoint_Position_r1")
.width(300).height(300)
}
.height('100%')
}
}
\ 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.
*/
@Entry
@Component
struct RelativeContainer_AnchorPoint_ThreeDirection {
onPageShow() {
console.info('RelativeContainer_AnchorPoint_ThreeDirection onPageShow');
}
build() {
Row() {
RelativeContainer() {
Button("Button1").width(120).height(30)
.alignRules({
top: { anchor: "__container__", align: VerticalAlign.Top },
middle:{anchor:"__container__",align:HorizontalAlign.Center}
})
.key("RelativeContainer_AnchorPoint_ThreeDirection_bt1")
.id("RelativeContainer_AnchorPoint_ThreeDirection_bt1").borderWidth(5).borderColor(Color.Black)
Text("This is text").fontSize(20).padding(10)
.alignRules({
right:{anchor:"RelativeContainer_AnchorPoint_ThreeDirection_bt1",align:HorizontalAlign.Center},
top:{anchor:"__container__",align:VerticalAlign.Top},
bottom:{anchor:"__container__",align:VerticalAlign.Bottom},
center:{anchor:"__container__",align:VerticalAlign.Center},
})
.key("RelativeContainer_AnchorPoint_ThreeDirection_tx2")
.id("RelativeContainer_AnchorPoint_ThreeDirection_tx2").borderWidth(2).borderColor(Color.Green)
.height(30)
.width(250)
}
.key("RelativeContainer_AnchorPoint_ThreeDirection_r1")
.width(300).height(300)
}
.height('100%')
}
}
\ 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.
*/
@Entry
@Component
struct RelativeContainer_AnchorPoint_TwoDirection {
onPageShow() {
console.info('RelativeContainer_AnchorPoint_TwoDirection onPageShow');
}
build() {
Row() {
RelativeContainer() {
Row().width(100).height(100).backgroundColor("#FF66FF")
.alignRules({
top:{anchor:"__container__",align:VerticalAlign.Top},
bottom:{anchor:"__container__",align:VerticalAlign.Bottom},
left:{anchor:"__container__",align:HorizontalAlign.Start},
right:{anchor:"__container__",align:HorizontalAlign.End},
})
.key("RelativeContainer_AnchorPoint_TwoDirection_row1")
.id("RelativeContainer_AnchorPoint_TwoDirection_row1")
}
.key("RelativeContainer_AnchorPoint_TwoDirection_r1")
.width(300).height(300)
}
.height('100%')
}
}
\ 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.
*/
@Entry
@Component
struct RelativeContainer_AnchorPoint_Visibility_Hidden {
onPageShow() {
console.info('RelativeContainer_AnchorPoint_Visibility_Hidden onPageShow');
}
build() {
Row() {
RelativeContainer() {
Button("Button1").width(120).height(30)
.alignRules({
middle:{anchor:"__container__",align:HorizontalAlign.Center}
})
.visibility(Visibility.Hidden)
.key("RelativeContainer_AnchorPoint_Visibility_Hidden_bt1")
.id("RelativeContainer_AnchorPoint_Visibility_Hidden_bt1").borderWidth(5).borderColor(Color.Black)
Text("This is text").fontSize(20).padding(10)
.alignRules({
right:{anchor:"RelativeContainer_AnchorPoint_Visibility_Hidden_bt1",align:HorizontalAlign.Center},
top:{anchor:"RelativeContainer_AnchorPoint_Visibility_Hidden_bt1",align:VerticalAlign.Bottom},
bottom:{anchor:"__container__",align:VerticalAlign.Bottom},
})
.key("RelativeContainer_AnchorPoint_Visibility_Hidden_tx2")
.id("RelativeContainer_AnchorPoint_Visibility_Hidden_tx2").borderWidth(2).borderColor(Color.Green)
.height(30)
.width(150)
Button("Button2").width(120).height(30)
.alignRules({
right:{anchor:"__container__",align:HorizontalAlign.End}
})
.key("RelativeContainer_AnchorPoint_Visibility_Hidden_bt2")
.id("RelativeContainer_AnchorPoint_Visibility_Hidden_bt2").borderWidth(5).borderColor(Color.Black)
}
.key("RelativeContainer_AnchorPoint_Visibility_Hidden_r1")
.width(300).height(300)
}
.key("RelativeContainer_AnchorPoint_Visibility_Hidden_row1")
.height('100%')
}
}
\ 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 RelativeContainer_AnchorPoint_Visibility_None {
onPageShow() {
console.info('RelativeContainer_AnchorPoint_Visibility_None onPageShow');
}
build() {
Row() {
RelativeContainer() {
Button("Button1").width(120).height(30)
.alignRules({
middle:{anchor:"__container__",align:HorizontalAlign.Center}
})
.visibility(Visibility.None)
.key("RelativeContainer_AnchorPoint_Visibility_None_bt1")
.id("RelativeContainer_AnchorPoint_Visibility_None_bt1").borderWidth(5).borderColor(Color.Black)
Text("This is text").fontSize(20).padding(10)
.alignRules({
right:{anchor:"RelativeContainer_AnchorPoint_Visibility_None_bt1",align:HorizontalAlign.Center},
top:{anchor:"RelativeContainer_AnchorPoint_Visibility_None_bt1",align:VerticalAlign.Bottom},
bottom:{anchor:"__container__",align:VerticalAlign.Bottom},
})
.key("RelativeContainer_AnchorPoint_Visibility_None_tx2")
.id("RelativeContainer_AnchorPoint_Visibility_None_tx2").borderWidth(2).borderColor(Color.Green)
.height(30)
.width(150)
Button("Button2").width(120).height(30)
.alignRules({
right:{anchor:"__container__",align:HorizontalAlign.End}
})
.key("RelativeContainer_AnchorPoint_Visibility_None_bt2")
.id("RelativeContainer_AnchorPoint_Visibility_None_bt2").borderWidth(5).borderColor(Color.Black)
}
.key("RelativeContainer_AnchorPoint_Visibility_None_r1")
.width(300).height(300)
}
.key("RelativeContainer_AnchorPoint_Visibility_None_row1")
.height('100%')
}
}
\ 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 RelativeContainer_Level {
@State addalign : HorizontalAlign = HorizontalAlign.Start
messageManager:MessageManager = new MessageManager()
onPageShow() {
console.info('RelativeContainer_Level onPageShow');
globalThis.value = {
name:'messageManager',message:this.messageManager
}
let callback:Callback = (message:any) => {
console.error('message = ' + message.name + "--" + message.value);
if (message.name == 'addalign') {
this.addalign = message.value;
}
}
this.messageManager.registerCallback(callback);
}
build() {
Row() {
RelativeContainer() {
Button("Button1").width(120).height(30)
.alignRules({
middle:{anchor:"__container__",align:HorizontalAlign.Center}
})
.key("RelativeContainer_Level_bt1")
.id("RelativeContainer_Level_bt1").borderWidth(5).borderColor(Color.Black)
Text("This is text").fontSize(20).padding(10)
.alignRules({
bottom:{anchor:"__container__",align:VerticalAlign.Bottom},
top:{anchor:"RelativeContainer_Level_bt1",align:VerticalAlign.Bottom},
right:{anchor:"RelativeContainer_Level_bt1",align:this.addalign}
})
.key("RelativeContainer_Level_bt1")
.id("RelativeContainer_Level_tx2").borderWidth(2).borderColor(Color.Green)
.height(30)
.width(250)
}
.width(300).height(300)
.border({width:2, color: "#6699FF"})
}
.height('100%')
}
}
\ 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 RelativeContainer_Vertical {
@State addalign : VerticalAlign = VerticalAlign.Top
messageManager:MessageManager = new MessageManager()
onPageShow() {
console.info('RelativeContainer_Vertical onPageShow');
globalThis.value = {
name:'messageManager',message:this.messageManager
}
let callback:Callback = (message:any) => {
console.error('message = ' + message.name + "--" + message.value);
if (message.name == 'addalign') {
this.addalign = message.value;
}
}
this.messageManager.registerCallback(callback);
}
build() {
Row() {
RelativeContainer() {
Button("Button1").width(120).height(30)
.alignRules({
center:{anchor:"__container__",align:VerticalAlign.Center}
})
.key("RelativeContainer_Vertical_bt1")
.id("RelativeContainer_Vertical_bt1").borderWidth(5).borderColor(Color.Black)
Text("This is text").fontSize(20).padding(10)
.alignRules({
bottom:{anchor:"__container__",align:VerticalAlign.Bottom},
top:{anchor:"RelativeContainer_Vertical_bt1",align:this.addalign},
left:{anchor:"RelativeContainer_Vertical_bt1",align:HorizontalAlign.End}
})
.key("RelativeContainer_Vertical_tx2")
.id("RelativeContainer_Vertical_tx2").borderWidth(2).borderColor(Color.Green)
.height(30)
.width(250)
}
.width(300).height(300)
.border({width:2, color: "#6699FF"})
}
.height('100%')
}
}
\ No newline at end of file
......@@ -91,6 +91,23 @@ import swiperItemMargin from './Swiper/Swiper_ItemChange/swiperItemMargin.test.e
import swiperItemPadMar from './Swiper/Swiper_ItemChange/swiperItemPadMar.test.ets';
import swiperItemVisibility from './Swiper/Swiper_ItemChange/swiperItemVisibility.test.ets';
import RelativeContainer_Level from './RelativeContainer/RelativeContainer_Level/RelativeContainer_Level.test.ets';
import RelativeContainer_Vertical from './RelativeContainer/RelativeContainer_Vertical/RelativeContainer_Vertical.test.ets';
import RelativeContainer_AnchorPoint_Absent from './RelativeContainer/RelativeContainer_AnchorPoint/RelativeContainer_AnchorPoint_Absent.test.ets';
import RelativeContainer_AnchorPoint_Circular_Dependency from './RelativeContainer/RelativeContainer_AnchorPoint/RelativeContainer_AnchorPoint_Circular_Dependency.test.ets';
import RelativeContainer_AnchorPoint_Interdependence from './RelativeContainer/RelativeContainer_AnchorPoint/RelativeContainer_AnchorPoint_Interdependence.test.ets';
import RelativeContainer_AnchorPoint_Margin from './RelativeContainer/RelativeContainer_AnchorPoint/RelativeContainer_AnchorPoint_Margin.test.ets';
import RelativeContainer_AnchorPoint_Padding from './RelativeContainer/RelativeContainer_AnchorPoint/RelativeContainer_AnchorPoint_Padding.test.ets';
import RelativeContainer_AnchorPoint_ThreeDirection from './RelativeContainer/RelativeContainer_AnchorPoint/RelativeContainer_AnchorPoint_ThreeDirection.test.ets';
import RelativeContainer_AnchorPoint_TwoDirection from './RelativeContainer/RelativeContainer_AnchorPoint/RelativeContainer_AnchorPoint_TwoDirection.test.ets';
import RelativeContainer_AnchorPoint_Visibility_Hidden from './RelativeContainer/RelativeContainer_AnchorPoint/RelativeContainer_AnchorPoint_Visibility_Hidden.test.ets';
import RelativeContainer_AnchorPoint_Visibility_None from './RelativeContainer/RelativeContainer_AnchorPoint/RelativeContainer_AnchorPoint_Visibility_None.test.ets';
import RelativeContainer_AnchorPoint_NoId from './RelativeContainer/RelativeContainer_AnchorPoint/RelativeContainer_AnchorPoint_NoId.test.ets';
import RelativeContainer_AnchorPoint_Id_Null from './RelativeContainer/RelativeContainer_AnchorPoint/RelativeContainer_AnchorPoint_Id_Null.test.ets';
import RelativeContainer_AnchorPoint_Id_Undefined from './RelativeContainer/RelativeContainer_AnchorPoint/RelativeContainer_AnchorPoint_Id_Undefined.test.ets';
import RelativeContainer_AnchorPoint_Offset from './RelativeContainer/RelativeContainer_AnchorPoint/RelativeContainer_AnchorPoint_Offset.test.ets';
import RelativeContainer_AnchorPoint_Position from './RelativeContainer/RelativeContainer_AnchorPoint/RelativeContainer_AnchorPoint_Position.test.ets';
import Row_Space from './Row/spaceChanged/Row_Space.test.ets';
import Row_Space_String from './Row/spaceChanged/Row_Space_String.test.ets';
import Row_Space_Default from './Row/spaceChanged/Row_Space_Default.test.ets';
......@@ -271,6 +288,22 @@ swiperItemMargin()
swiperItemPadMar()
swiperItemVisibility()
RelativeContainer_Level()
RelativeContainer_Vertical()
RelativeContainer_AnchorPoint_Absent()
RelativeContainer_AnchorPoint_Circular_Dependency()
RelativeContainer_AnchorPoint_Interdependence()
RelativeContainer_AnchorPoint_Margin()
RelativeContainer_AnchorPoint_Padding()
RelativeContainer_AnchorPoint_ThreeDirection()
RelativeContainer_AnchorPoint_TwoDirection()
RelativeContainer_AnchorPoint_Visibility_Hidden()
RelativeContainer_AnchorPoint_Visibility_None()
RelativeContainer_AnchorPoint_NoId()
RelativeContainer_AnchorPoint_Id_Null()
RelativeContainer_AnchorPoint_Id_Undefined()
RelativeContainer_AnchorPoint_Offset()
RelativeContainer_AnchorPoint_Position()
Row_Space()
Row_Space_String()
......
/**
* 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 RelativeContainer_AnchorPoint_Absent() {
describe('RelativeContainer_AnchorPoint_Absent', function () {
beforeEach(async function (done) {
console.info("RelativeContainer_AnchorPoint_Absent beforeEach start");
let options = {
url: "MainAbility/pages/RelativeContainer/RelativeContainer_AnchorPoint/RelativeContainer_AnchorPoint_Absent",
}
try {
router.clear();
let pages = router.getState();
console.info("get RelativeContainer_AnchorPoint_Absent state pages:" + JSON.stringify(pages));
if (!("RelativeContainer_AnchorPoint_Absent" == pages.name)) {
console.info("get RelativeContainer_AnchorPoint_Absent pages.name:" + JSON.stringify(pages.name));
let result = await router.push(options);
await CommonFunc.sleep(2000);
console.info("push RelativeContainer_AnchorPoint_Absent page result:" + JSON.stringify(result));
}
} catch (err) {
console.error("push RelativeContainer_AnchorPoint_Absent page error " + JSON.stringify(err));
expect().assertFail();
}
done();
});
afterEach(async function () {
await CommonFunc.sleep(2000);
console.info("RelativeContainer_AnchorPoint_Absent after each called")
});
/**
* @tc.number SUB_ACE_RelativeContainer_AnchorPoint_Absent_TEST_0100
* @tc.name testRelativeContainer
* @tc.desc Relying on non-existent elements as anchors
*/
it('SUB_ACE_RelativeContainer_AnchorPoint_Absent_TEST_0100', 0, async function (done) {
console.info('[SUB_ACE_RelativeContainer_AnchorPoint_Absent_TEST_0100] START');
await CommonFunc.sleep(3000);
console.log('get Initial value')
let RelativeContainer_AnchorPoint_Absent_bt1 = CommonFunc.getComponentRect('RelativeContainer_AnchorPoint_Absent_bt1');
let RelativeContainer_AnchorPoint_Absent_tx2 = CommonFunc.getComponentRect('RelativeContainer_AnchorPoint_Absent_tx2');
let RelativeContainer_AnchorPoint_Absent_r1 = CommonFunc.getComponentRect('RelativeContainer_AnchorPoint_Absent_r1');
let RelativeContainer_AnchorPoint_Absent_row1 = CommonFunc.getComponentRect('RelativeContainer_AnchorPoint_Absent_row1');
console.log('assert position')
expect(RelativeContainer_AnchorPoint_Absent_r1.left).assertEqual(RelativeContainer_AnchorPoint_Absent_row1.left);
expect(RelativeContainer_AnchorPoint_Absent_bt1.top).assertEqual(RelativeContainer_AnchorPoint_Absent_r1.top );
expect(RelativeContainer_AnchorPoint_Absent_bt1.left + (RelativeContainer_AnchorPoint_Absent_bt1.right - RelativeContainer_AnchorPoint_Absent_bt1.left)/2 ).assertEqual(RelativeContainer_AnchorPoint_Absent_r1.left + (RelativeContainer_AnchorPoint_Absent_r1.right - RelativeContainer_AnchorPoint_Absent_r1.left)/2);
console.info('[SUB_ACE_RelativeContainer_AnchorPoint_Absent_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 RelativeContainer_AnchorPoint_Circular_Dependency() {
describe('RelativeContainer_AnchorPoint_Circular_Dependency', function () {
beforeEach(async function (done) {
console.info("RelativeContainer_AnchorPoint_Circular_Dependency beforeEach start");
let options = {
url: "MainAbility/pages/RelativeContainer/RelativeContainer_AnchorPoint/RelativeContainer_AnchorPoint_Circular_Dependency",
}
try {
router.clear();
let pages = router.getState();
console.info("get RelativeContainer_AnchorPoint_Circular_Dependency state pages:" + JSON.stringify(pages));
if (!("RelativeContainer_AnchorPoint_Circular_Dependency" == pages.name)) {
console.info("get RelativeContainer_AnchorPoint_Circular_Dependency pages.name:" + JSON.stringify(pages.name));
let result = await router.push(options);
await CommonFunc.sleep(2000);
console.info("push RelativeContainer_AnchorPoint_Circular_Dependency page result:" + JSON.stringify(result));
}
} catch (err) {
console.error("push RelativeContainer_AnchorPoint_Circular_Dependency page error " + JSON.stringify(err));
expect().assertFail();
}
done();
});
afterEach(async function () {
await CommonFunc.sleep(2000);
console.info("RelativeContainer_AnchorPoint_Circular_Dependency after each called")
});
/**
* @tc.number SUB_ACE_RelativeContainer_AnchorPoint_Circular_Dependency_TEST_0100
* @tc.name testRelativeContainer
* @tc.desc Circular dependencies between subcomponents
*/
it('SUB_ACE_RelativeContainer_AnchorPoint_Circular_Dependency_TEST_0100', 0, async function (done) {
console.info('[SUB_ACE_RelativeContainer_AnchorPoint_Circular_Dependency_TEST_0100] START');
await CommonFunc.sleep(3000);
console.log('get Initial value')
let RelativeContainer_AnchorPoint_Circular_Dependency_row4 = CommonFunc.getComponentRect('RelativeContainer_AnchorPoint_Circular_Dependency_row4');
let RelativeContainer_AnchorPoint_Circular_Dependency_r1 = CommonFunc.getComponentRect('RelativeContainer_AnchorPoint_Circular_Dependency_r1');
console.log('assert position')
expect(RelativeContainer_AnchorPoint_Circular_Dependency_row4.left).assertEqual(RelativeContainer_AnchorPoint_Circular_Dependency_r1.left);
expect(RelativeContainer_AnchorPoint_Circular_Dependency_row4.top).assertEqual(RelativeContainer_AnchorPoint_Circular_Dependency_r1.top);
// expect(RelativeContainer_AnchorPoint_Circular_Dependency_row4.bottom).assertEqual(RelativeContainer_AnchorPoint_Circular_Dependency_r1.bottom);
console.info('[SUB_ACE_RelativeContainer_AnchorPoint_Circular_Dependency_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 RelativeContainer_AnchorPoint_Id_Null() {
describe('RelativeContainer_AnchorPoint_Id_Null', function () {
beforeEach(async function (done) {
console.info("RelativeContainer_AnchorPoint_Id_Null beforeEach start");
let options = {
url: "MainAbility/pages/RelativeContainer/RelativeContainer_AnchorPoint/RelativeContainer_AnchorPoint_Id_Null",
}
try {
router.clear();
let pages = router.getState();
console.info("get RelativeContainer_AnchorPoint_Id_Null state pages:" + JSON.stringify(pages));
if (!("RelativeContainer_AnchorPoint_Id_Null" == pages.name)) {
console.info("get RelativeContainer_AnchorPoint_Id_Null pages.name:" + JSON.stringify(pages.name));
let result = await router.push(options);
await CommonFunc.sleep(2000);
console.info("push RelativeContainer_AnchorPoint_Id_Null page result:" + JSON.stringify(result));
}
} catch (err) {
console.error("push RelativeContainer_AnchorPoint_Id_Null page error " + JSON.stringify(err));
expect().assertFail();
}
done();
});
afterEach(async function () {
await CommonFunc.sleep(2000);
console.info("RelativeContainer_AnchorPoint_Id_Null after each called")
});
/**
* @tc.number SUB_ACE_RelativeContainer_AnchorPoint_Id_Null_TEST_0100
* @tc.name testRelativeContainer
* @tc.desc Set the id of the child element to null
*/
it('SUB_ACE_RelativeContainer_AnchorPoint_Id_Null_TEST_0100', 0, async function (done) {
console.info('[SUB_ACE_RelativeContainer_AnchorPoint_Id_Null_TEST_0100] START');
await CommonFunc.sleep(3000);
console.log('get Initial value')
let RelativeContainer_AnchorPoint_Id_Null_row1 = CommonFunc.getComponentRect('RelativeContainer_AnchorPoint_Id_Null_row1');
// let RelativeContainer_AnchorPoint_Id_Null_row2 = CommonFunc.getComponentRect('RelativeContainer_AnchorPoint_Id_Null_row2');
let RelativeContainer_AnchorPoint_Id_Null_r1 = CommonFunc.getComponentRect('RelativeContainer_AnchorPoint_Id_Null_r1');
console.log('assert position')
expect(RelativeContainer_AnchorPoint_Id_Null_row1.left).assertEqual(RelativeContainer_AnchorPoint_Id_Null_r1.left);
expect(RelativeContainer_AnchorPoint_Id_Null_row1.top).assertEqual(RelativeContainer_AnchorPoint_Id_Null_r1.top);
// expect(RelativeContainer_AnchorPoint_Id_Null_row2.right).assertEqual(RelativeContainer_AnchorPoint_Id_Null_r1.right);
// expect(RelativeContainer_AnchorPoint_Id_Null_row2.top).assertEqual(RelativeContainer_AnchorPoint_Id_Null_r1.top);
console.info('[SUB_ACE_RelativeContainer_AnchorPoint_Id_Null_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 RelativeContainer_AnchorPoint_Id_Undefined() {
describe('RelativeContainer_AnchorPoint_Id_Undefined', function () {
beforeEach(async function (done) {
console.info("RelativeContainer_AnchorPoint_Id_Undefined beforeEach start");
let options = {
url: "MainAbility/pages/RelativeContainer/RelativeContainer_AnchorPoint/RelativeContainer_AnchorPoint_Id_Undefined",
}
try {
router.clear();
let pages = router.getState();
console.info("get RelativeContainer_AnchorPoint_Id_Undefined state pages:" + JSON.stringify(pages));
if (!("RelativeContainer_AnchorPoint_Id_Undefined" == pages.name)) {
console.info("get RelativeContainer_AnchorPoint_Id_Undefined pages.name:" + JSON.stringify(pages.name));
let result = await router.push(options);
await CommonFunc.sleep(2000);
console.info("push RelativeContainer_AnchorPoint_Id_Undefined page result:" + JSON.stringify(result));
}
} catch (err) {
console.error("push RelativeContainer_AnchorPoint_Id_Undefined page error " + JSON.stringify(err));
expect().assertFail();
}
done();
});
afterEach(async function () {
await CommonFunc.sleep(2000);
console.info("RelativeContainer_AnchorPoint_Id_Undefined after each called")
});
/**
* @tc.number SUB_ACE_RelativeContainer_AnchorPoint_Id_Undefined_TEST_0100
* @tc.name testRelativeContainer
* @tc.desc Set the id of the child element to undefined
*/
it('SUB_ACE_RelativeContainer_AnchorPoint_Id_Undefined_TEST_0100', 0, async function (done) {
console.info('[SUB_ACE_RelativeContainer_AnchorPoint_Id_Undefined_TEST_0100] START');
await CommonFunc.sleep(3000);
console.log('get Initial value')
let RelativeContainer_AnchorPoint_Id_Undefined_row1 = CommonFunc.getComponentRect('RelativeContainer_AnchorPoint_Id_Undefined_row1');
// let RelativeContainer_AnchorPoint_Id_Undefined_row2 = CommonFunc.getComponentRect('RelativeContainer_AnchorPoint_Id_Undefined_row2');
let RelativeContainer_AnchorPoint_Id_Undefined_r1 = CommonFunc.getComponentRect('RelativeContainer_AnchorPoint_Id_Undefined_r1');
console.log('assert position')
expect(RelativeContainer_AnchorPoint_Id_Undefined_row1.left).assertEqual(RelativeContainer_AnchorPoint_Id_Undefined_r1.left);
expect(RelativeContainer_AnchorPoint_Id_Undefined_row1.top).assertEqual(RelativeContainer_AnchorPoint_Id_Undefined_r1.top);
// expect(RelativeContainer_AnchorPoint_Id_Undefined_row2.right).assertEqual(RelativeContainer_AnchorPoint_Id_Undefined_r1.right);
// expect(RelativeContainer_AnchorPoint_Id_Undefined_row2.top).assertEqual(RelativeContainer_AnchorPoint_Id_Undefined_r1.top);
console.info('[SUB_ACE_RelativeContainer_AnchorPoint_Id_Undefined_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 RelativeContainer_AnchorPoint_Interdependence() {
describe('RelativeContainer_AnchorPoint_Interdependence', function () {
beforeEach(async function (done) {
console.info("RelativeContainer_AnchorPoint_Interdependence beforeEach start");
let options = {
url: "MainAbility/pages/RelativeContainer/RelativeContainer_AnchorPoint/RelativeContainer_AnchorPoint_Interdependence",
}
try {
router.clear();
let pages = router.getState();
console.info("get RelativeContainer_AnchorPoint_Interdependence state pages:" + JSON.stringify(pages));
if (!("RelativeContainer_AnchorPoint_Interdependence" == pages.name)) {
console.info("get RelativeContainer_AnchorPoint_Interdependence pages.name:" + JSON.stringify(pages.name));
let result = await router.push(options);
await CommonFunc.sleep(2000);
console.info("push RelativeContainer_AnchorPoint_Interdependence page result:" + JSON.stringify(result));
}
} catch (err) {
console.error("push RelativeContainer_AnchorPoint_Interdependence page error " + JSON.stringify(err));
expect().assertFail();
}
done();
});
afterEach(async function () {
await CommonFunc.sleep(2000);
console.info("RelativeContainer_AnchorPoint_Interdependence after each called")
});
/**
* @tc.number SUB_ACE_RelativeContainer_AnchorPoint_Interdependence_TEST_0100
* @tc.name testRelativeContainer
* @tc.desc Subcomponent interdependence
*/
it('SUB_ACE_RelativeContainer_AnchorPoint_Interdependence_TEST_0100', 0, async function (done) {
console.info('[SUB_ACE_RelativeContainer_AnchorPoint_Interdependence_TEST_0100] START');
await CommonFunc.sleep(3000);
console.log('get Initial value')
let RelativeContainer_AnchorPoint_Interdependence_row3 = CommonFunc.getComponentRect('RelativeContainer_AnchorPoint_Interdependence_row3');
let RelativeContainer_AnchorPoint_Interdependence_re1 = CommonFunc.getComponentRect('RelativeContainer_AnchorPoint_Interdependence_re1');
console.log('assert position')
expect(RelativeContainer_AnchorPoint_Interdependence_row3.left).assertEqual(RelativeContainer_AnchorPoint_Interdependence_re1.left);
expect(RelativeContainer_AnchorPoint_Interdependence_row3.top).assertEqual(RelativeContainer_AnchorPoint_Interdependence_re1.top);
// expect(RelativeContainer_AnchorPoint_Interdependence_row3.bottom).assertEqual(RelativeContainer_AnchorPoint_Interdependence_re1.bottom);
console.info('[SUB_ACE_RelativeContainer_AnchorPoint_Interdependence_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 RelativeContainer_AnchorPoint_Margin() {
describe('RelativeContainer_AnchorPoint_Margin', function () {
beforeEach(async function (done) {
console.info("RelativeContainer_AnchorPoint_Margin beforeEach start");
let options = {
url: "MainAbility/pages/RelativeContainer/RelativeContainer_AnchorPoint/RelativeContainer_AnchorPoint_Margin",
}
try {
router.clear();
let pages = router.getState();
console.info("get RelativeContainer_AnchorPoint_Margin state pages:" + JSON.stringify(pages));
if (!("RelativeContainer_AnchorPoint_Margin" == pages.name)) {
console.info("get RelativeContainer_AnchorPoint_Margin pages.name:" + JSON.stringify(pages.name));
let result = await router.push(options);
await CommonFunc.sleep(2000);
console.info("push RelativeContainer_AnchorPoint_Margin page result:" + JSON.stringify(result));
}
} catch (err) {
console.error("push RelativeContainer_AnchorPoint_Margin page error " + JSON.stringify(err));
expect().assertFail();
}
done();
});
afterEach(async function () {
await CommonFunc.sleep(2000);
console.info("RelativeContainer_AnchorPoint_Margin after each called")
});
/**
* @tc.number SUB_ACE_RelativeContainer_AnchorPoint_Margin_TEST_0100
* @tc.name testRelativeContainer
* @tc.desc Parent component setting margin property
*/
it('SUB_ACE_RelativeContainer_AnchorPoint_Margin_TEST_0100', 0, async function (done) {
console.info('[SUB_ACE_RelativeContainer_AnchorPoint_Margin_TEST_0100] START');
await CommonFunc.sleep(3000);
console.log('get Initial value')
let RelativeContainer_AnchorPoint_Margin_bt1 = CommonFunc.getComponentRect('RelativeContainer_AnchorPoint_Margin_bt1');
let RelativeContainer_AnchorPoint_Margin_tx2 = CommonFunc.getComponentRect('RelativeContainer_AnchorPoint_Margin_tx2');
let RelativeContainer_AnchorPoint_Margin_r1 = CommonFunc.getComponentRect('RelativeContainer_AnchorPoint_Margin_r1');
let RelativeContainer_AnchorPoint_Margin_row1 = CommonFunc.getComponentRect('RelativeContainer_AnchorPoint_Margin_row1');
console.log('assert position')
expect(RelativeContainer_AnchorPoint_Margin_row1.left).assertEqual(vp2px(100));
expect(RelativeContainer_AnchorPoint_Margin_r1.left).assertEqual(RelativeContainer_AnchorPoint_Margin_row1.left);
expect(RelativeContainer_AnchorPoint_Margin_tx2.top).assertEqual(RelativeContainer_AnchorPoint_Margin_bt1.bottom);
expect(RelativeContainer_AnchorPoint_Margin_tx2.bottom).assertEqual(RelativeContainer_AnchorPoint_Margin_r1.bottom);
expect(RelativeContainer_AnchorPoint_Margin_tx2.right).assertEqual((RelativeContainer_AnchorPoint_Margin_bt1.right - RelativeContainer_AnchorPoint_Margin_bt1.left)/2 + RelativeContainer_AnchorPoint_Margin_bt1.left);
console.info('[SUB_ACE_RelativeContainer_AnchorPoint_Margin_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 RelativeContainer_AnchorPoint_NoId() {
describe('RelativeContainer_AnchorPoint_NoId', function () {
beforeEach(async function (done) {
console.info("RelativeContainer_AnchorPoint_NoId beforeEach start");
let options = {
url: "MainAbility/pages/RelativeContainer/RelativeContainer_AnchorPoint/RelativeContainer_AnchorPoint_NoId",
}
try {
router.clear();
let pages = router.getState();
console.info("get RelativeContainer_AnchorPoint_NoId state pages:" + JSON.stringify(pages));
if (!("RelativeContainer_AnchorPoint_NoId" == pages.name)) {
console.info("get RelativeContainer_AnchorPoint_NoId pages.name:" + JSON.stringify(pages.name));
let result = await router.push(options);
await CommonFunc.sleep(2000);
console.info("push RelativeContainer_AnchorPoint_NoId page result:" + JSON.stringify(result));
}
} catch (err) {
console.error("push RelativeContainer_AnchorPoint_NoId page error " + JSON.stringify(err));
expect().assertFail();
}
done();
});
afterEach(async function () {
await CommonFunc.sleep(2000);
console.info("RelativeContainer_AnchorPoint_NoId after each called")
});
/**
* @tc.number SUB_ACE_RelativeContainer_AnchorPoint_NoId_TEST_0100
* @tc.name testRelativeContainer
* @tc.desc Set ID for one subcomponent, do not set ID for one subcomponent
*/
it('SUB_ACE_RelativeContainer_AnchorPoint_NoId_TEST_0100', 0, async function (done) {
console.info('[SUB_ACE_RelativeContainer_AnchorPoint_NoId_TEST_0100] START');
await CommonFunc.sleep(3000);
console.log('get Initial value')
let RelativeContainer_AnchorPoint_NoId_row1 = CommonFunc.getComponentRect('RelativeContainer_AnchorPoint_NoId_row1');
// let RelativeContainer_AnchorPoint_NoId_row2 = CommonFunc.getComponentRect('RelativeContainer_AnchorPoint_NoId_row2');
let RelativeContainer_AnchorPoint_NoId_r1 = CommonFunc.getComponentRect('RelativeContainer_AnchorPoint_NoId_r1');
console.log('assert position')
expect(RelativeContainer_AnchorPoint_NoId_row1.left).assertEqual(RelativeContainer_AnchorPoint_NoId_r1.left);
expect(RelativeContainer_AnchorPoint_NoId_row1.top).assertEqual(RelativeContainer_AnchorPoint_NoId_r1.top);
// expect(RelativeContainer_AnchorPoint_NoId_row2.right).assertEqual(RelativeContainer_AnchorPoint_NoId_r1.right);
// expect(RelativeContainer_AnchorPoint_NoId_row2.top).assertEqual(RelativeContainer_AnchorPoint_NoId_r1.top);
console.info('[SUB_ACE_RelativeContainer_AnchorPoint_NoId_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 RelativeContainer_AnchorPoint_Offset() {
describe('RelativeContainer_AnchorPoint_Offset', function () {
beforeEach(async function (done) {
console.info("RelativeContainer_AnchorPoint_Offset beforeEach start");
let options = {
url: "MainAbility/pages/RelativeContainer/RelativeContainer_AnchorPoint/RelativeContainer_AnchorPoint_Offset",
}
try {
router.clear();
let pages = router.getState();
console.info("get RelativeContainer_AnchorPoint_Offset state pages:" + JSON.stringify(pages));
if (!("RelativeContainer_AnchorPoint_Offset" == pages.name)) {
console.info("get RelativeContainer_AnchorPoint_Offset pages.name:" + JSON.stringify(pages.name));
let result = await router.push(options);
await CommonFunc.sleep(2000);
console.info("push RelativeContainer_AnchorPoint_Offset page result:" + JSON.stringify(result));
}
} catch (err) {
console.error("push RelativeContainer_AnchorPoint_Offset page error " + JSON.stringify(err));
expect().assertFail();
}
done();
});
afterEach(async function () {
await CommonFunc.sleep(2000);
console.info("RelativeContainer_AnchorPoint_Offset after each called")
});
/**
* @tc.number SUB_ACE_RelativeContainer_AnchorPoint_Offset_TEST_0100
* @tc.name testRelativeContainer
* @tc.desc Set offset after alignment
*/
it('SUB_ACE_RelativeContainer_AnchorPoint_Offset_TEST_0100', 0, async function (done) {
console.info('[SUB_ACE_RelativeContainer_AnchorPoint_Offset_TEST_0100] START');
await CommonFunc.sleep(3000);
console.log('get Initial value')
let RelativeContainer_AnchorPoint_Offset_bt1 = CommonFunc.getComponentRect('RelativeContainer_AnchorPoint_Offset_bt1');
let RelativeContainer_AnchorPoint_Offset_tx2 = CommonFunc.getComponentRect('RelativeContainer_AnchorPoint_Offset_tx2');
let RelativeContainer_AnchorPoint_Offset_r1 = CommonFunc.getComponentRect('RelativeContainer_AnchorPoint_Offset_r1');
console.log('assert position')
expect(RelativeContainer_AnchorPoint_Offset_tx2.top).assertEqual(RelativeContainer_AnchorPoint_Offset_bt1.bottom);
expect(RelativeContainer_AnchorPoint_Offset_tx2.bottom).assertEqual(RelativeContainer_AnchorPoint_Offset_r1.bottom);
expect(RelativeContainer_AnchorPoint_Offset_tx2.right).assertEqual((RelativeContainer_AnchorPoint_Offset_bt1.right - RelativeContainer_AnchorPoint_Offset_bt1.left)/2 + RelativeContainer_AnchorPoint_Offset_bt1.left + vp2px(50));
console.info('[SUB_ACE_RelativeContainer_AnchorPoint_Offset_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 RelativeContainer_AnchorPoint_Padding() {
describe('RelativeContainer_AnchorPoint_Padding', function () {
beforeEach(async function (done) {
console.info("RelativeContainer_AnchorPoint_Padding beforeEach start");
let options = {
url: "MainAbility/pages/RelativeContainer/RelativeContainer_AnchorPoint/RelativeContainer_AnchorPoint_Padding",
}
try {
router.clear();
let pages = router.getState();
console.info("get RelativeContainer_AnchorPoint_Padding state pages:" + JSON.stringify(pages));
if (!("RelativeContainer_AnchorPoint_Padding" == pages.name)) {
console.info("get RelativeContainer_AnchorPoint_Padding pages.name:" + JSON.stringify(pages.name));
let result = await router.push(options);
await CommonFunc.sleep(2000);
console.info("push RelativeContainer_AnchorPoint_Padding page result:" + JSON.stringify(result));
}
} catch (err) {
console.error("push RelativeContainer_AnchorPoint_Padding page error " + JSON.stringify(err));
expect().assertFail();
}
done();
});
afterEach(async function () {
await CommonFunc.sleep(2000);
console.info("RelativeContainer_AnchorPoint_Padding after each called")
});
/**
* @tc.number SUB_ACE_RelativeContainer_AnchorPoint_Padding_TEST_0100
* @tc.name testRelativeContainer
* @tc.desc Parent component setting padding property
*/
it('SUB_ACE_RelativeContainer_AnchorPoint_Padding_TEST_0100', 0, async function (done) {
console.info('[SUB_ACE_RelativeContainer_AnchorPoint_Padding_TEST_0100] START');
await CommonFunc.sleep(3000);
console.log('get Initial value')
let RelativeContainer_AnchorPoint_Padding_bt1 = CommonFunc.getComponentRect('RelativeContainer_AnchorPoint_Padding_bt1');
let RelativeContainer_AnchorPoint_Padding_tx2 = CommonFunc.getComponentRect('RelativeContainer_AnchorPoint_Padding_tx2');
let RelativeContainer_AnchorPoint_Padding_r1 = CommonFunc.getComponentRect('RelativeContainer_AnchorPoint_Padding_r1');
let RelativeContainer_AnchorPoint_Padding_row1 = CommonFunc.getComponentRect('RelativeContainer_AnchorPoint_Padding_row1');
console.log('assert position')
expect(RelativeContainer_AnchorPoint_Padding_r1.left).assertEqual(RelativeContainer_AnchorPoint_Padding_row1.left + vp2px(100));
expect(RelativeContainer_AnchorPoint_Padding_tx2.top).assertEqual(RelativeContainer_AnchorPoint_Padding_bt1.bottom);
expect(RelativeContainer_AnchorPoint_Padding_tx2.bottom).assertEqual(RelativeContainer_AnchorPoint_Padding_r1.bottom);
expect(RelativeContainer_AnchorPoint_Padding_tx2.right).assertEqual((RelativeContainer_AnchorPoint_Padding_bt1.right - RelativeContainer_AnchorPoint_Padding_bt1.left)/2 + RelativeContainer_AnchorPoint_Padding_bt1.left);
console.info('[SUB_ACE_RelativeContainer_AnchorPoint_Padding_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 RelativeContainer_AnchorPoint_Position() {
describe('RelativeContainer_AnchorPoint_Position', function () {
beforeEach(async function (done) {
console.info("RelativeContainer_AnchorPoint_Position beforeEach start");
let options = {
url: "MainAbility/pages/RelativeContainer/RelativeContainer_AnchorPoint/RelativeContainer_AnchorPoint_Position",
}
try {
router.clear();
let pages = router.getState();
console.info("get RelativeContainer_AnchorPoint_Position state pages:" + JSON.stringify(pages));
if (!("RelativeContainer_AnchorPoint_Position" == pages.name)) {
console.info("get RelativeContainer_AnchorPoint_Position pages.name:" + JSON.stringify(pages.name));
let result = await router.push(options);
await CommonFunc.sleep(2000);
console.info("push RelativeContainer_AnchorPoint_Position page result:" + JSON.stringify(result));
}
} catch (err) {
console.error("push RelativeContainer_AnchorPoint_Position page error " + JSON.stringify(err));
expect().assertFail();
}
done();
});
afterEach(async function () {
await CommonFunc.sleep(2000);
console.info("RelativeContainer_AnchorPoint_Position after each called")
});
/**
* @tc.number SUB_ACE_RelativeContainer_AnchorPoint_Position_TEST_0100
* @tc.name testRelativeContainer
* @tc.desc Set position after alignment
*/
it('SUB_ACE_RelativeContainer_AnchorPoint_Position_TEST_0100', 0, async function (done) {
console.info('[SUB_ACE_RelativeContainer_AnchorPoint_Position_TEST_0100] START');
await CommonFunc.sleep(3000);
console.log('get Initial value')
let RelativeContainer_AnchorPoint_Position_bt1 = CommonFunc.getComponentRect('RelativeContainer_AnchorPoint_Position_bt1');
let RelativeContainer_AnchorPoint_Position_tx2 = CommonFunc.getComponentRect('RelativeContainer_AnchorPoint_Position_tx2');
let RelativeContainer_AnchorPoint_Position_r1 = CommonFunc.getComponentRect('RelativeContainer_AnchorPoint_Position_r1');
console.log('assert position')
expect(RelativeContainer_AnchorPoint_Position_tx2.top).assertEqual(RelativeContainer_AnchorPoint_Position_bt1.bottom );
expect(RelativeContainer_AnchorPoint_Position_tx2.left).assertEqual(RelativeContainer_AnchorPoint_Position_r1.left );
expect(RelativeContainer_AnchorPoint_Position_tx2.right).assertEqual((RelativeContainer_AnchorPoint_Position_bt1.right - RelativeContainer_AnchorPoint_Position_bt1.left)/2 + RelativeContainer_AnchorPoint_Position_bt1.left);
console.info('[SUB_ACE_RelativeContainer_AnchorPoint_Position_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 RelativeContainer_AnchorPoint_ThreeDirection() {
describe('RelativeContainer_AnchorPoint_ThreeDirection', function () {
beforeEach(async function (done) {
console.info("RelativeContainer_AnchorPoint_ThreeDirection beforeEach start");
let options = {
url: "MainAbility/pages/RelativeContainer/RelativeContainer_AnchorPoint/RelativeContainer_AnchorPoint_ThreeDirection",
}
try {
router.clear();
let pages = router.getState();
console.info("get RelativeContainer_AnchorPoint_ThreeDirection state pages:" + JSON.stringify(pages));
if (!("RelativeContainer_AnchorPoint_ThreeDirection" == pages.name)) {
console.info("get RelativeContainer_AnchorPoint_ThreeDirection pages.name:" + JSON.stringify(pages.name));
let result = await router.push(options);
await CommonFunc.sleep(2000);
console.info("push RelativeContainer_AnchorPoint_ThreeDirection page result:" + JSON.stringify(result));
}
} catch (err) {
console.error("push RelativeContainer_AnchorPoint_ThreeDirection page error " + JSON.stringify(err));
expect().assertFail();
}
done();
});
afterEach(async function () {
await CommonFunc.sleep(2000);
console.info("RelativeContainer_AnchorPoint_ThreeDirection after each called")
});
/**
* @tc.number SUB_ACE_RelativeContainer_AnchorPoint_ThreeDirection_TEST_0100
* @tc.name testRelativeContainer
* @tc.desc row set two directions anchor piont
*/
it('SUB_ACE_RelativeContainer_AnchorPoint_ThreeDirection_TEST_0100', 0, async function (done) {
console.info('[SUB_ACE_RelativeContainer_AnchorPoint_ThreeDirection_TEST_0100] START');
await CommonFunc.sleep(3000);
console.log('get Initial value')
let RelativeContainer_AnchorPoint_ThreeDirection_bt1 = CommonFunc.getComponentRect('RelativeContainer_AnchorPoint_ThreeDirection_bt1');
let RelativeContainer_AnchorPoint_ThreeDirection_tx2 = CommonFunc.getComponentRect('RelativeContainer_AnchorPoint_ThreeDirection_tx2');
let RelativeContainer_AnchorPoint_ThreeDirection_r1 = CommonFunc.getComponentRect('RelativeContainer_AnchorPoint_ThreeDirection_r1');
console.log('assert position')
expect(RelativeContainer_AnchorPoint_ThreeDirection_tx2.top).assertEqual(RelativeContainer_AnchorPoint_ThreeDirection_r1.top);
expect(RelativeContainer_AnchorPoint_ThreeDirection_tx2.bottom).assertEqual(RelativeContainer_AnchorPoint_ThreeDirection_r1.bottom);
expect(RelativeContainer_AnchorPoint_ThreeDirection_tx2.right).assertEqual((RelativeContainer_AnchorPoint_ThreeDirection_bt1.right - RelativeContainer_AnchorPoint_ThreeDirection_bt1.left)/2 + RelativeContainer_AnchorPoint_ThreeDirection_bt1.left);
console.info('[SUB_ACE_RelativeContainer_AnchorPoint_ThreeDirection_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 RelativeContainer_AnchorPoint_TwoDirection() {
describe('RelativeContainer_AnchorPoint_TwoDirection', function () {
beforeEach(async function (done) {
console.info("RelativeContainer_AnchorPoint_TwoDirection beforeEach start");
let options = {
url: "MainAbility/pages/RelativeContainer/RelativeContainer_AnchorPoint/RelativeContainer_AnchorPoint_TwoDirection",
}
try {
router.clear();
let pages = router.getState();
console.info("get RelativeContainer_AnchorPoint_TwoDirection state pages:" + JSON.stringify(pages));
if (!("RelativeContainer_AnchorPoint_TwoDirection" == pages.name)) {
console.info("get RelativeContainer_AnchorPoint_TwoDirection pages.name:" + JSON.stringify(pages.name));
let result = await router.push(options);
await CommonFunc.sleep(2000);
console.info("push RelativeContainer_AnchorPoint_TwoDirection page result:" + JSON.stringify(result));
}
} catch (err) {
console.error("push RelativeContainer_AnchorPoint_TwoDirection page error " + JSON.stringify(err));
expect().assertFail();
}
done();
});
afterEach(async function () {
await CommonFunc.sleep(2000);
console.info("RelativeContainer_AnchorPoint_TwoDirection after each called")
});
/**
* @tc.number SUB_ACE_RelativeContainer_AnchorPoint_TwoDirection_TEST_0100
* @tc.name testRelativeContainer
* @tc.desc row set two directions anchor piont
*/
it('SUB_ACE_RelativeContainer_AnchorPoint_TwoDirection_TEST_0100', 0, async function (done) {
console.info('[SUB_ACE_RelativeContainer_AnchorPoint_TwoDirection_TEST_0100] START');
await CommonFunc.sleep(3000);
console.log('get Initial value')
let RelativeContainer_AnchorPoint_TwoDirection_row1 = CommonFunc.getComponentRect('RelativeContainer_AnchorPoint_TwoDirection_row1');
let RelativeContainer_AnchorPoint_TwoDirection_r1 = CommonFunc.getComponentRect('RelativeContainer_AnchorPoint_TwoDirection_r1');
console.log('assert position')
expect(RelativeContainer_AnchorPoint_TwoDirection_row1.top).assertEqual(RelativeContainer_AnchorPoint_TwoDirection_r1.top);
expect(RelativeContainer_AnchorPoint_TwoDirection_row1.bottom).assertEqual(RelativeContainer_AnchorPoint_TwoDirection_r1.bottom);
expect(RelativeContainer_AnchorPoint_TwoDirection_row1.left).assertEqual(RelativeContainer_AnchorPoint_TwoDirection_r1.left);
expect(RelativeContainer_AnchorPoint_TwoDirection_row1.right).assertEqual(RelativeContainer_AnchorPoint_TwoDirection_r1.right);
console.info('[SUB_ACE_RelativeContainer_AnchorPoint_TwoDirection_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 RelativeContainer_AnchorPoint_Visibility_Hidden() {
describe('RelativeContainer_AnchorPoint_Visibility_Hidden', function () {
beforeEach(async function (done) {
console.info("RelativeContainer_AnchorPoint_Visibility_Hidden beforeEach start");
let options = {
url: "MainAbility/pages/RelativeContainer/RelativeContainer_AnchorPoint/RelativeContainer_AnchorPoint_Visibility_Hidden",
}
try {
router.clear();
let pages = router.getState();
console.info("get RelativeContainer_AnchorPoint_Visibility_Hidden state pages:" + JSON.stringify(pages));
if (!("RelativeContainer_AnchorPoint_Visibility_Hidden" == pages.name)) {
console.info("get RelativeContainer_AnchorPoint_Visibility_Hidden pages.name:" + JSON.stringify(pages.name));
let result = await router.push(options);
await CommonFunc.sleep(2000);
console.info("push RelativeContainer_AnchorPoint_Visibility_Hidden page result:" + JSON.stringify(result));
}
} catch (err) {
console.error("push RelativeContainer_AnchorPoint_Visibility_Hidden page error " + JSON.stringify(err));
expect().assertFail();
}
done();
});
afterEach(async function () {
await CommonFunc.sleep(2000);
console.info("RelativeContainer_AnchorPoint_Visibility_Hidden after each called")
});
/**
* @tc.number SUB_ACE_RelativeContainer_AnchorPoint_Visibility_Hidden_TEST_0100
* @tc.name testRelativeContainer
* @tc.desc Set visibility.none for btn1
*/
it('SUB_ACE_RelativeContainer_AnchorPoint_Visibility_Hidden_TEST_0100', 0, async function (done) {
console.info('[SUB_ACE_RelativeContainer_AnchorPoint_Visibility_Hidden_TEST_0100] START');
await CommonFunc.sleep(3000);
console.log('get Initial value')
let RelativeContainer_AnchorPoint_Visibility_Hidden_bt1 = CommonFunc.getComponentRect('RelativeContainer_AnchorPoint_Visibility_Hidden_bt1');
let RelativeContainer_AnchorPoint_Visibility_Hidden_bt2 = CommonFunc.getComponentRect('RelativeContainer_AnchorPoint_Visibility_Hidden_bt2');
let RelativeContainer_AnchorPoint_Visibility_Hidden_tx2 = CommonFunc.getComponentRect('RelativeContainer_AnchorPoint_Visibility_Hidden_tx2');
let RelativeContainer_AnchorPoint_Visibility_Hidden_r1 = CommonFunc.getComponentRect('RelativeContainer_AnchorPoint_Visibility_Hidden_r1');
console.log('assert position')
expect(RelativeContainer_AnchorPoint_Visibility_Hidden_bt1.top).assertEqual(RelativeContainer_AnchorPoint_Visibility_Hidden_r1.top );
expect(RelativeContainer_AnchorPoint_Visibility_Hidden_bt2.right).assertEqual(RelativeContainer_AnchorPoint_Visibility_Hidden_r1.right );
expect(RelativeContainer_AnchorPoint_Visibility_Hidden_tx2.top).assertEqual(RelativeContainer_AnchorPoint_Visibility_Hidden_bt1.bottom );
expect(RelativeContainer_AnchorPoint_Visibility_Hidden_tx2.bottom).assertEqual(RelativeContainer_AnchorPoint_Visibility_Hidden_r1.bottom );
expect(RelativeContainer_AnchorPoint_Visibility_Hidden_tx2.right).assertEqual((RelativeContainer_AnchorPoint_Visibility_Hidden_bt1.right - RelativeContainer_AnchorPoint_Visibility_Hidden_bt1.left)/2 + RelativeContainer_AnchorPoint_Visibility_Hidden_bt1.left);
console.info('[SUB_ACE_RelativeContainer_AnchorPoint_Visibility_Hidden_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 RelativeContainer_AnchorPoint_Visibility_None() {
describe('RelativeContainer_AnchorPoint_Visibility_None', function () {
beforeEach(async function (done) {
console.info("RelativeContainer_AnchorPoint_Visibility_None beforeEach start");
let options = {
url: "MainAbility/pages/RelativeContainer/RelativeContainer_AnchorPoint/RelativeContainer_AnchorPoint_Visibility_None",
}
try {
router.clear();
let pages = router.getState();
console.info("get RelativeContainer_AnchorPoint_Visibility_None state pages:" + JSON.stringify(pages));
if (!("RelativeContainer_AnchorPoint_Visibility_None" == pages.name)) {
console.info("get RelativeContainer_AnchorPoint_Visibility_None pages.name:" + JSON.stringify(pages.name));
let result = await router.push(options);
await CommonFunc.sleep(2000);
console.info("push RelativeContainer_AnchorPoint_Visibility_None page result:" + JSON.stringify(result));
}
} catch (err) {
console.error("push RelativeContainer_AnchorPoint_Visibility_None page error " + JSON.stringify(err));
expect().assertFail();
}
done();
});
afterEach(async function () {
await CommonFunc.sleep(2000);
console.info("RelativeContainer_AnchorPoint_Visibility_None after each called")
});
/**
* @tc.number SUB_ACE_RelativeContainer_AnchorPoint_Visibility_None_TEST_0100
* @tc.name testRelativeContainer
* @tc.desc Set visibility.none for btn1
*/
it('SUB_ACE_RelativeContainer_AnchorPoint_Visibility_None_TEST_0100', 0, async function (done) {
console.info('[SUB_ACE_RelativeContainer_AnchorPoint_Visibility_None_TEST_0100] START');
await CommonFunc.sleep(3000);
console.log('get Initial value')
console.log('get RelativeContainer_AnchorPoint_Visibility_None_bt2 value')
let RelativeContainer_AnchorPoint_Visibility_None_bt2 = CommonFunc.getComponentRect('RelativeContainer_AnchorPoint_Visibility_None_bt2');
console.log('get RelativeContainer_AnchorPoint_Visibility_None_tx2 value')
// let RelativeContainer_AnchorPoint_Visibility_None_tx2 = CommonFunc.getComponentRect('RelativeContainer_AnchorPoint_Visibility_None_tx2');
let RelativeContainer_AnchorPoint_Visibility_None_r1 = CommonFunc.getComponentRect('RelativeContainer_AnchorPoint_Visibility_None_r1');
console.log('assert position')
expect(RelativeContainer_AnchorPoint_Visibility_None_bt2.right).assertEqual(RelativeContainer_AnchorPoint_Visibility_None_r1.right);
console.info('[SUB_ACE_RelativeContainer_AnchorPoint_Visibility_None_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 RelativeContainer_Level() {
describe('RelativeContainer_Level', function () {
beforeEach(async function (done) {
console.info("RelativeContainer_Level beforeEach start");
let options = {
url: "MainAbility/pages/RelativeContainer/RelativeContainer_Level/RelativeContainer_Level",
}
try {
router.clear();
let pages = router.getState();
console.info("get RelativeContainer_Level state pages:" + JSON.stringify(pages));
if (!("RelativeContainer_Level" == pages.name)) {
console.info("get RelativeContainer_Level pages.name:" + JSON.stringify(pages.name));
let result = await router.push(options);
await CommonFunc.sleep(2000);
console.info("push RelativeContainer_Level page result:" + JSON.stringify(result));
}
} catch (err) {
console.error("push RelativeContainer_Level page error " + JSON.stringify(err));
expect().assertFail();
}
done();
});
afterEach(async function () {
await CommonFunc.sleep(2000);
console.info("RelativeContainer_Level after each called")
});
/**
* @tc.number SUB_ACE_RelativeContainer_Level_TEST_0100
* @tc.name testRelativeContainer
* @tc.desc text set align:HorizontalAlign.Start
*/
it('SUB_ACE_RelativeContainer_Level_TEST_0100', 0, async function (done) {
console.info('[SUB_ACE_RelativeContainer_Level_TEST_0100] START');
globalThis.value.message.notify({name:'addalign', value:HorizontalAlign.Start});
await CommonFunc.sleep(3000);
console.log('get Initial value')
let RelativeContainer_Level_bt1 = CommonFunc.getComponentRect('RelativeContainer_Level_bt1');
let RelativeContainer_Level_tx2 = CommonFunc.getComponentRect('RelativeContainer_Level_tx2');
console.log('assert position')
expect(RelativeContainer_Level_tx2.top).assertEqual(RelativeContainer_Level_bt1.bottom);
expect(RelativeContainer_Level_tx2.right).assertEqual(RelativeContainer_Level_bt1.left);
console.info('[SUB_ACE_RelativeContainer_Level_TEST_0100] END');
done();
});
/**
* @tc.number SUB_ACE_RelativeContainer_Level_TEST_0200
* @tc.name testRelativeContainer
* @tc.desc text set align:HorizontalAlign.Center
*/
it('SUB_ACE_RelativeContainer_Level_TEST_0200', 0, async function (done) {
console.info('[SUB_ACE_RelativeContainer_Level_TEST_0200] START');
globalThis.value.message.notify({name:'addalign', value:HorizontalAlign.Center});
await CommonFunc.sleep(3000);
console.log('get Initial value')
let RelativeContainer_Level_bt1 = CommonFunc.getComponentRect('RelativeContainer_Level_bt1');
let RelativeContainer_Level_tx2 = CommonFunc.getComponentRect('RelativeContainer_Level_tx2');
console.log('assert position')
expect(RelativeContainer_Level_tx2.top).assertEqual(RelativeContainer_Level_bt1.bottom);
expect(RelativeContainer_Level_tx2.right).assertEqual((RelativeContainer_Level_bt1.right - RelativeContainer_Level_bt1.left)/2 + RelativeContainer_Level_bt1.left);
console.info('[SUB_ACE_RelativeContainer_Level_TEST_0200] END');
done();
});
/**
* @tc.number SUB_ACE_RelativeContainer_Level_TEST_0300
* @tc.name testRelativeContainer
* @tc.desc text set align:HorizontalAlign.End
*/
it('SUB_ACE_RelativeContainer_Level_TEST_0300', 0, async function (done) {
console.info('[SUB_ACE_RelativeContainer_Level_TEST_0300] START');
globalThis.value.message.notify({name:'addalign', value:HorizontalAlign.End});
await CommonFunc.sleep(3000);
console.log('get Initial value')
let RelativeContainer_Level_bt1 = CommonFunc.getComponentRect('RelativeContainer_Level_bt1');
let RelativeContainer_Level_tx2 = CommonFunc.getComponentRect('RelativeContainer_Level_tx2');
console.log('assert position')
expect(RelativeContainer_Level_tx2.top).assertEqual(RelativeContainer_Level_bt1.bottom);
expect(RelativeContainer_Level_tx2.right).assertEqual(RelativeContainer_Level_bt1.right);
console.info('[SUB_ACE_RelativeContainer_Level_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 RelativeContainer_Vertical() {
describe('RelativeContainer_Vertical', function () {
beforeEach(async function (done) {
console.info("RelativeContainer_Vertical beforeEach start");
let options = {
url: "MainAbility/pages/RelativeContainer/RelativeContainer_Vertical/RelativeContainer_Vertical",
}
try {
router.clear();
let pages = router.getState();
console.info("get RelativeContainer_Vertical state pages:" + JSON.stringify(pages));
if (!("RelativeContainer_Vertical" == pages.name)) {
console.info("get RelativeContainer_Vertical pages.name:" + JSON.stringify(pages.name));
let result = await router.push(options);
await CommonFunc.sleep(2000);
console.info("push RelativeContainer_Vertical page result:" + JSON.stringify(result));
}
} catch (err) {
console.error("push RelativeContainer_Vertical page error " + JSON.stringify(err));
expect().assertFail();
}
done();
});
afterEach(async function () {
await CommonFunc.sleep(2000);
console.info("RelativeContainer_Vertical after each called")
});
/**
* @tc.number SUB_ACE_RelativeContainer_Vertical_TEST_0100
* @tc.name testRelativeContainer
* @tc.desc text set align:VerticalAlign.Top
*/
it('SUB_ACE_RelativeContainer_Vertical_TEST_0100', 0, async function (done) {
console.info('[SUB_ACE_RelativeContainer_Vertical_TEST_0100] START');
globalThis.value.message.notify({name:'addalign', value:VerticalAlign.Top});
await CommonFunc.sleep(3000);
console.log('get Initial value')
let RelativeContainer_Vertical_bt1 = CommonFunc.getComponentRect('RelativeContainer_Vertical_bt1');
let RelativeContainer_Vertical_tx2 = CommonFunc.getComponentRect('RelativeContainer_Vertical_tx2');
console.log('assert position')
expect(RelativeContainer_Vertical_tx2.top).assertEqual(RelativeContainer_Vertical_bt1.top);
expect(RelativeContainer_Vertical_tx2.left).assertEqual(RelativeContainer_Vertical_bt1.right);
console.info('[SUB_ACE_RelativeContainer_Vertical_TEST_0100] END');
done();
});
/**
* @tc.number SUB_ACE_RelativeContainer_Vertical_TEST_0200
* @tc.name testRelativeContainer
* @tc.desc text set align:VerticalAlign.Center
*/
it('SUB_ACE_RelativeContainer_Vertical_TEST_0200', 0, async function (done) {
console.info('[SUB_ACE_RelativeContainer_Vertical_TEST_0200] START');
globalThis.value.message.notify({name:'addalign', value:VerticalAlign.Center});
await CommonFunc.sleep(3000);
console.log('get Initial value')
let RelativeContainer_Vertical_bt1 = CommonFunc.getComponentRect('RelativeContainer_Vertical_bt1');
let RelativeContainer_Vertical_tx2 = CommonFunc.getComponentRect('RelativeContainer_Vertical_tx2');
console.log('assert position')
expect(RelativeContainer_Vertical_tx2.top).assertEqual((RelativeContainer_Vertical_bt1.bottom - RelativeContainer_Vertical_bt1.top)/2 + RelativeContainer_Vertical_bt1.top);
expect(RelativeContainer_Vertical_tx2.left).assertEqual(RelativeContainer_Vertical_bt1.right);
console.info('[SUB_ACE_RelativeContainer_Vertical_TEST_0200] END');
done();
});
/**
* @tc.number SUB_ACE_RelativeContainer_Vertical_TEST_0300
* @tc.name testRelativeContainer
* @tc.desc text set align:VerticalAlign.Bottom
*/
it('SUB_ACE_RelativeContainer_Vertical_TEST_0300', 0, async function (done) {
console.info('[SUB_ACE_RelativeContainer_Vertical_TEST_0300] START');
globalThis.value.message.notify({name:'addalign', value:VerticalAlign.Bottom});
await CommonFunc.sleep(3000);
console.log('get Initial value')
let RelativeContainer_Vertical_bt1 = CommonFunc.getComponentRect('RelativeContainer_Vertical_bt1');
let RelativeContainer_Vertical_tx2 = CommonFunc.getComponentRect('RelativeContainer_Vertical_tx2');
console.log('assert position')
expect(RelativeContainer_Vertical_tx2.top).assertEqual(RelativeContainer_Vertical_bt1.bottom);
expect(RelativeContainer_Vertical_tx2.left).assertEqual(RelativeContainer_Vertical_bt1.right);
console.info('[SUB_ACE_RelativeContainer_Vertical_TEST_0300] END');
done();
});
})
}
\ No newline at end of file
......@@ -80,6 +80,23 @@
"MainAbility/pages/Swiper/Swiper_ItemChange/swiperItemMargin",
"MainAbility/pages/Swiper/Swiper_ItemChange/swiperItemVisibility",
"MainAbility/pages/RelativeContainer/RelativeContainer_Level/RelativeContainer_Level",
"MainAbility/pages/RelativeContainer/RelativeContainer_Vertical/RelativeContainer_Vertical",
"MainAbility/pages/RelativeContainer/RelativeContainer_AnchorPoint/RelativeContainer_AnchorPoint_Absent",
"MainAbility/pages/RelativeContainer/RelativeContainer_AnchorPoint/RelativeContainer_AnchorPoint_Circular_Dependency",
"MainAbility/pages/RelativeContainer/RelativeContainer_AnchorPoint/RelativeContainer_AnchorPoint_Interdependence",
"MainAbility/pages/RelativeContainer/RelativeContainer_AnchorPoint/RelativeContainer_AnchorPoint_Margin",
"MainAbility/pages/RelativeContainer/RelativeContainer_AnchorPoint/RelativeContainer_AnchorPoint_Padding",
"MainAbility/pages/RelativeContainer/RelativeContainer_AnchorPoint/RelativeContainer_AnchorPoint_ThreeDirection",
"MainAbility/pages/RelativeContainer/RelativeContainer_AnchorPoint/RelativeContainer_AnchorPoint_TwoDirection",
"MainAbility/pages/RelativeContainer/RelativeContainer_AnchorPoint/RelativeContainer_AnchorPoint_Visibility_Hidden",
"MainAbility/pages/RelativeContainer/RelativeContainer_AnchorPoint/RelativeContainer_AnchorPoint_Visibility_None",
"MainAbility/pages/RelativeContainer/RelativeContainer_AnchorPoint/RelativeContainer_AnchorPoint_NoId",
"MainAbility/pages/RelativeContainer/RelativeContainer_AnchorPoint/RelativeContainer_AnchorPoint_Id_Null",
"MainAbility/pages/RelativeContainer/RelativeContainer_AnchorPoint/RelativeContainer_AnchorPoint_Id_Undefined",
"MainAbility/pages/RelativeContainer/RelativeContainer_AnchorPoint/RelativeContainer_AnchorPoint_Offset",
"MainAbility/pages/RelativeContainer/RelativeContainer_AnchorPoint/RelativeContainer_AnchorPoint_Position",
"MainAbility/pages/Row/spaceChanged/Row_Space",
"MainAbility/pages/Row/spaceChanged/Row_Space_String",
"MainAbility/pages/Row/spaceChanged/Row_Space_Default",
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册