| <?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="components/CheckBox/events/" xmlns:mx="http://www.adobe.com/2006/mxml" xmlns="*" testSWF="CheckBox_main.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.controls.CheckBox; |
| |
| import mx.effects.Fade; |
| |
| |
| |
| [Bindable] |
| |
| private var myFade:Fade = new Fade(); |
| |
| ]]> |
| |
| </mx:Script> |
| |
| |
| |
| <testCases> |
| |
| |
| |
| <!--Testcase for buttonDown event of CheckBox--> |
| |
| <TestCase testID="Checking_buttonDown_Event_of_CheckBox" keywords="[CheckBox, buttonDown, Event]" description="Ensure that the buttonDown event gets triggered when the CheckBox is clicked."> |
| |
| <setup> |
| |
| <ResetComponent target="myCheckBox" className="mx.controls::CheckBox" waitEvent="updateComplete" waitTarget="myCheckBox"/> |
| |
| </setup> |
| |
| <body> |
| |
| <DispatchMouseEvent target="myCheckBox" localX="5" localY="5" type="mouseDown" waitEvent="buttonDown" waitTarget="myCheckBox"/> |
| |
| </body> |
| |
| </TestCase> |
| |
| |
| |
| <!--Test for manual test checking click event--> |
| |
| <TestCase testID="Checking_click_Event_of_CheckBox" keywords="[CheckBox, click, Event]" description="Ensures the click event gets triggered when a CheckBox is clicked."> |
| |
| <setup> |
| |
| <ResetComponent target="myCheckBox" className="mx.controls::CheckBox"/> |
| |
| </setup> |
| |
| <body> |
| |
| <DispatchMouseClickEvent target="myCheckBox" localX="30" localY="20" waitTarget="myCheckBox"/> |
| |
| </body> |
| |
| </TestCase> |
| |
| |
| |
| <!--Test for manual test checking toolTipShow event--> |
| |
| <TestCase testID="Checking_toolTipShow_Event_of_CheckBox" keywords="[CheckBox, toolTipShow, Event]" description="Ensure the toolTipShow event gets triggered."> |
| |
| <setup> |
| |
| <ResetComponent target="myCheckBox" className="mx.controls.CheckBox" waitEvent="updateComplete" waitTarget="myCanvas"/> |
| |
| <SetProperty target="myCheckBox" propertyName="toolTip" value="CheckBox tool tip"/> |
| |
| </setup> |
| |
| <body> |
| |
| <DispatchMouseEvent target="myCheckBox" localX="5" localY="5" type="mouseOver" waitEvent="toolTipShow" waitTarget="myCheckBox"/> |
| |
| </body> |
| |
| </TestCase> |
| |
| |
| |
| <!--Test for manual test checking effectEnd event--> |
| |
| <TestCase testID="Checking_effectEnd_Event_of_CheckBox" keywords="[CheckBox, effectEnd, Event]" description="Ensure that the effectEnd event gets fired once the effect ends."> |
| |
| <setup> |
| |
| <ResetComponent target="myCheckBox" className="mx.controls::CheckBox"/> |
| |
| </setup> |
| |
| <body> |
| |
| <SetStyle target="myCheckBox" styleName="rollOverEffect" value="{myFade}" waitEvent="updateComplete" waitTarget="myCheckBox"/> |
| |
| <DispatchMouseEvent target="myCheckBox" localX="3" localY="3" type="rollOver" waitEvent="effectEnd" waitTarget="myCheckBox"/> |
| |
| </body> |
| |
| </TestCase> |
| |
| |
| |
| <!--Test for manual test checking effectStart event--> |
| |
| <TestCase testID="Checking_effectStart_Event_of_CheckBox" keywords="[CheckBox, effectStart, Event]" description="Ensure that the effectStart event gets fired once the effect starts."> |
| |
| <setup> |
| |
| <ResetComponent target="myCheckBox" className="mx.controls::CheckBox"/> |
| |
| </setup> |
| |
| <body> |
| |
| <SetStyle target="myCheckBox" styleName="rollOverEffect" value="{myFade}" waitEvent="updateComplete" waitTarget="myCheckBox"/> |
| |
| <DispatchMouseEvent target="myCheckBox" localX="3" localY="3" type="rollOver" waitEvent="effectStart" waitTarget="myCheckBox"/> |
| |
| </body> |
| |
| </TestCase> |
| |
| |
| |
| <!--Test for manual test checking focusIn event--> |
| |
| <TestCase testID="Checking_focusIn_Event_of_CheckBox" keywords="[CheckBox, focusIn, Event]" description="Ensure that the focusIn event gets fired when the CheckBox gets focus."> |
| |
| <setup> |
| |
| <ResetComponent target="myCheckBox" className="mx.controls.CheckBox" waitEvent="updateComplete" waitTarget="myCheckBox"/> |
| |
| </setup> |
| |
| <body> |
| |
| <DispatchKeyEvent key="TAB" waitEvent="focusIn" waitTarget="myCheckBox"/> |
| |
| </body> |
| |
| </TestCase> |
| |
| |
| |
| |
| |
| |
| |
| <!--Test for manual test checking hide event--> |
| |
| <TestCase testID="Checking_hide_Event_of_CheckBox" keywords="[CheckBox, hide, Event]" description="Ensure that the hide event gets triggered when visible is false for CheckBox."> |
| |
| <setup> |
| |
| <ResetComponent target="myCheckBox" className="mx.controls.CheckBox" waitEvent="updateComplete" waitTarget="myCanvas"/> |
| |
| </setup> |
| |
| <body> |
| |
| <SetProperty target="myCheckBox" propertyName="visible" value="false" waitTarget="myCheckBox" waitEvent="hide"/> |
| |
| </body> |
| |
| </TestCase> |
| |
| |
| <!--Test for manual test checking keyDown event--> |
| |
| <TestCase testID="Checking_keyDown_event_of_CheckBox" keywords="[CheckBox, keyDown, Event]" description="Verify keyDown event fires."> |
| |
| <setup> |
| |
| <ResetComponent target="myCheckBox" className="mx.controls.CheckBox" waitEvent="updateComplete" waitTarget="myCanvas"/> |
| |
| </setup> |
| |
| <body> |
| |
| <DispatchKeyEvent key="TAB"/> |
| |
| <DispatchKeyEvent key="SPACE" waitEvent="keyDown" waitTarget="myCheckBox"/> |
| |
| </body> |
| |
| </TestCase> |
| |
| |
| |
| <!--Test for manual test checking keyUp event--> |
| |
| <TestCase testID="Checking_keyUp_event_of_CheckBox" keywords="[CheckBox, keyUp, Event]" description="Verify keyUp event fires."> |
| |
| <setup> |
| |
| <ResetComponent target="myCheckBox" className="mx.controls.CheckBox" waitEvent="updateComplete" waitTarget="myCanvas"/> |
| |
| </setup> |
| |
| <body> |
| |
| <DispatchKeyEvent key="TAB"/> |
| |
| <DispatchKeyEvent key="SPACE" waitEvent="keyUp" waitTarget="myCheckBox"/> |
| |
| </body> |
| |
| </TestCase> |
| |
| |
| |
| <!--Testcase for manual test of move for CheckBox--> |
| |
| <TestCase testID="Checking_move_event_of_CheckBox" keywords="[CheckBox, move, Event]" description="Make sure move event gets fired when CheckBox moves"> |
| |
| <setup> |
| |
| <ResetComponent target="myCheckBox" className="mx.controls.CheckBox" waitEvent="updateComplete" waitTarget="myCheckBox"/> |
| |
| <SetProperty target="myCheckBox" propertyName="x" value="50"/> |
| |
| <SetProperty target="myCheckBox" propertyName="label" value="CheckBox" waitEvent="updateComplete" waitTarget="myCheckBox"/> |
| |
| </setup> |
| |
| <body> |
| |
| <SetProperty target="myCheckBox" propertyName="x" value="70" waitEvent="move" waitTarget="myCheckBox"/> |
| |
| </body> |
| |
| </TestCase> |
| |
| |
| |
| <!--Testcase for manual test of resize for CheckBox--> |
| |
| <TestCase testID="Checking_resize_event_of_CheckBox" keywords="[CheckBox, resize, Event]" description="Make sure resize event gets fired when CheckBox moves"> |
| |
| <setup> |
| |
| <ResetComponent target="myCheckBox" className="mx.controls.CheckBox" waitEvent="updateComplete" waitTarget="myCheckBox"/> |
| |
| <SetProperty target="myCheckBox" propertyName="width" value="30"/> |
| |
| <SetProperty target="myCheckBox" propertyName="label" value="CheckBox" waitEvent="updateComplete" waitTarget="myCheckBox"/> |
| |
| </setup> |
| |
| <body> |
| |
| <SetProperty target="myCheckBox" propertyName="width" value="70" waitEvent="resize" waitTarget="myCheckBox"/> |
| |
| </body> |
| |
| </TestCase> |
| |
| |
| |
| <!--Testcase for manual test of show event for CheckBox--> |
| |
| <TestCase testID="Checking_show_event_of_CheckBox" keywords="[CheckBox, show, Event]" description="Make sure the show event gets fired when the checkbox is visible"> |
| |
| <setup> |
| |
| <ResetComponent target="myCheckBox" className="mx.controls.CheckBox" waitEvent="updateComplete" waitTarget="myCheckBox"/> |
| |
| <SetProperty target="myCheckBox" propertyName="visible" value="false"/> |
| |
| </setup> |
| |
| <body> |
| |
| <SetProperty target="myCheckBox" propertyName="visible" value="true" waitEvent="show" waitTarget="myCheckBox"/> |
| |
| </body> |
| |
| </TestCase> |
| |
| |
| |
| <!--Test for manual test checking focusOut event--> |
| |
| <TestCase testID="Checking_focusOut_Event_of_CheckBox" keywords="[CheckBox, focusOut, Event]" description="Ensure that the focusOut event gets fired when the CheckBox goes out of focus."> |
| |
| <setup> |
| |
| <ResetComponent target="myCheckBox" className="mx.controls.CheckBox" waitEvent="updateComplete" waitTarget="myCheckBox"/> |
| |
| </setup> |
| |
| <body> |
| |
| <DispatchKeyEvent key="TAB"/> |
| |
| <DispatchKeyEvent key="TAB" waitEvent="focusOut" waitTarget="myCheckBox"/> |
| |
| </body> |
| |
| </TestCase> |
| |
| </testCases> |
| |
| </UnitTester> |