| <?xml version="1.0" encoding="utf-8"?> |
| <!-- |
| |
| Licensed to the Apache Software Foundation (ASF) under one or more |
| contributor license agreements. See the NOTICE file distributed with |
| this work for additional information regarding copyright ownership. |
| The ASF licenses this file to You 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. |
| |
| --> |
| <UnitTester testDir="containers/Panel/Properties/" xmlns:mx="http://www.adobe.com/2006/mxml" xmlns="*" testSWF="ConstraintBasedLayout_Panel.mxml"> |
| <mx:Script> |
| <![CDATA[ |
| |
| import comps.PercentageRowColumnPanelComp; |
| import comps.ContentRowColumnPanelComp; |
| import mx.containers.utilityClasses.ConstraintColumn; |
| import mx.containers.utilityClasses.ConstraintRow; |
| import mx.containers.Panel; |
| import mx.controls.Button; |
| public static function init(o:DisplayObject):void |
| { |
| } |
| |
| |
| ]]> |
| </mx:Script> |
| <mx:Metadata> |
| <![CDATA[ |
| [Mixin] |
| ]]> |
| </mx:Metadata> |
| |
| <testCases> |
| |
| <!-- Tests for ConstraintColumns with width as percentages --> |
| <TestCase testID="constraintColumns_percentage_mxml" keywords="[constraintColumns, constraintRows, MXML]" |
| description="Verify the constraintColumns and constraintRows work correctly when their width/height is a percentage set in mxml"> |
| <body> |
| <AssertPropertyValue target="panel1.getChildAt(0)" propertyName="width" value="254" /> |
| <AssertPropertyValue target="panel1.getChildAt(0)" propertyName="x" value="10" /> |
| <AssertPropertyValue target="panel1.getChildAt(1)" propertyName="height" value="157" /> |
| <AssertPropertyValue target="panel1.getChildAt(1)" propertyName="y" value="10" /> |
| <AssertPropertyValue target="panel1.getChildAt(2)" propertyName="width" value="264" /> |
| <AssertPropertyValue target="panel1.getChildAt(2)" propertyName="height" value="142" /> |
| <AssertPropertyValue target="panel1.getChildAt(2)" propertyName="y" value="20" /> |
| <AssertPropertyValue target="panel1.getChildAt(2)" propertyName="x" value="20" /> |
| </body> |
| </TestCase> |
| <TestCase testID="constraintColumns_percentage_changeAtRuntime" keywords="[percentage sized, Panel, constraintColumn]" |
| description="ConstraintColumns with percentage width set at runtime"> |
| <setup> |
| <ResetComponent target="panel1" className="comps.PercentageRowColumnPanelComp" waitTarget="panel1" waitEvent="updateComplete" /> |
| </setup> |
| <body> |
| <SetProperty target="panel1.constraintColumns.0" propertyName="percentWidth" value="40" waitEvent="updateComplete" waitTarget="panel1"/> |
| <AssertPropertyValue target="panel1.getChildAt(0)" propertyName="width" value="292" /> |
| <AssertPropertyValue target="panel1.getChildAt(0)" propertyName="x" value="10" /> |
| </body> |
| </TestCase> |
| <TestCase testID="constraintColumns_percentage_changeCol2AtRuntime" keywords="[percentage sized, Panel, constraintColumn]" |
| description="ConstraintColumns 2 with percentage width set at runtime"> |
| <setup> |
| <ResetComponent target="panel1" className="comps.PercentageRowColumnPanelComp" waitTarget="panel1" waitEvent="updateComplete" /> |
| </setup> |
| <body> |
| <SetProperty target="panel1.constraintColumns.0" propertyName="percentWidth" value="40" waitEvent="updateComplete" waitTarget="panel1"/> |
| <AssertPropertyValue target="panel1.getChildAt(0)" propertyName="width" value="292" /> |
| <AssertPropertyValue target="panel1.getChildAt(0)" propertyName="x" value="10" /> |
| </body> |
| </TestCase> |
| <TestCase testID="constraintColumns_percentage_mxml_resizePanel" keywords="[Button, percentage sized, Panel, constraintColumn]" |
| description="ConstraintColumns with percentage width and then resize Panel"> |
| <setup> |
| <ResetComponent target="panel1" className="comps.PercentageRowColumnPanelComp" waitTarget="panel1" waitEvent="updateComplete" /> |
| </setup> |
| <body> |
| <SetProperty target="panel1" propertyName="width" value="500" waitEvent="updateComplete" waitTarget="panel1"/> |
| <AssertPropertyValue target="panel1.getChildAt(0)" propertyName="width" value="334" /> |
| <AssertPropertyValue target="panel1.getChildAt(0)" propertyName="x" value="10" /> |
| </body> |
| </TestCase> |
| |
| <TestCase testID="constraintRows_percentage_mxml_resizePanel" keywords="[Button, percentage sized, Panel, constraintRow]" |
| description="ConstraintRows with percentage height and then resize Panel"> |
| <setup> |
| <ResetComponent target="panel1" className="comps.PercentageRowColumnPanelComp" waitTarget="panel1" waitEvent="updateComplete" /> |
| </setup> |
| <body> |
| <SetProperty target="panel1" propertyName="height" value="500" waitEvent="updateComplete" waitTarget="panel1"/> |
| <AssertPropertyValue target="panel1.getChildAt(1)" propertyName="height" value="297" /> |
| <AssertPropertyValue target="panel1.getChildAt(1)" propertyName="y" value="10" /> |
| </body> |
| </TestCase> |
| |
| <TestCase testID="constraintRows_percentage_changeAtRuntime" keywords="[Button, percentage sized, Panel, constraintRow]" |
| description="ConstraintRows with percentage height set at runtime"> |
| <setup> |
| <ResetComponent target="panel1" className="comps.PercentageRowColumnPanelComp" waitTarget="panel1" waitEvent="updateComplete" /> |
| </setup> |
| <body> |
| <SetProperty target="panel1.constraintRows.0" propertyName="percentHeight" value="50" waitEvent="updateComplete" waitTarget="panel1"/> |
| <AssertPropertyValue target="panel1.getChildAt(1)" propertyName="height" value="222" /> |
| <AssertPropertyValue target="panel1.getChildAt(1)" propertyName="y" value="10" /> |
| </body> |
| </TestCase> |
| |
| <TestCase testID="constraintRows_percentage_changeRow2AtRuntime" keywords="[Button, percentage sized, Panel, constraintRow]" |
| description="ConstraintRows with percentage height set at runtime"> |
| <setup> |
| <ResetComponent target="panel1" className="comps.PercentageRowColumnPanelComp" waitTarget="panel1" waitEvent="updateComplete" /> |
| </setup> |
| <body> |
| <SetProperty target="panel1.getChildAt(1)" propertyName="minHeight" value="100" /> |
| <SetProperty target="panel1.constraintRows.1" propertyName="percentHeight" value="30" waitEvent="updateComplete" waitTarget="panel1"/> |
| <AssertPropertyValue target="panel1.getChildAt(1)" propertyName="height" value="118" /> |
| <AssertPropertyValue target="panel1.getChildAt(1)" propertyName="y" value="10" /> |
| </body> |
| </TestCase> |
| |
| <TestCase testID="constraintRowsColumns_percentage_mxml_resizePanel" keywords="[Button, percentage sized, Panel, constraintRow]" |
| description="ConstraintRows and ConstraintColumns with percentage height and width and then resize Panel"> |
| <setup> |
| <ResetComponent target="panel1" className="comps.PercentageRowColumnPanelComp" waitTarget="panel1" waitEvent="updateComplete" /> |
| </setup> |
| <body> |
| <SetProperty target="panel1" propertyName="height" value="500" /> |
| <SetProperty target="panel1" propertyName="width" value="500" waitEvent="updateComplete" waitTarget="panel1"/> |
| <Pause timeout="3000" /> |
| <AssertPropertyValue target="panel1.getChildAt(2)" propertyName="height" value="282" /> |
| <AssertPropertyValue target="panel1.getChildAt(2)" propertyName="y" value="20" /> |
| <AssertPropertyValue target="panel1.getChildAt(2)" propertyName="width" value="344" /> |
| <AssertPropertyValue target="panel1.getChildAt(2)" propertyName="x" value="20" /> |
| </body> |
| </TestCase> |
| |
| <TestCase testID="constraintRowsColumns_percentage_changeAtRuntime" keywords="[percentage sized, Panel, constraintRow]" |
| description="ConstraintRows and ConstraintColumns with percentage height and width set at runtime"> |
| <setup> |
| <ResetComponent target="panel1" className="comps.PercentageRowColumnPanelComp" waitTarget="panel1" waitEvent="updateComplete" /> |
| </setup> |
| <body> |
| <SetProperty target="panel1.constraintColumns.0" propertyName="percentWidth" value="35" waitEvent="updateComplete" waitTarget="panel1"/> |
| <SetProperty target="panel1.constraintRows.1" propertyName="percentHeight" value="40" waitEvent="updateComplete" waitTarget="panel1"/> |
| <AssertPropertyValue target="panel1.getChildAt(2)" propertyName="height" value="129" /> |
| <AssertPropertyValue target="panel1.getChildAt(2)" propertyName="y" value="20" /> |
| <AssertPropertyValue target="panel1.getChildAt(2)" propertyName="width" value="283" /> |
| <AssertPropertyValue target="panel1.getChildAt(2)" propertyName="x" value="20" /> |
| </body> |
| </TestCase> |
| |
| <TestCase testID="constraintColumns_percentage_mxml_changeleftright" keywords="[Button, percentage sized, Panel, constraintColumn]" |
| description="change left value on a component constrained by percentage-constraintColumns"> |
| <setup> |
| <ResetComponent target="panel1" className="comps.PercentageRowColumnPanelComp" waitTarget="panel1" waitEvent="updateComplete" /> |
| </setup> |
| <body> |
| <SetStyle target="panel1.getChildAt(0)" styleName="left" value="col1:30" waitEvent="updateComplete" waitTarget="panel1.getChildAt(0)"/> |
| <AssertPropertyValue target="panel1.getChildAt(0)" propertyName="width" value="234" /> |
| <AssertPropertyValue target="panel1.getChildAt(0)" propertyName="x" value="30" /> |
| </body> |
| </TestCase> |
| |
| <TestCase testID="constraintRows_percentage_mxml_changetopbottom" keywords="[Button, percentage sized, Panel, constraintRow]" |
| description="change top value on a component constrained by percentage-constraintRows"> |
| <setup> |
| <ResetComponent target="panel1" className="comps.PercentageRowColumnPanelComp" waitTarget="panel1" waitEvent="updateComplete" /> |
| </setup> |
| <body> |
| <SetProperty target="panel1.getChildAt(1)" propertyName="minHeight" value="100" /> |
| <SetStyle target="panel1.getChildAt(1)" styleName="top" value="row1:45" waitEvent="updateComplete" waitTarget="panel1.getChildAt(1)"/> |
| <AssertPropertyValue target="panel1.getChildAt(1)" propertyName="height" value="122" /> |
| <AssertPropertyValue target="panel1.getChildAt(1)" propertyName="y" value="45" /> |
| </body> |
| </TestCase> |
| |
| <TestCase testID="constraintColumnspercentage_rightPanel" keywords="[Button, percentage sized, Panel, constraintColumn]" |
| description="change right value on a component constrained by percentage-constraintColumns and the Panel"> |
| <setup> |
| <ResetComponent target="panel1" className="comps.PercentageRowColumnPanelComp" waitTarget="panel1" waitEvent="updateComplete" /> |
| </setup> |
| <body> |
| <SetStyle target="panel1.getChildAt(0)" styleName="right" value="25" waitEvent="updateComplete" waitTarget="panel1.getChildAt(0)"/> |
| <AssertPropertyValue target="panel1.getChildAt(0)" propertyName="width" value="345" /> |
| <AssertPropertyValue target="panel1.getChildAt(0)" propertyName="x" value="10" /> |
| </body> |
| </TestCase> |
| |
| <TestCase testID="constraintColumnspercentage_rightPanel_changePanel" keywords="[Button, percentage sized, Panel, constraintColumn]" |
| description="change right value on a component constrained by percentage-constraintColumns and the Panel. Edit the Panel size at runtime."> |
| <setup> |
| <ResetComponent target="panel1" className="comps.PercentageRowColumnPanelComp" waitTarget="panel1" waitEvent="updateComplete" /> |
| </setup> |
| <body> |
| <SetProperty target="panel1" propertyName="width" value="500" waitEvent="updateComplete" waitTarget="panel1"/> |
| <SetStyle target="panel1.getChildAt(0)" styleName="right" value="25" waitEvent="updateComplete" waitTarget="panel1.getChildAt(0)"/> |
| <AssertPropertyValue target="panel1.getChildAt(0)" propertyName="width" value="445" /> |
| <AssertPropertyValue target="panel1.getChildAt(0)" propertyName="x" value="10" /> |
| </body> |
| </TestCase> |
| |
| <TestCase testID="constraintRowspercentage_bottomPanel" keywords="[Button, percentage sized, Panel, constraintRow]" |
| description="change bottom value on a component constrained by percentage-constraintRows and the Panel"> |
| <setup> |
| <ResetComponent target="panel1" className="comps.PercentageRowColumnPanelComp" waitTarget="panel1" waitEvent="updateComplete" /> |
| </setup> |
| <body> |
| <SetStyle target="panel1.getChildAt(1)" styleName="bottom" value="50" waitEvent="updateComplete" waitTarget="panel1.getChildAt(1)"/> |
| <AssertPropertyValue target="panel1.getChildAt(1)" propertyName="height" value="200" /> |
| <AssertPropertyValue target="panel1.getChildAt(1)" propertyName="y" value="10" /> |
| </body> |
| </TestCase> |
| |
| <TestCase testID="constraintRowspercentage_bottomPanel_editSize" keywords="[Button, percentage sized, Panel, constraintRow]" |
| description="change bottom value on a component constrained by percentage-constraintRows and the Panel. Change the Panel size at runtime."> |
| <setup> |
| <ResetComponent target="panel1" className="comps.PercentageRowColumnPanelComp" waitTarget="panel1" waitEvent="updateComplete" /> |
| </setup> |
| <body> |
| <SetProperty target="panel1" propertyName="height" value="500" waitEvent="updateComplete" waitTarget="panel1"/> |
| <SetStyle target="panel1.getChildAt(1)" styleName="bottom" value="50" waitEvent="updateComplete" waitTarget="panel1.getChildAt(1)"/> |
| <AssertPropertyValue target="panel1.getChildAt(1)" propertyName="height" value="400" /> |
| <AssertPropertyValue target="panel1.getChildAt(1)" propertyName="y" value="10" /> |
| </body> |
| </TestCase> |
| |
| <TestCase testID="Panel_verticalCenter_mxml" keywords="[verticalCenter, percentage sized, Panel, constraintColumn]" |
| description="Verify verticalCenter works when set in mxml and is relative to a constraintColumn"> |
| <setup> |
| <ResetComponent target="panel1" className="comps.PercentageRowColumnPanelComp" waitTarget="panel1" waitEvent="updateComplete" /> |
| </setup> |
| <body> |
| <AssertPropertyValue target="panel1.getChildAt(3)" propertyName="y" valueExpression="value=Math.round((application.panel1.constraintRows[0].height/2) +5)" /> |
| </body> |
| </TestCase> |
| <TestCase testID="Panel_verticalCenter_zero" keywords="[verticalCenter, percentage sized, Panel, constraintColumn]" |
| description="Verify verticalCenter works when set to zero and is relative to a constraintColumn"> |
| <setup> |
| <ResetComponent target="panel1" className="comps.PercentageRowColumnPanelComp" waitTarget="panel1" waitEvent="updateComplete" /> |
| </setup> |
| <body> |
| <SetStyle target="panel1.getChildAt(3)" styleName="verticalCenter" valueExpression="value='row1:0'" waitTarget="panel1" waitEvent="updateComplete" /> |
| <AssertPropertyValue target="panel1.getChildAt(3)" propertyName="y" valueExpression="value=Math.round((application.panel1.constraintRows[0].height/2) -15)" /> |
| </body> |
| </TestCase> |
| <TestCase testID="Panel_verticalCenter_positive" keywords="[verticalCenter, percentage sized, Panel, constraintColumn]" |
| description="Verify verticalCenter works when set at runtime and is relative to a constraintColumn"> |
| <setup> |
| <ResetComponent target="panel1" className="comps.PercentageRowColumnPanelComp" waitTarget="panel1" waitEvent="updateComplete" /> |
| </setup> |
| <body> |
| <SetStyle target="panel1.getChildAt(3)" styleName="verticalCenter" valueExpression="value='row1:50'" waitTarget="panel1" waitEvent="updateComplete" /> |
| <AssertPropertyValue target="panel1.getChildAt(3)" propertyName="y" valueExpression="value=Math.round((application.panel1.constraintRows[0].height/2)+35)" /> |
| </body> |
| </TestCase> |
| |
| <TestCase testID="Panel_horizontalCenter_mxml" keywords="[horizontalCenter, percentage sized, Panel, constraintColumn]" |
| description="Verify horizontalCenter works when set in mxml and is relative to a constraintColumn"> |
| <setup> |
| <ResetComponent target="panel1" className="comps.PercentageRowColumnPanelComp" waitTarget="panel1" waitEvent="updateComplete" /> |
| </setup> |
| <body> |
| <AssertPropertyValue target="panel1.getChildAt(4)" propertyName="x" valueExpression="value=Math.round((application.panel1.constraintColumns[1].width/2)+119)" /> |
| </body> |
| </TestCase> |
| <TestCase testID="Panel_horizontalCenter_zero" keywords="[horizontalCenter, percentage sized, Panel, constraintColumn]" |
| description="Verify horizontalCenter works when set to zero and is relative to a constraintColumn"> |
| <setup> |
| <ResetComponent target="panel1" className="comps.PercentageRowColumnPanelComp" waitTarget="panel1" waitEvent="updateComplete" /> |
| </setup> |
| <body> |
| <SetStyle target="panel1.getChildAt(4)" styleName="horizontalCenter" valueExpression="value='col2:0'" waitTarget="panel1" waitEvent="updateComplete" /> |
| <AssertPropertyValue target="panel1.getChildAt(4)" propertyName="x" valueExpression="value=Math.round((application.panel1.constraintColumns[1].width/2) +89)" /> |
| </body> |
| </TestCase> |
| <TestCase testID="Panel_horizontalCenter_positive" keywords="[horizontalCenter, percentage sized, Panel, constraintColumn]" |
| description="Verify horizontalCenter works when set at runtime and is relative to a constraintColumn"> |
| <setup> |
| <ResetComponent target="panel1" className="comps.PercentageRowColumnPanelComp" waitTarget="panel1" waitEvent="updateComplete" /> |
| </setup> |
| <body> |
| <SetStyle target="panel1.getChildAt(4)" styleName="horizontalCenter" valueExpression="value='col2:50'" waitTarget="panel1" waitEvent="updateComplete" /> |
| <AssertPropertyValue target="panel1.getChildAt(4)" propertyName="x" valueExpression="value=Math.round((application.panel1.constraintColumns[1].width/2)+139)" /> |
| </body> |
| </TestCase> |
| <!-- horizontalCenter and verticalCenter tests --> |
| <TestCase testID="fixedColumns_PercentColumns_horizontalCenter_positive" keywords="[horizontalCenter, percentage sized]"> |
| <setup> |
| <ResetComponent target="panel1" className="comps.PercentageRowColumnPanelComp" waitTarget="panel1" waitEvent="updateComplete" /> |
| </setup> |
| <body> |
| <SetProperty target="panel1.getChildAt(5)" propertyName="width" value="60" waitEvent="updateComplete" waitTarget="panel1"/> |
| <SetStyle target="panel1.getChildAt(5)" styleName="horizontalCenter" valueExpression="value='col1:10'" waitEvent="updateComplete" waitTarget="panel1"/> |
| <AssertPropertyValue target="panel1.getChildAt(5)" propertyName="x" value="37" /> |
| </body> |
| </TestCase> |
| <TestCase testID="fixedColumns_PercentColumns_horizontalCenter_zero" keywords="[horizontalCenter, percentage sized]"> |
| <setup> |
| <ResetComponent target="panel1" className="comps.PercentageRowColumnPanelComp" waitTarget="panel1" waitEvent="updateComplete" /> |
| </setup> |
| <body> |
| <SetProperty target="panel1.getChildAt(5)" propertyName="width" value="60" waitEvent="updateComplete" waitTarget="panel1"/> |
| <SetStyle target="panel1.getChildAt(5)" styleName="horizontalCenter" valueExpression="value='col1:0'" waitEvent="updateComplete" waitTarget="panel1"/> |
| <AssertPropertyValue target="panel1.getChildAt(5)" propertyName="x" value="27" /> |
| </body> |
| </TestCase> |
| <TestCase testID="fixedColumns_PercentRows_verticalCenter_positive" keywords="[verticalCenter, percentage sized]"> |
| <setup> |
| <ResetComponent target="panel1" className="comps.PercentageRowColumnPanelComp" waitTarget="panel1" waitEvent="updateComplete" /> |
| </setup> |
| <body> |
| <SetProperty target="panel1.getChildAt(5)" propertyName="height" value="60" waitEvent="updateComplete" waitTarget="panel1"/> |
| <SetStyle target="panel1.getChildAt(5)" styleName="verticalCenter" valueExpression="value='row1:10'" waitEvent="updateComplete" waitTarget="panel1"/> |
| <AssertPropertyValue target="panel1.getChildAt(5)" propertyName="y" value="13" /> |
| </body> |
| </TestCase> |
| <TestCase testID="fixedColumns_PercentRows_verticalCenter_zero" keywords="[verticalCenter, percentage sized]"> |
| <setup> |
| <ResetComponent target="panel1" className="comps.PercentageRowColumnPanelComp" waitTarget="panel1" waitEvent="updateComplete" /> |
| </setup> |
| <body> |
| <SetProperty target="panel1.getChildAt(5)" propertyName="height" value="60" waitEvent="updateComplete" waitTarget="panel1"/> |
| <SetStyle target="panel1.getChildAt(5)" styleName="verticalCenter" valueExpression="value='row1:0'" waitEvent="updateComplete" waitTarget="panel1"/> |
| <AssertPropertyValue target="panel1.getChildAt(5)" propertyName="y" value="3" /> |
| </body> |
| </TestCase> |
| <TestCase testID="fixedColumns_PercentColumns_horizontalCenter_negative" keywords="[horizontalCenter, percentage sized]"> |
| <setup> |
| <ResetComponent target="panel1" className="comps.PercentageRowColumnPanelComp" waitTarget="panel1" waitEvent="updateComplete" /> |
| </setup> |
| <body> |
| <SetProperty target="panel1.getChildAt(5)" propertyName="width" value="60" waitEvent="updateComplete" waitTarget="panel1"/> |
| <SetStyle target="panel1.getChildAt(5)" styleName="horizontalCenter" valueExpression="value='col1:-10'" waitEvent="updateComplete" waitTarget="panel1"/> |
| <AssertPropertyValue target="panel1.getChildAt(5)" propertyName="x" value="17" /> |
| </body> |
| </TestCase> |
| <TestCase testID="fixedColumns_PercentRows_verticalCenter_negative" keywords="[verticalCenter, percentage sized]"> |
| <setup> |
| <ResetComponent target="panel1" className="comps.PercentageRowColumnPanelComp" waitTarget="panel1" waitEvent="updateComplete" /> |
| </setup> |
| <body> |
| <SetProperty target="panel1.getChildAt(5)" propertyName="height" value="60" waitEvent="updateComplete" waitTarget="panel1"/> |
| <SetStyle target="panel1.getChildAt(5)" styleName="verticalCenter" valueExpression="value='row1:-10'" waitEvent="updateComplete" waitTarget="panel1"/> |
| <AssertPropertyValue target="panel1.getChildAt(5)" propertyName="y" value="-7" /> |
| </body> |
| </TestCase> |
| <!-- minWidth/maxWidth/minHeight/maxHeight --> |
| <TestCase testID="percentRows_minHeight_basic" keywords="[minHeight, ConstraintRow, percentage sized]" |
| description="Ensure that minHeight works for percentage sized rows" > |
| <setup> |
| <ResetComponent target="panel1" className="comps.PercentageRowColumnPanelComp" waitTarget="panel1" waitEvent="updateComplete" /> |
| </setup> |
| <body> |
| <SetProperty target="panel1.constraintRows.0" propertyName="minHeight" value="100" waitEvent="updateComplete" waitTarget="panel1"/> |
| <AssertPropertyValue target="panel1.constraintRows.0" propertyName="height" value="100" /> |
| <AssertPropertyValue target="panel1.getChildAt(1)" propertyName="height" value="192" /> |
| <AssertPropertyValue target="panel1.getChildAt(2)" propertyName="height" value="177" /> |
| <AssertPropertyValue target="panel1.getChildAt(3)" propertyName="y" valueExpression="value=Math.round((100/2) + 20 - 15)" /> |
| </body> |
| </TestCase> |
| <TestCase testID="percentColumns_minWidth_basic" keywords="[minWidth, ConstraintColumn, percentage sized]" |
| description="Ensure that minWidth works for percentage sized columns" > |
| <setup> |
| <ResetComponent target="panel1" className="comps.PercentageRowColumnPanelComp" waitTarget="panel1" waitEvent="updateComplete" /> |
| </setup> |
| <body> |
| <SetProperty target="panel1.constraintColumns.1" propertyName="minWidth" value="250" waitEvent="updateComplete" waitTarget="panel1"/> |
| <AssertPropertyValue target="panel1.constraintColumns.1" propertyName="width" value="250" /> |
| <AssertPropertyValue target="panel1.getChildAt(0)" propertyName="width" value="314" /> |
| <AssertPropertyValue target="panel1.getChildAt(2)" propertyName="width" value="324" /> |
| <AssertPropertyValue target="panel1.getChildAt(4)" propertyName="x" valueExpression="value=Math.round(114 + (250/2) + 30 - 25)" /> |
| </body> |
| </TestCase> |
| <TestCase testID="percentRows_minHeight_overrideHeight" keywords="[minHeight, ConstraintRow, percentage sized]" |
| description="Ensure that minHeight works for percentage sized rows" > |
| <setup> |
| <ResetComponent target="panel1" className="comps.PercentageRowColumnPanelComp" waitTarget="panel1" waitEvent="updateComplete" /> |
| </setup> |
| <body> |
| <SetProperty target="panel1.constraintRows.0" propertyName="minHeight" value="100" waitEvent="updateComplete" waitTarget="panel1"/> |
| <SetProperty target="panel1.getChildAt(5)" propertyName="height" value="40" waitEvent="updateComplete" waitTarget="panel1.getChildAt(5)"/> |
| <SetStyle target="panel1.getChildAt(5)" styleName="top" valueExpression="value='row1:5'" waitEvent="updateComplete" waitTarget="panel1"/> |
| <SetStyle target="panel1.getChildAt(5)" styleName="bottom" valueExpression="value='row1:10'" waitEvent="updateComplete" waitTarget="panel1"/> |
| <AssertPropertyValue target="panel1.getChildAt(5)" propertyName="height" value="85" /> |
| </body> |
| </TestCase> |
| <TestCase testID="percentColumns_minWidth_overrideWidth" keywords="[minWidth, ConstraintColumn, percentage sized]" |
| description="Ensure that minWidth works for percentage sized columns" > |
| <setup> |
| <ResetComponent target="panel1" className="comps.PercentageRowColumnPanelComp" waitTarget="panel1" waitEvent="updateComplete" /> |
| </setup> |
| <body> |
| <SetProperty target="panel1.constraintColumns.0" propertyName="minWidth" value="150" waitEvent="updateComplete" waitTarget="panel1"/> |
| <SetProperty target="panel1.getChildAt(5)" propertyName="width" value="50" waitEvent="updateComplete" waitTarget="panel1.getChildAt(5)"/> |
| <SetStyle target="panel1.getChildAt(5)" styleName="left" valueExpression="value='col1:20'" waitEvent="updateComplete" waitTarget="panel1"/> |
| <SetStyle target="panel1.getChildAt(5)" styleName="right" valueExpression="value='col1:10'" waitEvent="updateComplete" waitTarget="panel1"/> |
| <AssertPropertyValue target="panel1.getChildAt(5)" propertyName="width" value="120" /> |
| </body> |
| </TestCase> |
| <TestCase testID="percentRows_maxHeight_basic" keywords="[maxHeight, ConstraintRow, percentage sized]" |
| description="Ensure that maxHeight works for percentage sized rows" > |
| <setup> |
| <ResetComponent target="panel1" className="comps.PercentageRowColumnPanelComp" waitTarget="panel1" waitEvent="updateComplete" /> |
| </setup> |
| <body> |
| <SetProperty target="panel1.constraintRows.0" propertyName="maxHeight" value="100" waitEvent="updateComplete" waitTarget="panel1"/> |
| <SetProperty target="panel1.constraintRows.0" propertyName="percentHeight" value="50" waitEvent="updateComplete" waitTarget="panel1"/> |
| <AssertPropertyValue target="panel1.constraintRows.0" propertyName="height" value="100" /> |
| <AssertPropertyValue target="panel1.getChildAt(1)" propertyName="height" value="192" /> |
| <AssertPropertyValue target="panel1.getChildAt(3)" propertyName="y" valueExpression="value=Math.round((100/2) + 20 - 15)" /> |
| </body> |
| </TestCase> |
| <TestCase testID="percentColumns_maxWidth_basic" keywords="[maxWidth, ConstraintColumn, percentage sized]" |
| description="Ensure that maxWidth works for percentage sized columns" > |
| <setup> |
| <ResetComponent target="panel1" className="comps.PercentageRowColumnPanelComp" waitTarget="panel1" waitEvent="updateComplete" /> |
| </setup> |
| <body> |
| <SetProperty target="panel1.constraintColumns.1" propertyName="maxWidth" value="150" waitEvent="updateComplete" waitTarget="panel1"/> |
| <AssertPropertyValue target="panel1.constraintColumns.1" propertyName="width" value="150" /> |
| <AssertPropertyValue target="panel1.getChildAt(0)" propertyName="width" value="214" /> |
| <AssertPropertyValue target="panel1.getChildAt(2)" propertyName="width" value="224" /> |
| <AssertPropertyValue target="panel1.getChildAt(4)" propertyName="x" valueExpression="value=Math.round(114 + (150/2) + 30 - 25)" /> |
| </body> |
| </TestCase> |
| <TestCase testID="percentRows_maxHeight_spillingComponent" keywords="[maxHeight, ConstraintRow, percentage sized]" |
| description="Ensure that maxHeight works for percentage sized rows" > |
| <setup> |
| <ResetComponent target="panel1" className="comps.PercentageRowColumnPanelComp" waitTarget="panel1" waitEvent="updateComplete" /> |
| </setup> |
| <body> |
| <SetProperty target="panel1.constraintRows.0" propertyName="maxHeight" value="100" waitEvent="updateComplete" waitTarget="panel1"/> |
| <SetProperty target="panel1.constraintRows.0" propertyName="percentHeight" value="50" waitEvent="updateComplete" waitTarget="panel1"/> |
| <SetStyle target="panel1.getChildAt(5)" styleName="top" valueExpression="value='row1:50'" waitEvent="updateComplete" waitTarget="panel1"/> |
| <SetProperty target="panel1.getChildAt(5)" propertyName="height" value="90" waitEvent="updateComplete" waitTarget="panel1"/> |
| <AssertPropertyValue target="panel1.constraintRows.0" propertyName="height" value="100" /> |
| <AssertPropertyValue target="panel1.getChildAt(5)" propertyName="height" value="90" /> |
| <AssertPropertyValue target="panel1.getChildAt(5)" propertyName="y" value="50" /> |
| </body> |
| </TestCase> |
| <TestCase testID="percentColumns_maxWidth_spillingComponent" keywords="[maxWidth, ConstraintColumn, percentage sized]" |
| description="Ensure that maxWidth works for percentage sized columns" > |
| <setup> |
| <ResetComponent target="panel1" className="comps.PercentageRowColumnPanelComp" waitTarget="panel1" waitEvent="updateComplete" /> |
| </setup> |
| <body> |
| <SetProperty target="panel1.constraintColumns.0" propertyName="maxWidth" value="100" waitEvent="updateComplete" waitTarget="panel1"/> |
| <SetStyle target="panel1.getChildAt(5)" styleName="left" valueExpression="value='col1:50'" waitEvent="updateComplete" waitTarget="panel1"/> |
| <SetProperty target="panel1.getChildAt(5)" propertyName="width" value="90" waitEvent="updateComplete" waitTarget="panel1"/> |
| <AssertPropertyValue target="panel1.constraintColumns.0" propertyName="width" value="100" /> |
| <AssertPropertyValue target="panel1.getChildAt(5)" propertyName="width" value="90" /> |
| <AssertPropertyValue target="panel1.getChildAt(5)" propertyName="x" value="50" /> |
| </body> |
| </TestCase> |
| <TestCase testID="fixedColumns_PercentColumns_horizontalCenter_OverrideLeftRight" keywords="[horizontalCenter, percentage sized]"> |
| <setup> |
| <ResetComponent target="panel1" className="comps.PercentageRowColumnPanelComp" waitTarget="panel1" waitEvent="updateComplete" /> |
| </setup> |
| <body> |
| <SetProperty target="panel1.getChildAt(5)" propertyName="width" value="60" waitEvent="updateComplete" waitTarget="panel1"/> |
| <SetStyle target="panel1.getChildAt(5)" styleName="horizontalCenter" valueExpression="value='col1:10'" waitEvent="updateComplete" waitTarget="panel1"/> |
| <SetStyle target="panel1.getChildAt(5)" styleName="left" valueExpression="value='col1:30'" waitEvent="updateComplete" waitTarget="panel1"/> |
| <SetStyle target="panel1.getChildAt(5)" styleName="right" valueExpression="value='col1:30'" waitEvent="updateComplete" waitTarget="panel1"/> |
| <AssertPropertyValue target="panel1.getChildAt(5)" propertyName="x" value="40" /> |
| </body> |
| </TestCase> |
| <TestCase testID="fixedColumns_PercentRows_verticalCenter_OverrideTopBottom" keywords="[verticalCenter, percentage sized]"> |
| <setup> |
| <ResetComponent target="panel1" className="comps.PercentageRowColumnPanelComp" waitTarget="panel1" waitEvent="updateComplete" /> |
| </setup> |
| <body> |
| <SetProperty target="panel1.getChildAt(5)" propertyName="height" value="60" waitEvent="updateComplete" waitTarget="panel1"/> |
| <SetStyle target="panel1.getChildAt(5)" styleName="verticalCenter" valueExpression="value='row1:10'" waitEvent="updateComplete" waitTarget="panel1"/> |
| <SetStyle target="panel1.getChildAt(5)" styleName="top" valueExpression="value='row1:8'" waitEvent="updateComplete" waitTarget="panel1"/> |
| <SetStyle target="panel1.getChildAt(5)" styleName="bottom" valueExpression="value='row1:8'" waitEvent="updateComplete" waitTarget="panel1"/> |
| <AssertPropertyValue target="panel1.getChildAt(5)" propertyName="y" value="18" /> |
| </body> |
| </TestCase> |
| </testCases> |
| </UnitTester> |