| <?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/form/styles/" xmlns:mx="http://www.adobe.com/2006/mxml" xmlns="*" testSWF="Form_Basic_spark.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.containers.* |
| import mx.controls.* |
| import mx.styles.StyleManager; |
| import mx.managers.SystemManager; |
| |
| |
| |
| ]]> |
| </mx:Script> |
| <testCases> |
| <!-- styles --> |
| <TestCase testID="Form_styles_backgroundAlpha_spark" keywords="[backgroundAlpha, Form]"> |
| <setup> |
| <ResetComponent target="myCustomForm" className="CustomForm_spark" waitEvent="updateComplete" waitTarget="myCustomForm"/> |
| <SetStyle target="myCustomForm.myForm" styleName="backgroundAlpha" value="0.5" waitEvent="updateComplete" waitTarget="myCustomForm.myForm" /> |
| </setup> |
| <body> |
| <AssertStyleValue target="myCustomForm.myForm" styleName="backgroundAlpha" value="0.5" /> |
| <WaitForEffectsToEnd /> |
| <CompareBitmap target="myCustomForm.myForm" url="../styles/baselines/backgroundAlpha_spark.png" timeout="5000" /> |
| </body> |
| </TestCase> |
| |
| <TestCase testID="Form_styles_contentBackgroundcolor_spark" keywords="[backgroundColor, Form]"> |
| <setup> |
| <ResetComponent target="myCustomForm" className="CustomForm_spark" waitEvent="updateComplete" waitTarget="myCustomForm"/> |
| <SetStyle target="myCustomForm.myForm" styleName="backgroundColor" value="0xFF0000" waitEvent="updateComplete" waitTarget="myCustomForm.myForm" /> |
| </setup> |
| <body> |
| <AssertStyleValue target="myCustomForm.myForm" styleName="backgroundColor" value="0xFF0000" /> |
| <WaitForEffectsToEnd /> |
| <CompareBitmap target="myCustomForm.myForm" url="../styles/baselines/contentBackgroundColor_spark.png" timeout="5000" /> |
| </body> |
| </TestCase> |
| |
| |
| <TestCase testID="Form_styles_backgroundImage_spark" keywords="[backgroundImage, Form]"> |
| <setup> |
| <ResetComponent target="myCustomForm" className="CustomForm_spark" waitEvent="updateComplete" waitTarget="myCustomForm"/> |
| <SetStyle target="myCustomForm.myForm" styleName="backgroundImage" value="hotelview2.jpg" waitEvent="updateComplete" waitTarget="myCustomForm.myForm" /> |
| </setup> |
| <body> |
| <AssertStyleValue target="myCustomForm.myForm" styleName="backgroundImage" value="hotelview2.jpg" /> |
| <WaitForEffectsToEnd /> |
| <CompareBitmap target="myCustomForm.myForm" url="../styles/baselines/backgroundImage_spark.png" timeout="5000" /> |
| </body> |
| </TestCase> |
| |
| <TestCase testID="Form_styles_borderColor_spark" keywords="[borderColor, Form]"> |
| <setup> |
| <ResetComponent target="myCustomForm" className="CustomForm_spark" waitEvent="updateComplete" waitTarget="myCustomForm"/> |
| <SetStyle target="myCustomForm.myForm" styleName="borderColor" value="0xFF0000" waitEvent="updateComplete" waitTarget="myCustomForm.myForm" /> |
| </setup> |
| <body> |
| <AssertStyleValue target="myCustomForm.myForm" styleName="borderColor" value="0xFF0000" /> |
| <WaitForEffectsToEnd /> |
| <CompareBitmap target="myCustomForm.myForm" url="../styles/baselines/borderColor_spark.png" timeout="5000" /> |
| </body> |
| </TestCase> |
| |
| <TestCase testID="Form_styles_indicatorGap1_spark" keywords="[indicatorGap, Form]"> |
| <setup> |
| <ResetComponent target="myCustomForm" className="CustomForm_spark" waitEvent="updateComplete" waitTarget="myCustomForm"/> |
| <SetStyle target="myCustomForm.myForm" styleName="borderStyle" value="solid" /> |
| <SetStyle target="myCustomForm.myForm" styleName="indicatorGap" value="300" waitEvent="updateComplete" waitTarget="myCustomForm.myForm" /> |
| </setup> |
| <body> |
| <AssertStyleValue target="myCustomForm.myForm" styleName="indicatorGap" value="300" /> |
| <WaitForEffectsToEnd /> |
| <CompareBitmap target="myCustomForm.myForm" url="../styles/baselines/indicatorGap_1_spark.png" timeout="5000" /> |
| </body> |
| </TestCase> |
| <TestCase testID="Form_styles_indicatorGap2_spark" keywords="[indicatorGap, Form]"> |
| <setup> |
| <ResetComponent target="myCustomForm" className="CustomForm_spark" waitEvent="updateComplete" waitTarget="myCustomForm"/> |
| <SetStyle target="myCustomForm.myForm" styleName="borderStyle" value="solid" /> |
| </setup> |
| <body> |
| <AssertStyleValue target="myCustomForm.myForm" styleName="indicatorGap" value="14" /> |
| <WaitForEffectsToEnd /> |
| <CompareBitmap target="myCustomForm.myForm" url="../styles/baselines/indicatorGap_2_spark.png" timeout="5000" /> |
| </body> |
| </TestCase> |
| <TestCase testID="Form_styles_indicatorGap3_spark" keywords="[indicatorGap, Form]"> |
| <setup> |
| <ResetComponent target="myCustomForm" className="CustomForm_spark" waitEvent="updateComplete" waitTarget="myCustomForm"/> |
| <SetStyle target="myCustomForm.myForm" styleName="borderStyle" value="solid" /> |
| <SetStyle target="myCustomForm.myForm" styleName="indicatorGap" value="0" waitEvent="updateComplete" waitTarget="myCustomForm.myForm" /> |
| </setup> |
| <body> |
| <AssertStyleValue target="myCustomForm.myForm" styleName="indicatorGap" value="0" /> |
| <WaitForEffectsToEnd /> |
| <CompareBitmap target="myCustomForm.myForm" url="../styles/baselines/indicatorGap_3_spark.png" timeout="5000" /> |
| </body> |
| </TestCase> |
| |
| <TestCase testID="Form_styles_borderThickness_spark" keywords="[borderThickness, Form]"> |
| <setup> |
| <ResetComponent target="myCustomForm" className="CustomForm_spark" waitEvent="updateComplete" waitTarget="myCustomForm"/> |
| <SetStyle target="myCustomForm.myForm" styleName="borderStyle" value="solid" /> |
| <SetStyle target="myCustomForm.myForm" styleName="borderThickness" value="4" waitEvent="updateComplete" /> |
| </setup> |
| <body> |
| <AssertStyleValue target="myCustomForm.myForm" styleName="borderThickness" value="4" /> |
| <WaitForEffectsToEnd /> |
| <CompareBitmap target="myCustomForm.myForm" url="../styles/baselines/borderThickness_spark.png" timeout="5000" /> |
| </body> |
| </TestCase> |
| |
| <TestCase testID="Form_styles_color_spark" keywords="[color, Form]"> |
| <setup> |
| <ResetComponent target="myCustomForm" className="CustomForm_spark" waitEvent="updateComplete" waitTarget="myCustomForm"/> |
| <SetStyle target="myCustomForm.myForm" styleName="color" value="0x0000ff" waitEvent="updateComplete" /> |
| </setup> |
| <body> |
| <AssertStyleValue target="myCustomForm.myForm" styleName="color" value="0x0000ff" /> |
| <WaitForEffectsToEnd /> |
| <CompareBitmap target="myCustomForm.myForm" url="../styles/baselines/color_spark.png" timeout="5000" /> |
| </body> |
| </TestCase> |
| |
| |
| <TestCase testID="Form_styles_cornerRadius_spark" keywords="[cornerRadius, Form]"> |
| <setup> |
| <ResetComponent target="myCustomForm" className="CustomForm_spark" waitEvent="updateComplete" waitTarget="myCustomForm"/> |
| <SetStyle target="myCustomForm.myForm" styleName="cornerRadius" value="6" waitEvent="updateComplete" /> |
| </setup> |
| <body> |
| <AssertStyleValue target="myCustomForm.myForm" styleName="cornerRadius" value="6" /> |
| <WaitForEffectsToEnd /> |
| <CompareBitmap target="myCustomForm.myForm" url="../styles/baselines/cornerRadius_spark.png" timeout="5000" /> |
| </body> |
| </TestCase> |
| |
| <TestCase testID="Form_styles_disabledColor_spark" keywords="[disabledColor, Form]"> |
| <setup> |
| <ResetComponent target="myCustomForm" className="CustomForm_spark" waitEvent="updateComplete" waitTarget="myCustomForm"/> |
| <SetProperty target="myCustomForm.myForm" propertyName="enabled" value="false" /> |
| <SetStyle target="myCustomForm.myForm" styleName="disabledColor" value="0x00ff00" waitEvent="updateComplete" /> |
| </setup> |
| <body> |
| <AssertStyleValue target="myCustomForm.myForm" styleName="disabledColor" value="0x00ff00" /> |
| <WaitForEffectsToEnd /> |
| <CompareBitmap target="myCustomForm.myForm" url="../styles/baselines/disabledColor_spark.png" timeout="5000" /> |
| </body> |
| </TestCase> |
| |
| <TestCase testID="Form_styles_fontfamily_spark" keywords="[fontFamily, Form]"> |
| <setup> |
| <ResetComponent target="myCustomForm" className="CustomForm_spark" waitEvent="updateComplete" waitTarget="myCustomForm"/> |
| <SetStyle target="myCustomForm.myForm" styleName="fontFamily" value="EmbeddedArial" /> |
| <SetStyle target="myCustomForm.myForm" styleName="fontSize" value="30" waitTarget="myCustomForm" waitEvent="updateComplete"/> |
| </setup> |
| <body> |
| <AssertStyleValue target="myCustomForm.myForm" styleName="fontFamily" value="EmbeddedArial" /> |
| <WaitForEffectsToEnd /> |
| <CompareBitmap target="myCustomForm.myForm" url="../styles/baselines/fontFamily_spark.png" timeout="5000" /> |
| </body> |
| </TestCase> |
| |
| <TestCase testID="Form_styles_fontsize_spark" keywords="[fontSize, Form]"> |
| <setup> |
| <ResetComponent target="myCustomForm" className="CustomForm_spark" waitEvent="updateComplete" waitTarget="myCustomForm"/> |
| <SetStyle target="myCustomForm.myForm" styleName="fontSize" value="14" waitEvent="updateComplete" /> |
| </setup> |
| <body> |
| <AssertStyleValue target="myCustomForm.myForm" styleName="fontSize" value="14" /> |
| <WaitForEffectsToEnd /> |
| <CompareBitmap target="myCustomForm.myForm" url="../styles/baselines/fonrSize_spark.png" timeout="5000" /> |
| </body> |
| </TestCase> |
| |
| <TestCase testID="Form_styles_fontweight_spark" keywords="[fontWeight, Form]"> |
| <setup> |
| <ResetComponent target="myCustomForm" className="CustomForm_spark" waitEvent="updateComplete" waitTarget="myCustomForm"/> |
| <SetStyle target="myCustomForm.myForm" styleName="fontWeight" value="bold" waitEvent="updateComplete" /> |
| </setup> |
| <body> |
| <AssertStyleValue target="myCustomForm.myForm" styleName="fontWeight" value="bold" /> |
| <WaitForEffectsToEnd /> |
| <CompareBitmap target="myCustomForm.myForm" url="../styles/baselines/fontWeight_spark.png" timeout="5000" /> |
| </body> |
| </TestCase> |
| |
| |
| <TestCase testID="Form_styles_horizontalGap_spark" keywords="[horizontalGap, Form]"> |
| <setup> |
| <ResetComponent target="myCustomForm" className="CustomForm_spark" waitEvent="updateComplete" waitTarget="myCustomForm"/> |
| <SetStyle target="myCustomForm.myForm" styleName="horizontalGap" value="20" waitEvent="updateComplete" /> |
| </setup> |
| <body> |
| <AssertStyleValue target="myCustomForm.myForm" styleName="horizontalGap" value="20" /> |
| <WaitForEffectsToEnd /> |
| <CompareBitmap target="myCustomForm.myForm" url="../styles/baselines/horizontalGap_spark.png" timeout="5000" /> |
| </body> |
| </TestCase> |
| |
| |
| <TestCase testID="Form_styles_paddingBottom_spark" keywords="[paddingBottom, Form]"> |
| <setup> |
| <ResetComponent target="myCustomForm" className="CustomForm_spark" waitEvent="updateComplete" waitTarget="myCustomForm"/> |
| <SetStyle target="myCustomForm.myForm" styleName="paddingBottom" value="20" waitEvent="updateComplete" /> |
| </setup> |
| <body> |
| <AssertStyleValue target="myCustomForm.myForm" styleName="paddingBottom" value="20" /> |
| <WaitForEffectsToEnd /> |
| <CompareBitmap target="myCustomForm.myForm" url="../styles/baselines/paddingBottom_spark.png" timeout="5000" /> |
| </body> |
| </TestCase> |
| |
| <TestCase testID="Form_styles_paddingLeft_spark" keywords="[paddingLeft, Form]"> |
| <setup> |
| <ResetComponent target="myCustomForm" className="CustomForm_spark" waitEvent="updateComplete" waitTarget="myCustomForm"/> |
| <SetStyle target="myCustomForm.myForm" styleName="paddingLeft" value="20" waitEvent="updateComplete" /> |
| </setup> |
| <body> |
| <AssertStyleValue target="myCustomForm.myForm" styleName="paddingLeft" value="20" /> |
| <WaitForEffectsToEnd /> |
| <CompareBitmap target="myCustomForm.myForm" url="../styles/baselines/paddingLeft_spark.png" timeout="5000" /> |
| </body> |
| </TestCase> |
| |
| |
| <TestCase testID="Form_styles_paddingRight_spark" keywords="[paddingRight, Form]"> |
| <setup> |
| <ResetComponent target="myCustomForm" className="CustomForm_spark" waitEvent="updateComplete" waitTarget="myCustomForm"/> |
| <SetStyle target="myCustomForm.myForm" styleName="paddingRight" value="20" waitEvent="updateComplete" /> |
| </setup> |
| <body> |
| <AssertStyleValue target="myCustomForm.myForm" styleName="paddingRight" value="20" /> |
| <WaitForEffectsToEnd /> |
| <CompareBitmap target="myCustomForm.myForm" url="../styles/baselines/paddingRight_spark.png" timeout="5000" /> |
| </body> |
| </TestCase> |
| |
| <TestCase testID="Form_styles_paddingTop_spark" keywords="[paddingTop, Form]"> |
| <setup> |
| <ResetComponent target="myCustomForm" className="CustomForm_spark" waitEvent="updateComplete" waitTarget="myCustomForm"/> |
| <SetStyle target="myCustomForm.myForm" styleName="paddingTop" value="20" waitEvent="updateComplete" /> |
| </setup> |
| <body> |
| <AssertStyleValue target="myCustomForm.myForm" styleName="paddingTop" value="20" /> |
| <WaitForEffectsToEnd /> |
| <CompareBitmap target="myCustomForm.myForm" url="../styles/baselines/paddingTop_spark.png" timeout="5000" /> |
| </body> |
| </TestCase> |
| <TestCase testID="Form_styles_labelWidth_spark" keywords="[labelWidth , Form]"> |
| <setup> |
| <ResetComponent target="myCustomForm" className="CustomForm_spark" /> |
| <SetProperty target="myCustomForm.myForm" propertyName="label" value="Form Style Testing" waitEvent="updateComplete" waitTarget="myCustomForm"/> |
| </setup> |
| <body> |
| <AssertStyleValue target="myCustomForm.myForm" styleName="labelWidth" valueExpression="value=null" /> |
| <WaitForEffectsToEnd /> |
| <CompareBitmap target="myCustomForm.myForm" url="../styles/baselines/labelWidth_spark.png" timeout="5000" /> |
| </body> |
| </TestCase> |
| <TestCase testID="Form_styles_verticalGap_spark" keywords="[verticalGap, Form]"> |
| <setup> |
| <ResetComponent target="myCustomForm" className="CustomForm_spark" waitEvent="updateComplete" waitTarget="myCustomForm"/> |
| </setup> |
| <body> |
| <AssertStyleValue target="myCustomForm.myForm" styleName="verticalGap" value="6"/> |
| <WaitForEffectsToEnd /> |
| <CompareBitmap target="myCustomForm.myForm" url="../styles/baselines/verticalGap_spark.png" timeout="5000" /> |
| </body> |
| </TestCase> |
| </testCases> |
| </UnitTester> |