blob: f367eb9725a37007e1b61319c7d7642a6f5c0ffc [file] [log] [blame]
<?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/FormItem/styles/" xmlns:mx="http://www.adobe.com/2006/mxml" xmlns="*" testSWF="FormItem_Basic.mxml">
<!-- this set of lines FormItem a template that must be in each unit test -->
<mx:Script>
<![CDATA[
public static function init(o:DisplayObject):void
{
}
]]>
</mx:Script>
<mx:Metadata>
<![CDATA[
[Mixin]
]]>
</mx:Metadata>
<!-- end of set of lines that must be in each unit test -->
<mx:Script>
<![CDATA[
import mx.containers.*
import mx.controls.*
import mx.styles.StyleManager;
import mx.managers.SystemManager;
]]>
</mx:Script>
<mx:Style>
.testStyleCenter {
text-align: center;
}
</mx:Style>
<mx:Style>
.testStyleLeft {
text-align: left;
}
</mx:Style>
<mx:Style>
.testStyleRight {
text-align: right;
}
</mx:Style>
<testCases>
<!-- Styles -->
<TestCase testID="FormItem_Styles_horizontalGap" keywords="[FormItem, horizontalGap, borderStyle, solid]">
<setup>
<ResetComponent target="myCustomForm" className="CustomForm" waitEvent="updateComplete" waitTarget="myCustomForm"/>
<SetStyle target="myCustomForm.fi" styleName="horizontalGap" value="20" waitEvent="updateComplete" waitTarget="myCustomForm.fi" />
</setup>
<body>
<AssertStyleValue target="myCustomForm.fi" styleName="horizontalGap" value="20" />
<WaitForEffectsToEnd />
<CompareBitmap target="" url="../styles/Baselines/FormItem_Style_horizontalGap.png" timeout="5000" />
</body>
</TestCase>
<TestCase testID="FormItem_Styles_paddingBottom" keywords="[FormItem, paddingBottom, borderStyle, solid]">
<setup>
<ResetComponent target="myCustomForm" className="CustomForm" waitEvent="updateComplete" waitTarget="myCustomForm"/>
<SetStyle target="myCustomForm.fi" styleName="paddingBottom" value="20" waitEvent="updateComplete" waitTarget="myCustomForm.fi" />
</setup>
<body>
<AssertStyleValue target="myCustomForm.fi" styleName="paddingBottom" value="20" />
<WaitForEffectsToEnd />
<CompareBitmap target="" url="../styles/Baselines/FormItem_Style_paddingBottom.png" timeout="5000" />
</body>
</TestCase>
<TestCase testID="FormItem_Styles_paddingRight" keywords="[FormItem, paddingRight, borderStyle, solid]">
<setup>
<ResetComponent target="myCustomForm" className="CustomForm" waitEvent="updateComplete" waitTarget="myCustomForm"/>
<SetStyle target="myCustomForm.fi" styleName="paddingRight" value="20" waitEvent="updateComplete" waitTarget="myCustomForm.fi" />
</setup>
<body>
<AssertStyleValue target="myCustomForm.fi" styleName="paddingRight" value="20" />
<WaitForEffectsToEnd />
<CompareBitmap target="" url="../styles/Baselines/FormItem_Style_paddingRight.png" timeout="5000" />
</body>
</TestCase>
<TestCase testID="FormItem_Styles_paddingTop" keywords="[FormItem, paddingTop, borderStyle, solid]">
<setup>
<ResetComponent target="myCustomForm" className="CustomForm" waitEvent="updateComplete" waitTarget="myCustomForm"/>
<SetStyle target="myCustomForm.fi" styleName="paddingTop" value="20" waitEvent="updateComplete" waitTarget="myCustomForm.fi" />
</setup>
<body>
<AssertStyleValue target="myCustomForm.fi" styleName="paddingTop" value="20" />
<WaitForEffectsToEnd />
<CompareBitmap target="" url="../styles/Baselines/FormItem_Style_paddingTop.png" timeout="5000" />
</body>
</TestCase>
<TestCase testID="FormItem_Styles_labelWidth" keywords="[FormItem, labelWidth, borderStyle, solid]">
<setup>
<ResetComponent target="myCustomForm" className="CustomForm" waitEvent="updateComplete" waitTarget="myCustomForm"/>
<SetProperty target="myCustomForm.fi" propertyName="label" value="FormItem Style Testing" waitEvent="updateComplete" waitTarget="myCustomForm.fi"/>
</setup>
<body>
<AssertStyleValue target="myCustomForm.fi" styleName="labelWidth" valueExpression="value=null" />
<WaitForEffectsToEnd />
<CompareBitmap target="" url="../styles/Baselines/FormItem_Style_labelWidth.png" timeout="5000" />
</body>
</TestCase>
<TestCase testID="FormItem_Styles_verticalGap" keywords="[FormItem, verticalGap, borderStyle, solid]">
<setup>
<ResetComponent target="myCustomForm" className="CustomForm" waitEvent="updateComplete" waitTarget="myCustomForm"/>
</setup>
<body>
<AssertStyleValue target="myCustomForm.fi" styleName="verticalGap" value="6"/>
<WaitForEffectsToEnd />
<CompareBitmap target="" url="../styles/Baselines/FormItem_Style_verticalGap.png" timeout="5000" />
</body>
</TestCase>
<TestCase testID="FormItem_Styles_verticalGap2" keywords="[FormItem, verticalGap2, borderStyle, solid]">
<setup>
<ResetComponent target="myCustomForm" className="CustomForm" waitEvent="updateComplete" waitTarget="myCustomForm"/>
</setup>
<body>
<AssertStyleValue target="myCustomForm.fi" styleName="verticalGap" value="6"/>
<WaitForEffectsToEnd />
<CompareBitmap target="" url="../styles/Baselines/FormItem_Style_verticalGap2.png" timeout="5000" />
</body>
</TestCase>
<TestCase testID="FormItem_Styles_horizontalAlign_Default" keywords="[FormItem, horizontalAlign, borderStyle, solid]">
<setup>
<ResetComponent target="myCustomForm" className="CustomForm" waitEvent="updateComplete" waitTarget="myCustomForm"/>
</setup>
<body>
<AssertStyleValue target="myCustomForm.fi" styleName="horizontalAlign" value="left"/>
<WaitForEffectsToEnd />
<CompareBitmap target="" url="../styles/Baselines/FormItem_Style_horizontalAlign.png" timeout="5000" />
</body>
</TestCase>
<TestCase testID="FormItem_Styles_text-align_center" keywords="[FormItem, text-align, Label, center]">
<setup>
<ResetComponent target="myCustomForm" className="CustomForm" waitEvent="updateComplete" waitTarget="myCustomForm"/>
<SetStyle target="myCustomForm.fi" styleName="labelStyleName" value="testStyleCenter" waitEvent="updateComplete" waitTarget="myCustomForm.fi" />
<SetProperty target="myCustomForm.fi" propertyName="label" value="FormItem Style" waitEvent="updateComplete" waitTarget="myCustomForm.fi"/>
<SetProperty target="myCustomForm.fi" propertyName="width" value="200" waitEvent="updateComplete" waitTarget="myCustomForm.fi"/>
</setup>
<body>
<AssertStyleValue target="myCustomForm.fi" styleName="labelStyleName" value="testStyleCenter"/>
<WaitForEffectsToEnd />
<CompareBitmap target="" url="../styles/Baselines/FormItem_Style_labelStyleName_center.png" timeout="5000" />
</body>
</TestCase>
<TestCase testID="FormItem_Styles_text-align_left" keywords="[FormItem, text-align, Label, left]">
<setup>
<ResetComponent target="myCustomForm" className="CustomForm" waitEvent="updateComplete" waitTarget="myCustomForm"/>
<SetStyle target="myCustomForm.fi" styleName="labelStyleName" value="testStyleLeft" waitEvent="updateComplete" waitTarget="myCustomForm.fi" />
<SetProperty target="myCustomForm.fi" propertyName="label" value="FormItem Style" waitEvent="updateComplete" waitTarget="myCustomForm.fi"/>
<SetProperty target="myCustomForm.fi" propertyName="width" value="200" waitEvent="updateComplete" waitTarget="myCustomForm.fi"/>
</setup>
<body>
<AssertStyleValue target="myCustomForm.fi" styleName="labelStyleName" value="testStyleLeft"/>
<WaitForEffectsToEnd />
<CompareBitmap target="" url="../styles/Baselines/FormItem_Style_labelStyleName_left.png" timeout="5000" />
</body>
</TestCase>
<TestCase testID="FormItem_Styles_text-align_right" keywords="[FormItem, text-align, Label, right]">
<setup>
<ResetComponent target="myCustomForm" className="CustomForm" waitEvent="updateComplete" waitTarget="myCustomForm"/>
<SetStyle target="myCustomForm.fi" styleName="labelStyleName" value="testStyleRight" waitEvent="updateComplete" waitTarget="myCustomForm.fi" />
<SetProperty target="myCustomForm.fi" propertyName="label" value="FormItem Style" waitEvent="updateComplete" waitTarget="myCustomForm.fi"/>
<SetProperty target="myCustomForm.fi" propertyName="width" value="200" waitEvent="updateComplete" waitTarget="myCustomForm.fi"/>
</setup>
<body>
<AssertStyleValue target="myCustomForm.fi" styleName="labelStyleName" value="testStyleRight"/>
<WaitForEffectsToEnd />
<CompareBitmap target="" url="../styles/Baselines/FormItem_Style_labelStyleName_right.png" timeout="5000" />
</body>
</TestCase>
</testCases>
</UnitTester>