blob: 479aac18dd2b2abc3ece2b7c65eb64c1780ada23 [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="gumbo/components/Label/Integration/" xmlns:mx="http://www.adobe.com/2006/mxml" xmlns="*" testSWF="Label_basic4.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;
import spark.components.Label;
import spark.components.RichText;
]]>
</mx:Script>
<testCases>
<!--
====================================================================================
Integration tests
verify Label created at runtime in various halo containers
====================================================================================
-->
<TestCase testID="create_label_in_mxApp_test1" keywords="[Label,integration]" description="create label inside mxApplication,verify its UI" >
<setup>
<RunCode code="FlexGlobals.topLevelApplication.resetTextValue()"/>
<RunCode code="FlexGlobals.topLevelApplication.removeLabel()" waitEvent="labelReset" waitTarget=""/>
<RunCode code="FlexGlobals.topLevelApplication.addNewLabel(FlexGlobals.topLevelApplication,'this is a label in mx application')" />
</setup>
<body>
<AssertPropertyValue target="labelAtRuntime" propertyName="text" value="this is a label in mx application" />
<!--
<CompareBitmap url="../integration/baselines/$testID.png" target="labelAtRuntime"/>
-->
</body>
</TestCase>
<TestCase testID="create_label_in_HBox_test1" keywords="[Label,integration]" description="create label inside mxHBox,verify its UI" >
<setup>
<RunCode code="FlexGlobals.topLevelApplication.removeLabel()" waitEvent="labelReset" waitTarget=""/>
<RunCode code="FlexGlobals.topLevelApplication.addNewLabel(FlexGlobals.topLevelApplication.myHBox,'this is a label in HBox')"
waitEvent="updateComplete" waitTarget="myHBox"/>
</setup>
<body>
<AssertPropertyValue target="labelAtRuntime" propertyName="text" value="this is a label in HBox" />
<CompareBitmap numColorVariances="10" maxColorVariance="10" url="../integration/baselines/$testID.png" target="myHBox"/>
</body>
</TestCase>
<TestCase testID="create_label_in_Panel_test1" keywords="[Label,integration]" description="create label inside mxPanel,verify its UI" >
<setup>
<RunCode code="FlexGlobals.topLevelApplication.removeLabel()" waitEvent="labelReset" waitTarget=""/>
<RunCode code="FlexGlobals.topLevelApplication.addNewLabel(FlexGlobals.topLevelApplication.myPanel,'this is a label in Panel')"
waitEvent="updateComplete" waitTarget="myPanel"/>
</setup>
<body>
<AssertPropertyValue target="labelAtRuntime" propertyName="text" value="this is a label in Panel" />
<CompareBitmap numColorVariances="10" maxColorVariance="10" url="../integration/baselines/$testID.png" target="myPanel"/>
</body>
</TestCase>
<TestCase testID="create_label_in_Form_test1" keywords="[Label,integration]" description="create label inside mxForm,verify its UI" >
<setup>
<RunCode code="FlexGlobals.topLevelApplication.removeLabel()" waitEvent="labelReset" waitTarget=""/>
<RunCode code="FlexGlobals.topLevelApplication.addNewLabel(FlexGlobals.topLevelApplication.myForm,'this is a label in Form')"
waitEvent="updateComplete" waitTarget="myForm"/>
</setup>
<body>
<AssertPropertyValue target="labelAtRuntime" propertyName="text" value="this is a label in Form" />
<CompareBitmap numColorVariances="10" maxColorVariance="10" url="../integration/baselines/$testID.png" target="myForm"/>
</body>
</TestCase>
<TestCase testID="create_label_in_ControlBar_test1" keywords="[Label,integration]" description="create label inside mxControlBar,verify its UI" >
<setup>
<RunCode code="FlexGlobals.topLevelApplication.removeLabel()" waitEvent="labelReset" waitTarget=""/>
<RunCode code="FlexGlobals.topLevelApplication.addNewLabel(FlexGlobals.topLevelApplication.myControlBar,'inside of controlBar')"
waitEvent="updateComplete" waitTarget="myControlBar" />
</setup>
<body>
<AssertPropertyValue target="labelAtRuntime" propertyName="text" value="inside of controlBar" />
<CompareBitmap numColorVariances="10" maxColorVariance="10" url="../integration/baselines/$testID.png" target="myControlBar"/>
</body>
</TestCase>
<TestCase testID="set_label_in_Popup_test1" keywords="[Label,integration]" description="create label inside popup,verify its UI" >
<setup>
<RunCode code="FlexGlobals.topLevelApplication.hidePopUp()" />
<WaitForEffectsToEnd />
<RunCode code="FlexGlobals.topLevelApplication.showPopUp()" />
<WaitForEffectsToEnd />
</setup>
<body>
<Pause timeout="200"/>
<CompareBitmap numColorVariances="10" maxColorVariance="10" url="../Integration/baselines/$testID.png" target="thePopUp" />
</body>
</TestCase>
<TestCase testID="update_label_in_Popup_test2" keywords="[Label,integration]" description="update label inside popup,verify its UI" >
<setup>
<RunCode code="FlexGlobals.topLevelApplication.showPopUp()" />
</setup>
<body>
<SetProperty target="thePopUp.myLabel4" propertyName="text" value="Updated, I am a spark label" waitTarget="thePopUp.myLabel4" waitEvent="updateComplete"/>
<AssertPropertyValue target="thePopUp.myLabel4" propertyName="text" value="Updated, I am a spark label" />
<CompareBitmap numColorVariances="10" maxColorVariance="10" url="../integration/baselines/$testID.png" target="thePopUp"/>
</body>
</TestCase>
<TestCase testID="create_label_in_Popup_test3" keywords="[Label,integration]" description="set label inside mxTitleWindow,verify its UI" >
<setup>
<RunCode code="FlexGlobals.topLevelApplication.hidePopUp()" />
<WaitForEffectsToEnd />
<RunCode code="FlexGlobals.topLevelApplication.showPopUp()" />
<WaitForEffectsToEnd />
<RunCode code="FlexGlobals.topLevelApplication.removeLabel()" waitEvent="labelReset" waitTarget=""/>
<RunCode code="FlexGlobals.topLevelApplication.addNewLabel(FlexGlobals.topLevelApplication.thePopUp,'inside of PopUp')" />
</setup>
<body>
<AssertPropertyValue target="labelAtRuntime" propertyName="text" value="inside of PopUp" />
<Pause timeout="200"/>
<CompareBitmap numColorVariances="10" maxColorVariance="10" url="../integration/baselines/$testID.png" target="thePopUp"/>
</body>
</TestCase>
</testCases>
</UnitTester>