blob: 491ccc441ff10cb43f48a4de93edc6d61ae19f10 [file] [log] [blame]
<UnitTester testDir="components/NumericStepper/styles/"
xmlns:mx="http://www.adobe.com/2006/mxml"
xmlns="*"
testSWF="NumericStepper_Mirroring_Basic.mxml">
<!-- this set of lines form 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.core.FlexGlobals;
}
]]>
</mx:Script>
<testCases>
<TestCase testID="NumericStepper_Styles_Mirroring_as_default" keywords="[NumericStepper, Mirroring, rtl]" description="Test direction set to rtl in AS on NumericStepper">
<setup>
<ResetComponent target="ns" className="mx.controls.NumericStepper" waitEvent="updateComplete"/>
</setup>
<body>
<AssertStyleValue target="ns" styleName="layoutDirection" value="ltr"/>
<AssertStyleValue target="ns" styleName="direction" value="ltr"/>
<RunCode code="FlexGlobals.topLevelApplication.setLdRTL()" />
<Pause timeout="20"/>
<AssertStyleValue target="ns" styleName="layoutDirection" value="rtl"/>
<AssertStyleValue target="ns" styleName="direction" value="ltr"/>
<CompareBitmap target="ns" url="../Styles/baselines/$testID_1.png"/>
<RunCode code="FlexGlobals.topLevelApplication.setDRTL()" />
<Pause timeout="20"/>
<AssertStyleValue target="ns" styleName="direction" value="rtl"/>
<CompareBitmap target="ns" url="../Styles/baselines/$testID_2.png"/>
</body>
</TestCase>
<TestCase testID="NumericStepper_Styles_Mirroring_default" keywords="[NumericStepper, Mirroring, rtl]" description="Test direction rtl set at runtime on NumericStepper">
<setup>
<ResetComponent target="ns" className="mx.controls.NumericStepper" waitEvent="updateComplete"/>
</setup>
<body>
<AssertStyleValue target="ns" styleName="layoutDirection" value="ltr"/>
<AssertStyleValue target="ns" styleName="direction" value="ltr"/>
<SetStyle target="ns" styleName="layoutDirection" value="rtl" waitEvent="updateComplete"/>
<AssertStyleValue target="ns" styleName="layoutDirection" value="rtl"/>
<AssertStyleValue target="ns" styleName="direction" value="ltr"/>
<CompareBitmap target="ns" url="../Styles/baselines/$testID_1.png"/>
<SetStyle target="ns" styleName="direction" value="rtl" waitEvent="updateComplete"/>
<AssertStyleValue target="ns" styleName="direction" value="rtl"/>
<CompareBitmap target="ns" url="../Styles/baselines/$testID_2.png"/>
</body>
</TestCase>
<TestCase testID="NumericStepper_Styles_Mirroring_keyboard" keywords="[NumericStepper, Mirroring, rtl]" description="Test keyboard keys on rtl NumericStepper">
<setup>
<ResetComponent target="ns" className="mx.controls.NumericStepper" waitEvent="updateComplete"/>
<SetStyle target="ns" styleName="layoutDirection" value="rtl" waitEvent="updateComplete"/>
<SetProperty target="ns" propertyName="stepSize" value="5" />
</setup>
<body>
<AssertStyleValue target="ns" styleName="layoutDirection" value="rtl"/>
<AssertPropertyValue target="ns" propertyName="value" value="0"/>
<DispatchKeyEvent keys="[TAB]" waitEvent="focusIn" waitTarget="ns" />
<DispatchKeyEvent keys="[UP]" waitEvent="change" waitTarget="ns" />
<AssertPropertyValue target="ns" propertyName="value" value="5" />
<DispatchKeyEvent keys="[UP]" waitEvent="change" waitTarget="ns" />
<AssertPropertyValue target="ns" propertyName="value" value="10" />
<CompareBitmap target="ns" url="../Styles/baselines/$testID_1.png"/>
<DispatchKeyEvent keys="[DOWN]" waitEvent="change" waitTarget="ns" />
<AssertPropertyValue target="ns" propertyName="value" value="5" />
<DispatchKeyEvent keys="[DOWN]" waitEvent="change" waitTarget="ns" />
<AssertPropertyValue target="ns" propertyName="value" value="0" />
<CompareBitmap target="ns" url="../Styles/baselines/$testID_2.png"/>
</body>
</TestCase>
<TestCase testID="NumericStepper_Styles_Mirroring_mxml_default" keywords="[NumericStepper, Mirroring, rtl]" description="Test direction set to rtl in MXML on NumericStepper">
<setup>
<ResetComponent target="ns2" className="comps.myNS_rtl" waitEvent="updateComplete"/>
</setup>
<body>
<AssertStyleValue target="ns2" styleName="layoutDirection" value="rtl"/>
<AssertStyleValue target="ns2" styleName="direction" value="rtl"/>
<AssertPropertyValue target="ns2" propertyName="value" value="0"/>
<CompareBitmap target="ns2" url="../Styles/baselines/$testID.png"/>
</body>
</TestCase>
<TestCase testID="NumericStepper_Styles_Mirroring_mxml_value" keywords="[NumericStepper, Mirroring, rtl]" description="Test direction set to rtl in MXML on NumericStepper">
<setup>
<ResetComponent target="ns2" className="comps.myNS_rtl" waitEvent="updateComplete"/>
</setup>
<body>
<AssertStyleValue target="ns2" styleName="layoutDirection" value="rtl"/>
<AssertStyleValue target="ns2" styleName="direction" value="rtl"/>
<DispatchMouseEvent type="rollOver" target="ns2" localX="50" localY="5" waitEvent="rollOver"/>
<DispatchMouseEvent type="mouseDown" target="ns2" localX="50" localY="5" waitEvent="mouseDown" />
<DispatchMouseEvent type="mouseUp" target="ns2" localX="50" localY="5" waitEvent="mouseUp"/>
<AssertPropertyValue target="ns2" propertyName="value" value="1"/>
<DispatchMouseEvent type="rollOver" target="ns2" localX="50" localY="5" waitEvent="rollOver"/>
<DispatchMouseEvent type="mouseDown" target="ns2" localX="50" localY="5" waitEvent="mouseDown" />
<DispatchMouseEvent type="mouseUp" target="ns2" localX="50" localY="5" waitEvent="mouseUp"/>
<AssertPropertyValue target="ns2" propertyName="value" value="2"/>
<DispatchMouseEvent type="rollOver" target="ns2" localX="50" localY="15" waitEvent="rollOver"/>
<DispatchMouseEvent type="mouseDown" target="ns2" localX="50" localY="15" waitEvent="mouseDown" />
<DispatchMouseEvent type="mouseUp" target="ns2" localX="50" localY="15" waitEvent="mouseUp"/>
<AssertPropertyValue target="ns2" propertyName="value" value="1"/>
<DispatchMouseEvent type="rollOver" target="ns2" localX="50" localY="15" waitEvent="rollOver"/>
<DispatchMouseEvent type="mouseDown" target="ns2" localX="50" localY="15" waitEvent="mouseDown" />
<DispatchMouseEvent type="mouseUp" target="ns2" localX="50" localY="15" waitEvent="mouseUp"/>
<AssertPropertyValue target="ns2" propertyName="value" value="0"/>
</body>
</TestCase>
<TestCase testID="NumericStepper_Styles_Mirroring_mxml_changeDir" keywords="[NumericStepper, Mirroring, rtl]" description="Test direction set to ltr at runtime on NumericStepper">
<setup>
<ResetComponent target="ns2" className="comps.myNS_rtl" waitEvent="updateComplete"/>
</setup>
<body>
<AssertStyleValue target="ns2" styleName="layoutDirection" value="rtl"/>
<AssertStyleValue target="ns2" styleName="direction" value="rtl"/>
<SetProperty target="ns2" propertyName="value" value="7" waitEvent="updateComplete"/>
<AssertPropertyValue target="ns2" propertyName="value" value="7"/>
<CompareBitmap target="ns2" url="../Styles/baselines/$testID_1.png"/>
<SetStyle target="ns2" styleName="layoutDirection" value="ltr" waitEvent="updateComplete"/>
<SetStyle target="ns2" styleName="direction" value="ltr" waitEvent="updateComplete"/>
<AssertPropertyValue target="ns2" propertyName="value" value="7"/>
<CompareBitmap target="ns2" url="../Styles/baselines/$testID_2.png"/>
</body>
</TestCase>
<TestCase testID="NumericStepper_Styles_Mirroring_parentContainer1" keywords="[NumericStepper, Mirroring, rtl]" description="Test setting layoutDirection rtl on parentContainer of NumericStepper">
<setup>
<ResetComponent target="myPanel3" className="comps.myCustomPanel" waitEvent="updateComplete"/>
<SetStyle target="myPanel3" styleName="layoutDirection" value="rtl" waitEvent="updateComplete"/>
</setup>
<body>
<AssertStyleValue target="myPanel3" styleName="layoutDirection" value="rtl"/>
<CompareBitmap target="myPanel3" url="../Styles/baselines/$testID.png" numColorVariances="8" maxColorVariance="1"/>
</body>
</TestCase>
<TestCase testID="NumericStepper_Styles_Mirroring_parentContainer1_2" keywords="[NumericStepper, Mirroring, rtl]" description="Test setting layoutDirection rtl on parentContainer of NumericStepper">
<setup>
<ResetComponent target="myPanel3" className="comps.myCustomPanel" waitEvent="updateComplete"/>
<SetStyle target="myPanel3" styleName="layoutDirection" value="rtl" waitEvent="updateComplete"/>
</setup>
<body>
<AssertStyleValue target="myPanel3" styleName="layoutDirection" value="rtl"/>
<SetStyle target="myPanel3" styleName="layoutDirection" value="ltr" waitEvent="updateComplete"/>
<AssertStyleValue target="myPanel3" styleName="layoutDirection" value="ltr"/>
<CompareBitmap target="myPanel3" url="../Styles/baselines/$testID.png" numColorVariances="8" maxColorVariance="1"/>
</body>
</TestCase>
<TestCase testID="NumericStepper_Styles_Mirroring_parentContainer2" keywords="[NumericStepper, Mirroring, rtl]" description="Test setting direction rtl on parentContainer of NumericStepper">
<setup>
<ResetComponent target="myPanel3" className="comps.myCustomPanel" waitEvent="updateComplete"/>
<SetStyle target="myPanel3" styleName="direction" value="rtl" waitEvent="updateComplete"/>
</setup>
<body>
<AssertStyleValue target="myPanel3" styleName="direction" value="rtl"/>
<CompareBitmap target="myPanel3" url="../Styles/baselines/$testID.png" numColorVariances="8" maxColorVariance="1"/>
</body>
</TestCase>
<TestCase testID="NumericStepper_Styles_Mirroring_parentContainer2_1" keywords="[NumericStepper, Mirroring, rtl]" description="Test setting direction rtl on parentContainer of NumericStepper">
<setup>
<ResetComponent target="myPanel3" className="comps.myCustomPanel" waitEvent="updateComplete"/>
<SetStyle target="myPanel3" styleName="direction" value="rtl" waitEvent="updateComplete"/>
</setup>
<body>
<AssertStyleValue target="myPanel3" styleName="direction" value="rtl"/>
<SetStyle target="myPanel3" styleName="direction" value="ltr" waitEvent="updateComplete"/>
<AssertStyleValue target="myPanel3" styleName="direction" value="ltr"/>
<CompareBitmap target="myPanel3" url="../Styles/baselines/$testID.png" numColorVariances="8" maxColorVariance="1"/>
</body>
</TestCase>
<TestCase testID="NumericStepper_Styles_Mirroring_parentContainer3" keywords="[NumericStepper, Mirroring, rtl]" description="Test setting layoutDirection and direction rtl on parentContainer of NumericStepper">
<setup>
<ResetComponent target="myPanel3" className="comps.myCustomPanel" waitEvent="updateComplete"/>
<SetStyle target="myPanel3" styleName="layoutDirection" value="rtl" waitEvent="updateComplete"/>
<SetStyle target="myPanel3" styleName="direction" value="rtl" waitEvent="updateComplete"/>
</setup>
<body>
<AssertStyleValue target="myPanel3" styleName="direction" value="rtl"/>
<AssertStyleValue target="myPanel3" styleName="layoutDirection" value="rtl"/>
<CompareBitmap target="myPanel3" url="../Styles/baselines/$testID.png" numColorVariances="8" maxColorVariance="1"/>
</body>
</TestCase>
<TestCase testID="NumericStepper_Styles_Mirroring_parentContainer4" keywords="[NumericStepper, Mirroring, rtl]" description="Test setting layoutDirection and direction rtl on parentContainer of NumericStepper">
<setup>
<ResetComponent target="myPanel3" className="comps.myCustomPanel" waitEvent="updateComplete"/>
<SetProperty target="myPanel3" propertyName="title" value="My Panel !"/>
<SetProperty target="myPanel3" propertyName="width" value="100"/>
<SetProperty target="myPanel3" propertyName="height" value="100"/>
<SetStyle target="myPanel3" styleName="color" value="red" waitEvent="updateComplete"/>
<SetStyle target="myPanel3" styleName="fontSize" value="16" waitEvent="updateComplete"/>
<SetStyle target="myPanel3" styleName="chromeColor" value="blue" waitEvent="updateComplete"/>
<SetStyle target="myPanel3" styleName="symbolColor" value="white" waitEvent="updateComplete"/>
<SetStyle target="myPanel3" styleName="layoutDirection" value="rtl" waitEvent="updateComplete"/>
<SetStyle target="myPanel3" styleName="direction" value="rtl" waitEvent="updateComplete"/>
</setup>
<body>
<CompareBitmap target="myPanel3" url="../Styles/baselines/$testID.png"/>
</body>
</TestCase>
<TestCase testID="NumericStepper_Styles_Mirroring_styles" keywords="[NumericStepper, Mirroring, rtl]" description="Test setting layoutDirection and direction rtl on parentContainer of NumericStepper">
<setup>
<ResetComponent target="ns" className="mx.controls.NumericStepper" waitEvent="updateComplete"/>
<SetStyle target="ns" styleName="color" value="red" waitEvent="updateComplete"/>
<SetStyle target="ns" styleName="fontSize" value="16" waitEvent="updateComplete"/>
<SetStyle target="ns" styleName="chromeColor" value="blue" waitEvent="updateComplete"/>
<SetStyle target="ns" styleName="layoutDirection" value="rtl" waitEvent="updateComplete"/>
<SetStyle target="ns" styleName="direction" value="rtl" waitEvent="updateComplete"/>
</setup>
<body>
<CompareBitmap target="ns" url="../Styles/baselines/$testID.png"/>
</body>
</TestCase>
<TestCase testID="NumericStepper_Styles_Mirroring_value" keywords="[NumericStepper, Mirroring, rtl]" description="Test value with direction rtl on NumericStepper">
<setup>
<ResetComponent target="ns" className="mx.controls.NumericStepper" waitEvent="updateComplete"/>
<SetProperty target="ns" propertyName="maximum" value="999" waitEvent="updateComplete"/>
<SetProperty target="ns" propertyName="value" value="123" waitEvent="updateComplete"/>
<SetStyle target="ns" styleName="layoutDirection" value="rtl" waitEvent="updateComplete"/>
<SetStyle target="ns" styleName="direction" value="rtl" waitEvent="updateComplete"/>
</setup>
<body>
<AssertStyleValue target="ns" styleName="layoutDirection" value="rtl"/>
<AssertStyleValue target="ns" styleName="direction" value="rtl"/>
<AssertPropertyValue target="ns" propertyName="value" value="123"/>
<CompareBitmap target="ns" url="../Styles/baselines/$testID.png"/>
</body>
</TestCase>
</testCases>
</UnitTester>