blob: d6e2c0d9ca7fe6f435b970fe3a1b32debd664531 [file]
<?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
xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns="*"
testDir="mobile/components/ViewMenu/integration/"
testSWF="ViewMenu.mxml">
<fx:Script><![CDATA[ public static function init(o:DisplayObject):void { } ]]></fx:Script>
<fx:Metadata><![CDATA[ [Mixin] ]]></fx:Metadata>
<fx:Script>
<![CDATA[
import views.*;
import mx.core.FlexGlobals;
]]>
</fx:Script>
<testCases>
<!-- temporary excluded until we have better landscape support from AIR -->
<TestCase testID="LandscapeFiveItemsMenuLandscape1" description="touch item5,click on item 1 to close ViewMenu,open menu, use with 5-way to select" keywords="[ViewMenu, integration]">
<setup>
<RunCode code="FlexGlobals.topLevelApplication.viewMenuOpen=false" />
<Pause timeout="100"/>
<ResetComponent target="navigator" className="spark.components.ViewNavigator" waitEvent="viewChangeComplete" />
<SetProperty target="navigator" propertyName="transitionsEnabled" value="false"/>
<RunCode code="FlexGlobals.topLevelApplication.navigator.pushView(views.ViewMenuItemView5)" waitTarget="navigator" waitEvent="viewChangeComplete" timeout="6000"/>
<RunCode code="FlexGlobals.topLevelApplication.stage.setAspectRatio('landscape') " />
</setup>
<body>
<DispatchKeyEvent keys="[MENU]" waitEvent="viewMenuOpen" waitTarget="navigator.activeView"/>
<Pause timeout="100"/>
<DispatchMouseEvent type="rollOver" target="navigator.activeView.i5" localX="5" localY="5" waitEvent="rollOver"/>
<DispatchMouseEvent type="mouseOver" target="navigator.activeView.i5" localX="5" localY="5" waitEvent="mouseOver"/>
<DispatchMouseEvent type="mouseDown" target="navigator.activeView.i5" localX="5" localY="5" waitEvent="updateComplete"/>
<DispatchMouseClickEvent target="navigator.activeView.i5" localX="5" localY="5" waitEvent="viewMenuClose" waitTarget="navigator.activeView"/>
<AssertPropertyValue target="navigator.activeView.btn" propertyName="label" value="click5"/>
<DispatchKeyEvent keys="[MENU]" waitEvent="viewMenuOpen" waitTarget="navigator.activeView"/>
<Pause timeout="100"/>
<DispatchKeyEvent keyLocation="4" keyCode="40" waitTarget="navigator.activeView.i1" waitEvent="updateComplete" />
<DispatchKeyEvent keyLocation="4" keyCode="37" waitTarget="navigator.activeView.i1" waitEvent="updateComplete" />
<CompareBitmap numColorVariances="5" maxColorVariance="15" url="../integration/baselines/$testID.png" target="navigator.activeView.i2.owner" />
<AssertPropertyValue target="navigator.activeView.btn" propertyName="label" value="click5"/>
<DispatchMouseClickEvent target="navigator.activeView" localX="20" localY="20" waitEvent="viewMenuClose"/>
</body>
</TestCase>
<TestCase testID="LandscapeFiveItemsMenuLandscape2" description="use 5-way to navigate, close, open again" keywords="[ViewMenu, integration]">
<setup>
<RunCode code="FlexGlobals.topLevelApplication.viewMenuOpen=false" />
<Pause timeout="100"/>
<ResetComponent target="navigator" className="spark.components.ViewNavigator" waitEvent="viewChangeComplete" />
<SetProperty target="navigator" propertyName="transitionsEnabled" value="false"/>
<RunCode code="FlexGlobals.topLevelApplication.navigator.pushView(views.ViewMenuItemView5)" waitTarget="navigator" waitEvent="viewChangeComplete" timeout="6000"/>
<RunCode code="FlexGlobals.topLevelApplication.stage.setAspectRatio('landscape') " />
<DispatchMouseClickEvent target="navigator.activeView.btn" localX="10" localY="10" waitEvent="click"/>
<SetProperty target="navigator.activeView.btn" propertyName="label" value="lbl" />
</setup>
<body>
<DispatchKeyEvent keys="[MENU]" waitEvent="viewMenuOpen" waitTarget="navigator.activeView"/>
<Pause timeout="100"/>
<DispatchKeyEvent keyLocation="4" keyCode="40" waitTarget="navigator.activeView.i1" waitEvent="updateComplete" />
<DispatchKeyEvent keyLocation="4" keyCode="39" waitTarget="navigator.activeView.i2" waitEvent="updateComplete" />
<CompareBitmap numColorVariances="5" maxColorVariance="15" url="../integration/baselines/$testID.png" target="navigator.activeView.i2.owner" />
<DispatchKeyEvent keyLocation="4" keyCode="13" waitTarget="navigator.activeView" waitEvent="viewMenuClose" />
<AssertPropertyValue target="navigator.activeView.btn" propertyName="label" value="click2"/>
<DispatchKeyEvent keys="[MENU]" waitEvent="viewMenuOpen" waitTarget="navigator.activeView"/>
<Pause timeout="100"/>
<DispatchKeyEvent keyLocation="4" keyCode="40" waitTarget="navigator.activeView.i1" waitEvent="updateComplete" />
<DispatchKeyEvent keyLocation="4" keyCode="37" waitTarget="navigator.activeView.i1" waitEvent="updateComplete" />
<DispatchKeyEvent keyLocation="4" keyCode="13" waitTarget="navigator.activeView.i4" />
<AssertPropertyValue target="navigator.activeView.btn" propertyName="label" value="click1"/>
</body>
</TestCase>
<TestCase testID="LandscapeFiveItemsMenuLandscape3" description="mouseOver item 1, move to item5, click " keywords="[ViewMenu, integration]">
<setup>
<RunCode code="FlexGlobals.topLevelApplication.viewMenuOpen=false" />
<Pause timeout="100"/>
<ResetComponent target="navigator" className="spark.components.ViewNavigator" waitEvent="viewChangeComplete" />
<SetProperty target="navigator" propertyName="transitionsEnabled" value="false"/>
<RunCode code="FlexGlobals.topLevelApplication.navigator.pushView(views.ViewMenuItemView5)" waitTarget="navigator" waitEvent="viewChangeComplete" timeout="6000"/>
<RunCode code="FlexGlobals.topLevelApplication.stage.setAspectRatio('landscape') " />
<DispatchMouseClickEvent target="navigator.activeView.btn" localX="10" localY="10" waitEvent="click"/>
<SetProperty target="navigator.activeView.btn" propertyName="label" value="lbl" />
</setup>
<body>
<DispatchKeyEvent keys="[MENU]" waitEvent="viewMenuOpen" waitTarget="navigator.activeView"/>
<Pause timeout="100"/>
<DispatchMouseEvent type="rollOver" target="navigator.activeView.i1" localX="5" localY="5" waitEvent="rollOver"/>
<DispatchMouseEvent type="mouseOver" target="navigator.activeView.i1" localX="5" localY="5" waitEvent="mouseOver"/>
<DispatchMouseEvent type="mouseDown" target="navigator.activeView.i1" localX="5" localY="5" waitEvent="updateComplete"/>
<DispatchMouseEvent type="mouseUp" target="navigator.activeView.i1" localX="5" localY="5" waitEvent="mouseUp"/>
<DispatchMouseEvent type="mouseOut" target="navigator.activeView.i1" localX="5" localY="5" waitEvent="mouseOut"/>
<DispatchMouseEvent type="rollOut" target="navigator.activeView.i1" localX="10" localY="10" waitEvent="rollOut"/>
<DispatchMouseEvent type="mouseMove" target="navigator.activeView.i5" localX="5" localY="5" waitEvent="mouseMove"/>
<DispatchMouseEvent type="rollOver" target="navigator.activeView.i5" localX="5" localY="5" waitEvent="rollOver"/>
<DispatchMouseEvent type="mouseOver" target="navigator.activeView.i5" localX="5" localY="5" waitEvent="mouseOver"/>
<DispatchMouseEvent type="mouseDown" target="navigator.activeView.i5" localX="5" localY="5" waitEvent="updateComplete"/>
<DispatchMouseEvent type="mouseUp" target="navigator.activeView.i5" localX="5" localY="5" waitEvent="mouseUp"/>
<CompareBitmap numColorVariances="5" maxColorVariance="15" url="../integration/baselines/$testID.png" target="navigator.activeView.i2.owner" />
<AssertPropertyValue target="navigator.activeView.btn" propertyName="label" value="lbl"/>
<DispatchMouseEvent type="click" target="navigator.activeView.i5" localX="5" localY="5" waitEvent="viewMenuClose" waitTarget="navigator.activeView"/>
<AssertPropertyValue target="navigator.activeView.btn" propertyName="label" value="click5"/>
</body>
</TestCase>
<TestCase testID="LandscapeFiveItemsMenuLandscape4" description="mouseOver item 2, move to item4, click " keywords="[ViewMenu, integration]">
<setup>
<RunCode code="FlexGlobals.topLevelApplication.viewMenuOpen=false" />
<Pause timeout="100"/>
<ResetComponent target="navigator" className="spark.components.ViewNavigator" waitEvent="viewChangeComplete" />
<SetProperty target="navigator" propertyName="transitionsEnabled" value="false"/>
<RunCode code="FlexGlobals.topLevelApplication.navigator.pushView(views.ViewMenuItemView5)" waitTarget="navigator" waitEvent="viewChangeComplete" timeout="6000"/>
<RunCode code="FlexGlobals.topLevelApplication.stage.setAspectRatio('landscape') " />
<DispatchMouseClickEvent target="navigator.activeView.btn" localX="10" localY="10" waitEvent="click"/>
<SetProperty target="navigator.activeView.btn" propertyName="label" value="lbl" />
</setup>
<body>
<DispatchKeyEvent keys="[MENU]" waitEvent="viewMenuOpen" waitTarget="navigator.activeView"/>
<Pause timeout="100"/>
<DispatchMouseEvent type="rollOver" target="navigator.activeView.i2" localX="5" localY="5" waitEvent="rollOver"/>
<DispatchMouseEvent type="mouseOver" target="navigator.activeView.i2" localX="5" localY="5" waitEvent="mouseOver"/>
<DispatchMouseEvent type="mouseDown" target="navigator.activeView.i2" localX="5" localY="5" waitEvent="updateComplete"/>
<DispatchMouseEvent type="mouseUp" target="navigator.activeView.i2" localX="5" localY="5" waitEvent="mouseUp"/>
<DispatchMouseEvent type="mouseOut" target="navigator.activeView.i2" localX="5" localY="5" waitEvent="mouseOut"/>
<DispatchMouseEvent type="rollOut" target="navigator.activeView.i2" localX="10" localY="10" waitEvent="rollOut"/>
<DispatchMouseEvent type="mouseMove" target="navigator.activeView.i4" localX="5" localY="5" waitEvent="mouseMove"/>
<DispatchMouseEvent type="rollOver" target="navigator.activeView.i4" localX="5" localY="5" waitEvent="rollOver"/>
<DispatchMouseEvent type="mouseOver" target="navigator.activeView.i4" localX="5" localY="5" waitEvent="mouseOver"/>
<DispatchMouseEvent type="mouseDown" target="navigator.activeView.i4" localX="5" localY="5" waitEvent="updateComplete"/>
<DispatchMouseEvent type="mouseUp" target="navigator.activeView.i4" localX="5" localY="5" waitEvent="mouseUp"/>
<CompareBitmap numColorVariances="5" maxColorVariance="15" url="../integration/baselines/$testID.png" target="navigator.activeView.i4" />
<DispatchMouseEvent type="click" target="navigator.activeView.i4" localX="5" localY="5" waitEvent="viewMenuClose" waitTarget="navigator.activeView"/>
<AssertPropertyValue target="navigator.activeView.btn" propertyName="label" value="click4"/>
</body>
</TestCase>
<TestCase testID="LandscapeFiveItemsMenuLandscape5" description="use 5-way to put item5 in caret, mouseClick on item3" keywords="[ViewMenu, integration]">
<setup>
<RunCode code="FlexGlobals.topLevelApplication.viewMenuOpen=false" />
<Pause timeout="100"/>
<ResetComponent target="navigator" className="spark.components.ViewNavigator" waitEvent="viewChangeComplete" />
<SetProperty target="navigator" propertyName="transitionsEnabled" value="false"/>
<RunCode code="FlexGlobals.topLevelApplication.navigator.pushView(views.ViewMenuItemView5)" waitTarget="navigator" waitEvent="viewChangeComplete" timeout="6000"/>
<RunCode code="FlexGlobals.topLevelApplication.stage.setAspectRatio('landscape') " />
<DispatchMouseClickEvent target="navigator.activeView.btn" localX="10" localY="10" waitEvent="click"/>
<SetProperty target="navigator.activeView.btn" propertyName="label" value="lbl" />
</setup>
<body>
<DispatchKeyEvent keys="[MENU]" waitEvent="viewMenuOpen" waitTarget="navigator.activeView"/>
<Pause timeout="100"/>
<DispatchKeyEvent keyLocation="4" keyCode="40" waitTarget="navigator.activeView.i1" waitEvent="updateComplete" />
<DispatchKeyEvent keyLocation="4" keyCode="39" waitTarget="navigator.activeView.i2" waitEvent="updateComplete" />
<DispatchMouseEvent type="rollOver" target="navigator.activeView.i3" localX="5" localY="5" waitEvent="rollOver"/>
<DispatchMouseEvent type="mouseOver" target="navigator.activeView.i3" localX="5" localY="5" waitEvent="mouseOver"/>
<DispatchMouseEvent type="mouseDown" target="navigator.activeView.i3" localX="5" localY="5" waitEvent="updateComplete"/>
<CompareBitmap numColorVariances="5" maxColorVariance="15" url="../integration/baselines/$testID.png" target="navigator.activeView.i3.owner" />
<DispatchMouseClickEvent target="navigator.activeView.i3" localX="5" localY="5" waitEvent="viewMenuClose" waitTarget="navigator.activeView"/>
<AssertPropertyValue target="navigator.activeView.btn" propertyName="label" value="click3"/>
</body>
</TestCase>
<TestCase testID="LandscapeFiveItemsMenuLandscape6" description="Five Items menu portrait 5-way, touch combo" keywords="[ViewMenu, integration]">
<setup>
<RunCode code="FlexGlobals.topLevelApplication.viewMenuOpen=false" />
<Pause timeout="100"/>
<ResetComponent target="navigator" className="spark.components.ViewNavigator" waitEvent="viewChangeComplete" />
<SetProperty target="navigator" propertyName="transitionsEnabled" value="false"/>
<RunCode code="FlexGlobals.topLevelApplication.navigator.pushView(views.ViewMenuItemView5)" waitTarget="navigator" waitEvent="viewChangeComplete" timeout="6000"/>
<RunCode code="FlexGlobals.topLevelApplication.stage.setAspectRatio('landscape') " />
<DispatchMouseClickEvent target="navigator.activeView.btn" localX="10" localY="10" waitEvent="click"/>
<SetProperty target="navigator.activeView.btn" propertyName="label" value="lbl"/>
</setup>
<body>
<DispatchKeyEvent keys="[MENU]" waitEvent="viewMenuOpen" waitTarget="navigator.activeView"/>
<Pause timeout="100"/>
<DispatchKeyEvent keyLocation="4" keyCode="40" waitTarget="navigator.activeView.i1" waitEvent="updateComplete" />
<DispatchKeyEvent keyLocation="4" keyCode="37" waitTarget="navigator.activeView.i1" waitEvent="updateComplete" />
<CompareBitmap numColorVariances="5" maxColorVariance="15" url="../integration/baselines/$testID.png" target="navigator.activeView.i2.owner" />
<DispatchMouseEvent type="rollOver" target="navigator.activeView.i4" localX="5" localY="5" waitEvent="rollOver"/>
<DispatchMouseEvent type="mouseOver" target="navigator.activeView.i4" localX="5" localY="5" waitEvent="mouseOver"/>
<DispatchMouseEvent type="mouseDown" target="navigator.activeView.i4" localX="5" localY="5" waitEvent="updateComplete"/>
<DispatchMouseEvent type="mouseUp" target="navigator.activeView.i4" localX="5" localY="5" waitEvent="updateComplete"/>
<AssertPropertyValue target="navigator.activeView.btn" propertyName="label" value="lbl"/>
<DispatchMouseClickEvent target="navigator.activeView" localX="20" localY="20" waitEvent="viewMenuClose"/>
</body>
</TestCase>
<TestCase testID="LandscapeFiveItemsMenuLandscape7" description="Five Items menu portrait 5-way" keywords="[ViewMenu, integration]">
<setup>
<RunCode code="FlexGlobals.topLevelApplication.viewMenuOpen=false" />
<Pause timeout="100"/>
<ResetComponent target="navigator" className="spark.components.ViewNavigator" waitEvent="viewChangeComplete" />
<SetProperty target="navigator" propertyName="transitionsEnabled" value="false"/>
<RunCode code="FlexGlobals.topLevelApplication.navigator.pushView(views.ViewMenuItemView5)" waitTarget="navigator" waitEvent="viewChangeComplete" timeout="6000"/>
<RunCode code="FlexGlobals.topLevelApplication.stage.setAspectRatio('landscape') " />
<DispatchMouseClickEvent target="navigator.activeView.btn" localX="10" localY="10" waitEvent="click"/>
<SetProperty target="navigator.activeView.btn" propertyName="label" value="lbl"/>
</setup>
<body>
<DispatchKeyEvent keys="[MENU]" waitEvent="viewMenuOpen" waitTarget="navigator.activeView"/>
<Pause timeout="100"/>
<DispatchKeyEvent keyLocation="4" keyCode="40" waitTarget="navigator.activeView.i1" waitEvent="updateComplete" />
<DispatchKeyEvent keyLocation="4" keyCode="39" waitTarget="navigator.activeView.i2" waitEvent="updateComplete" />
<DispatchMouseEvent type="rollOver" target="navigator.activeView.i2" localX="5" localY="5" waitEvent="rollOver"/>
<DispatchMouseEvent type="mouseOver" target="navigator.activeView.i2" localX="5" localY="5" waitEvent="mouseOver"/>
<DispatchMouseEvent type="mouseDown" target="navigator.activeView.i2" localX="5" localY="5" waitEvent="updateComplete"/>
<DispatchMouseEvent type="mouseUp" target="navigator.activeView.i2" localX="5" localY="5" waitEvent="updateComplete"/>
<CompareBitmap numColorVariances="5" maxColorVariance="15" url="../integration/baselines/$testID.png" target="navigator.activeView.i1.owner" />
<DispatchMouseClickEvent target="navigator.activeView.btn" localX="10" localY="10" waitEvent="click"/>
</body>
</TestCase>
<TestCase testID="LandscapeFiveItemsMenuLandscape8" description="Five Items menu portrait 5-way" keywords="[ViewMenu, integration]">
<setup>
<RunCode code="FlexGlobals.topLevelApplication.viewMenuOpen=false" />
<Pause timeout="100"/>
<ResetComponent target="navigator" className="spark.components.ViewNavigator" waitEvent="viewChangeComplete" />
<SetProperty target="navigator" propertyName="transitionsEnabled" value="false"/>
<RunCode code="FlexGlobals.topLevelApplication.navigator.pushView(views.ViewMenuItemView5)" waitTarget="navigator" waitEvent="viewChangeComplete" timeout="6000"/>
<RunCode code="FlexGlobals.topLevelApplication.stage.setAspectRatio('landscape') " />
<DispatchMouseClickEvent target="navigator.activeView.btn" localX="10" localY="10" waitEvent="click"/>
<SetProperty target="navigator.activeView.btn" propertyName="label" value="lbl"/>
</setup>
<body>
<DispatchKeyEvent keys="[MENU]" waitEvent="viewMenuOpen" waitTarget="navigator.activeView"/>
<Pause timeout="100"/>
<DispatchKeyEvent keyLocation="4" keyCode="40" waitTarget="navigator.activeView.i1" waitEvent="updateComplete" />
<DispatchKeyEvent keyLocation="4" keyCode="39" waitTarget="navigator.activeView.i2" waitEvent="updateComplete" />
<DispatchKeyEvent keyLocation="4" keyCode="40" waitTarget="navigator.activeView.i4" waitEvent="updateComplete" />
<CompareBitmap numColorVariances="5" maxColorVariance="15" url="../integration/baselines/$testID.png" target="navigator.activeView.i2.owner" />
<AssertPropertyValue target="navigator.activeView.btn" propertyName="label" value="lbl"/>
<DispatchMouseClickEvent target="navigator.activeView" localX="20" localY="20" waitEvent="viewMenuClose"/>
</body>
</TestCase>
<TestCase testID="LandscapeFiveItemsMenuLandscape9" description="Five Items menu portrait 5-way" keywords="[ViewMenu, integration]">
<setup>
<RunCode code="FlexGlobals.topLevelApplication.viewMenuOpen=false" />
<Pause timeout="100"/>
<ResetComponent target="navigator" className="spark.components.ViewNavigator" waitEvent="viewChangeComplete" />
<SetProperty target="navigator" propertyName="transitionsEnabled" value="false"/>
<RunCode code="FlexGlobals.topLevelApplication.navigator.pushView(views.ViewMenuItemView5)" waitTarget="navigator" waitEvent="viewChangeComplete" timeout="6000"/>
<RunCode code="FlexGlobals.topLevelApplication.stage.setAspectRatio('landscape') " />
<DispatchMouseClickEvent target="navigator.activeView.btn" localX="10" localY="10" waitEvent="click"/>
<SetProperty target="navigator.activeView.btn" propertyName="label" value="lbl"/>
</setup>
<body>
<DispatchKeyEvent keys="[MENU]" waitEvent="viewMenuOpen" waitTarget="navigator.activeView"/>
<Pause timeout="100"/>
<DispatchKeyEvent keyLocation="4" keyCode="40" waitTarget="navigator.activeView.i1" waitEvent="updateComplete" />
<DispatchKeyEvent keyLocation="4" keyCode="39" waitTarget="navigator.activeView.i2" waitEvent="updateComplete" />
<CompareBitmap numColorVariances="5" maxColorVariance="15" url="../integration/baselines/$testID.png" target="navigator.activeView.i2.owner" />
<DispatchKeyEvent keyLocation="4" keyCode="13" waitTarget="navigator.activeView" waitEvent="viewMenuClose" />
</body>
</TestCase>
</testCases>
</UnitTester>