blob: 15ed084082851f022301af329fd7aeab4a2e39c1 [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="components/ToggleButtonBar/Integration/" xmlns:mx="http://www.adobe.com/2006/mxml" xmlns="*" testSWF="ToggleButtonBar_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
{
}
public function addData(bool:int):void
{
application.tbb.dataProvider = myDP;
}
[Bindable]
public var iconDP:Array= [{label:"Toys", icon:"dinosaur"},{label:"dinosaur", icon: "dinosaur"}];
private function toolTipValue():int
{
return (application.tbb.selectedIndex);
}
]]>
</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.ToggleButtonBar;
import mx.styles.StyleManager;
import mx.managers.SystemManager;
import mx.events.ListEvent;
[Bindable]
private var myDP:Array=[{label:"Italy", data:"ITALY"},{label:"England", data:"ENGLAND"},{label:"Slovenia", data:"SLOVENIA"}];
]]>
</mx:Script>
<testCases>
<TestCase testID="ToggleButtonBar_KeyBoardNavigation" description="ToggleButtonBar Keyboard Navigation test." keywords="[enabled, ToggleButtonBar]">
<setup>
<ResetComponent target="tbb" className="mx.controls.ToggleButtonBar" waitEvent="updateComplete" waitTarget="tbb" />
<RunCode code="addData(0);" waitEvent="updateComplete" waitTarget="tbb"/>
<DispatchKeyEvent keys="[TAB, TAB, TAB, RIGHT, SPACE]" />
</setup>
<body>
<AssertPropertyValue target="tbb" propertyName="selectedIndex" value="-1" />
</body>
</TestCase>
<TestCase testID="ToggleButtonBar_mxml_component" description="ToggleButtonBar Integration test for mxml component" keywords="[enabled, ToggleButtonBar]">
<setup>
<ResetComponent target="tbb2" className="MyToggleButtonBar" waitEvent="updateComplete" waitTarget="tbb2" />
<DispatchKeyEvent keys="[TAB, TAB, TAB, TAB , RIGHT, SPACE]" />
</setup>
<body>
<AssertPropertyValue target="tbb2" propertyName="selectedIndex" value="1" />
</body>
</TestCase>
<TestCase testID="ToggleButtonBar_toolTip" description="ToggleButtonBar, toolTip " keywords="[toolTip, ToggleButtonBar]">
<setup>
<ResetComponent target="tbb" className="mx.controls.ToggleButtonBar" waitEvent="updateComplete" waitTarget="tbb" />
<RunCode code="addData(0);" waitEvent="updateComplete" waitTarget="tbb"/>
<DispatchMouseClickEvent target="tbb" localX="170" localY="10" waitEvent="mouseUp" waitTarget="tbb"/>
<RunCode code="application.tbb.toolTip=toolTipValue();" waitEvent="updateComplete" waitTarget="tbb"/>
</setup>
<body>
<DispatchMouseClickEvent target="tbb" localX="20" localY="10" waitEvent="mouseUp" waitTarget="tbb"/>
<DispatchMouseEvent type="mouseOver" target="tbb" localX="50" localY="10" waitEvent="mouseOver" waitTarget="tbb"/>
<AssertEvent target="tbb" eventName="toolTipShow" eventClass="mx.events::ToolTipEvent" />
<AssertEvent target="tbb" eventName="toolTipShown" eventClass="mx.events::ToolTipEvent" />
<AssertPropertyValue target="tbb" propertyName="toolTip" value="2" />
</body>
</TestCase>
</testCases>
</UnitTester>