| <?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/RadioButton/methods/" xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:mx="library://ns.adobe.com/flex/mx" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:m="http://ns.adobe.com/mxml/2009" xmlns="*" testSWF="FxRadioButtonBasic.mxml"> |
| |
| <!-- this set of lines form a template that must be in each unit test --> |
| |
| <fx:Script> |
| <![CDATA[ |
| public static function init(o:DisplayObject):void |
| { |
| } |
| ]]> |
| </fx:Script> |
| |
| <fx:Metadata> |
| <![CDATA[ |
| [Mixin] |
| ]]> |
| </fx:Metadata> |
| |
| <!-- end of set of lines that must be in each unit test --> |
| |
| <fx:Script> |
| <![CDATA[ |
| import spark.components.RadioButton; |
| import comps.*; |
| import spark.components.Group; |
| ]]> |
| </fx:Script> |
| |
| <testCases> |
| |
| |
| <!--**************************--> |
| <!--FxRadioButton method tests--> |
| <!--**************************--> |
| |
| <TestCase testID="FxRadioButton_method_getRadioButtonAt_0" keywords="[FxRadioButton, methods, getRadioButtonAt]" description="call getRadioButtonAt make sure appropriate RadioButton is returned"> |
| <setup> |
| <ResetComponent target="srg" className="comps.SparkRadioButtonGroup" waitEvent="updateComplete" waitTarget="srg"/> |
| <ResetComponent target="hrg" className="comps.HaloRadioButtonGroup" waitEvent="updateComplete" waitTarget="hrg"/> |
| </setup> |
| <body> |
| <AssertMethodValue method="value=application.srg.sparkGrp.getRadioButtonAt(0).label" value="Spark 1" /> |
| </body> |
| </TestCase> |
| |
| <TestCase testID="FxRadioButton_method_getRadioButtonAt_3" keywords="[FxRadioButton, methods, getRadioButtonAt]" description="call getRadioButtonAt make sure appropriate RadioButton is returned"> |
| <setup> |
| <ResetComponent target="srg" className="comps.SparkRadioButtonGroup" waitEvent="updateComplete" waitTarget="srg"/> |
| <ResetComponent target="hrg" className="comps.HaloRadioButtonGroup" waitEvent="updateComplete" waitTarget="hrg"/> |
| </setup> |
| <body> |
| <AssertMethodValue method="value=application.srg.sparkGrp.getRadioButtonAt(3).label" value="Spark 4" /> |
| </body> |
| </TestCase> |
| |
| <TestCase testID="FxRadioButton_method_getRadioButtonAt_numRadioButtons" keywords="[FxRadioButton, methods, getRadioButtonAt]" description="call getRadioButtonAt make sure appropriate RadioButton is returned"> |
| <setup> |
| <ResetComponent target="srg" className="comps.SparkRadioButtonGroup" waitEvent="updateComplete" waitTarget="srg"/> |
| <ResetComponent target="hrg" className="comps.HaloRadioButtonGroup" waitEvent="updateComplete" waitTarget="hrg"/> |
| |
| </setup> |
| <body> |
| <AssertMethodValue method="value=application.srg.sparkGrp.getRadioButtonAt(application.srg.sparkGrp.numRadioButtons-1).label" value="Spark 5" /> |
| </body> |
| </TestCase> |
| <TestCase testID="FxRadioButton_method_getRadioButtonAt_invalid_index" keywords="[FxRadioButton, methods, getRadioButtonAt]" description="call getRadioButtonAt make sure appropriate RadioButton is returned"> |
| <setup> |
| <ResetComponent target="srg" className="comps.SparkRadioButtonGroup" waitEvent="updateComplete" waitTarget="srg"/> |
| <ResetComponent target="hrg" className="comps.HaloRadioButtonGroup" waitEvent="updateComplete" waitTarget="hrg"/> |
| |
| </setup> |
| <body> |
| <AssertMethodValue method="value=application.srg.sparkGrp.getRadioButtonAt(application.srg.sparkGrp.numRadioButtons + 1)" value="null" /> |
| </body> |
| </TestCase> |
| |
| <TestCase testID="FxRadioButton_method_getRadioButtonAt_set_label" keywords="[FxRadioButton, methods, getRadioButtonAt]" description="call getRadioButtonAt make sure appropriate RadioButton is returned"> |
| <setup> |
| <ResetComponent target="srg" className="comps.SparkRadioButtonGroup" waitEvent="updateComplete" waitTarget="srg"/> |
| <ResetComponent target="hrg" className="comps.HaloRadioButtonGroup" waitEvent="updateComplete" waitTarget="hrg"/> |
| <RunCode code="application.srg.sparkGrp.getRadioButtonAt(application.srg.sparkGrp.numRadioButtons - 1).label='New Label'" waitEvent="updateComplete" waitTarget="srg.s5"/> |
| </setup> |
| <body> |
| <AssertMethodValue method="value=application.srg.sparkGrp.getRadioButtonAt(application.srg.sparkGrp.numRadioButtons - 1).label" value="New Label" /> |
| <AssertPropertyValue propertyName="label" target="srg.s5" value="New Label"/> |
| <CompareBitmap url="../methods/baselines/$testID.png" target="srg.s5" numColorVariances="8" maxColorVariance="5" /> |
| </body> |
| </TestCase> |
| |
| <!--SDK-19625--> |
| <TestCase testID="FxRadioButton_method_getRadioButtonAt_set_value" keywords="[FxRadioButton, methods, getRadioButtonAt]" description="call getRadioButtonAt make sure appropriate RadioButton is returned"> |
| <setup> |
| <ResetComponent target="srg" className="comps.SparkRadioButtonGroup" waitEvent="updateComplete" waitTarget="srg"/> |
| <ResetComponent target="hrg" className="comps.HaloRadioButtonGroup" waitEvent="updateComplete" waitTarget="hrg"/> |
| <RunCode code="application.srg.sparkGrp.getRadioButtonAt(2).value='MyNewValue'"/> |
| </setup> |
| <body> |
| <AssertMethodValue method="value=application.srg.sparkGrp.getRadioButtonAt(2).value" value="MyNewValue" /> |
| <AssertPropertyValue propertyName="label" target="srg.s3" value="Spark 3"/> |
| </body> |
| </TestCase> |
| </testCases> |
| </UnitTester> |