| <?xml version="1.0" encoding="utf-8"?> |
| <UnitTester 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="*" |
| testDir="mobile/components/CalloutButton/properties/" |
| testSWF="CalloutTest.mxml"> |
| |
| <fx:Script> |
| <![CDATA[ |
| import comps.*; |
| import views.*; |
| |
| import mx.core.FlexGlobals; |
| import mx.core.mx_internal; |
| use namespace mx_internal; |
| import spark.core.ContainerDestructionPolicy; |
| import spark.layouts.*; |
| public static function init(o:DisplayObject):void { } |
| |
| |
| |
| ]]> |
| </fx:Script> |
| |
| <fx:Metadata><![CDATA[ [Mixin] ]]></fx:Metadata> |
| |
| <testCases> |
| <TestCase testID="CalloutButton_Label_Simple" keywords="[CalloutButton, label]" description="Setting a simple string to CalloutButton label property"> |
| |
| <setup> |
| <ResetComponent target="navigator" className="comps.QANavigator" waitEvent="viewChangeComplete" /> |
| <RunCode code="application.navigator.pushView(views.CalloutPropertyTest)" waitTarget="navigator" waitEvent="viewChangeComplete"/> |
| <SetProperty target="navigator.activeView.calloutButtonBasic" propertyName="label" value="Callout Button" waitEvent="updateComplete"/> |
| <AssertPropertyValue target="navigator.activeView.calloutButtonBasic" propertyName="label" value="Callout Button"/> |
| |
| </setup> |
| |
| <body> |
| |
| |
| <CompareBitmap url="../properties/baselines" target="navigator.activeView.navigator.activeView.containerBasic"> |
| <ConditionalValue deviceDensity="160" os="win"/> |
| <ConditionalValue deviceDensity="240" os="android"/> |
| <ConditionalValue deviceDensity="320" os="win"/> |
| <ConditionalValue deviceDensity="320" os="ios" /> |
| <ConditionalValue deviceDensity="160" os="qnx" /> |
| </CompareBitmap> |
| |
| </body> |
| </TestCase> |
| <!-- to do null case --> |
| <TestCase testID="CalloutButton_Label_Default" keywords="[CalloutButton, label]" description="checking defautl value for label property of CalloutButton"> |
| |
| <setup> |
| <ResetComponent target="navigator" className="comps.QANavigator" waitEvent="viewChangeComplete" /> |
| <RunCode code="application.navigator.pushView(views.CalloutPropertyTest)" waitTarget="navigator" waitEvent="viewChangeComplete"/> |
| |
| </setup> |
| <body> |
| <AssertPropertyValue target="navigator.activeView.calloutButtonBasic" propertyName="label" value=""/> |
| |
| |
| <CompareBitmap url="../properties/baselines" target="navigator.activeView.navigator.activeView.containerBasic"> |
| <ConditionalValue deviceDensity="160" os="win"/> |
| <ConditionalValue deviceDensity="240" os="android"/> |
| <ConditionalValue deviceDensity="320" os="win"/> |
| <ConditionalValue deviceDensity="320" os="ios" /> |
| <ConditionalValue deviceDensity="160" os="qnx" /> |
| </CompareBitmap> |
| </body> |
| </TestCase> |
| |
| <TestCase testID="CalloutButton_Label_Combination" keywords="[CalloutButton, label]" description="setting a string of mixed characters to label property of CalloutButton"> |
| |
| <setup> |
| <ResetComponent target="navigator" className="comps.QANavigator" waitEvent="viewChangeComplete" /> |
| <RunCode code="application.navigator.pushView(views.CalloutPropertyTest)" waitTarget="navigator" waitEvent="viewChangeComplete"/> |
| <SetProperty target="navigator.activeView.calloutButtonBasic" propertyName="label" value="ab12 àç本 \u00F7\u03C0" waitEvent="updateComplete" /> |
| <AssertPropertyValue target="navigator.activeView.calloutButtonBasic" propertyName="label" value="ab12 àç本 \u00F7\u03C0" /> |
| </setup> |
| <body> |
| |
| <CompareBitmap url="../properties/baselines" target="navigator.activeView.containerBasic"> |
| <ConditionalValue deviceDensity="160" os="win"/> |
| <ConditionalValue deviceDensity="240" os="android"/> |
| <ConditionalValue deviceDensity="320" os="win"/> |
| <ConditionalValue deviceDensity="320" os="ios" /> |
| <ConditionalValue deviceDensity="160" os="qnx" /> </CompareBitmap> |
| </body> |
| </TestCase> |
| |
| <TestCase testID="CalloutButton_Label_Long" keywords="[CalloutButton, label]" description="setting a long string to the label property of CalloutButton"> |
| |
| <setup> |
| <ResetComponent target="navigator" className="comps.QANavigator" waitEvent="viewChangeComplete" /> |
| <RunCode code="application.navigator.pushView(views.CalloutPropertyTest)" waitTarget="navigator" waitEvent="viewChangeComplete"/> <SetProperty target="navigator.activeView.calloutButtonBasic" propertyName="label" value="thisistestingaverylongtitlethatdoesnotfit" waitEvent="updateComplete" /> |
| <AssertPropertyValue target="navigator.activeView.calloutButtonBasic" propertyName="label" value="thisistestingaverylongtitlethatdoesnotfit" /> |
| |
| </setup> |
| <body> |
| <CompareBitmap url="../properties/baselines" target="navigator.activeView.containerBasic"> |
| <ConditionalValue deviceDensity="160" os="win"/> |
| <ConditionalValue deviceDensity="240" os="android"/> |
| <ConditionalValue deviceDensity="320" os="win"/> |
| <ConditionalValue deviceDensity="320" os="ios" /> |
| <ConditionalValue deviceDensity="160" os="qnx" /> </CompareBitmap> |
| </body> |
| </TestCase> |
| <TestCase testID="CalloutButton_Layout_Default" keywords="[CalloutButton, layout, BasicLayout]" description="verify the default callout layout in CalloutButton"> |
| |
| <setup> |
| <ResetComponent target="navigator" className="comps.QANavigator" waitEvent="viewChangeComplete" /> |
| <RunCode code="application.navigator.pushView(views.CalloutPropertyTest)" waitTarget="navigator" waitEvent="viewChangeComplete"/> |
| <SetProperty target="navigator.activeView.calloutButtonBasic" propertyName="label" value="Callout Button" waitEvent="updateComplete" /> |
| <AssertPropertyValue target="navigator.activeView.calloutButtonBasic" propertyName="label" value="Callout Button" /> |
| |
| </setup> |
| <body> |
| <RunCode code="application.navigator.activeView.calloutButtonBasic.openDropDown()" |
| waitTarget="navigator.activeView.calloutButtonBasic" |
| waitEvent="open" /> |
| <AssertMethodValue method="value = application.navigator.activeView.calloutButtonBasic.isDropDownOpen" value="true"/> |
| |
| <SetProperty target="navigator.activeView.calloutButtonBasic" propertyName="calloutContent" valueExpression="value=application.navigator.activeView.arr2Elements" waitEvent="updateComplete" /> |
| <AssertPropertyValue target="navigator.activeView.calloutButtonBasic.calloutContent" propertyName="length" value="2" /> |
| <AssertMethodValue method="value=application.navigator.activeView.calloutButtonBasic.calloutLayout is BasicLayout" value="true" /> |
| <CompareBitmap url="../properties/baselines" target="navigator.activeView.containerBasic"> |
| <ConditionalValue deviceDensity="160" os="win"/> |
| <ConditionalValue deviceDensity="240" os="android"/> |
| <ConditionalValue deviceDensity="320" os="win"/> |
| <ConditionalValue deviceDensity="320" os="ios" /> |
| <ConditionalValue deviceDensity="160" os="qnx" /> </CompareBitmap> |
| </body> |
| </TestCase> |
| <TestCase testID="CalloutButton_Layout_Vertical" keywords="[CalloutButton, layout, VerticalLayout]" description="setting VerticalLayout to calloutLayout in CalloutButton"> |
| |
| <setup> |
| <ResetComponent target="navigator" className="comps.QANavigator" waitEvent="viewChangeComplete" /> |
| <RunCode code="application.navigator.pushView(views.CalloutPropertyTest)" waitTarget="navigator" waitEvent="viewChangeComplete"/> |
| <SetProperty target="navigator.activeView.calloutButtonBasic" propertyName="label" value="Callout Button" waitEvent="updateComplete"/> |
| <AssertPropertyValue target="navigator.activeView.calloutButtonBasic" propertyName="label" value="Callout Button" /> |
| |
| </setup> |
| <body> |
| |
| <RunCode code="application.navigator.activeView.calloutButtonBasic.openDropDown()" |
| waitTarget="navigator.activeView.calloutButtonBasic" |
| waitEvent="open" /> |
| |
| <SetProperty target="navigator.activeView.calloutButtonBasic" propertyName="calloutLayout" valueExpression="value=application.navigator.activeView.vertical" /> |
| <AssertMethodValue method="value = application.navigator.activeView.calloutButtonBasic.isDropDownOpen" value="true"/> |
| <SetProperty target="navigator.activeView.calloutButtonBasic" propertyName="calloutContent" valueExpression="value=application.navigator.activeView.arr2Elements" waitEvent="updateComplete" /> |
| <AssertPropertyValue target="navigator.activeView.calloutButtonBasic.calloutContent" propertyName="length" value="2" /> |
| |
| <AssertMethodValue method="value=application.navigator.activeView.calloutButtonBasic.calloutLayout is VerticalLayout" value="true" /> |
| <CompareBitmap url="../properties/baselines" target="navigator.activeView.containerBasic"> |
| <ConditionalValue deviceDensity="160" os="win"/> |
| <ConditionalValue deviceDensity="240" os="android"/> |
| <ConditionalValue deviceDensity="320" os="win"/> |
| <ConditionalValue deviceDensity="320" os="ios" /> |
| <ConditionalValue deviceDensity="160" os="qnx" /> </CompareBitmap> |
| </body> |
| </TestCase> |
| <TestCase testID="CalloutButton_Layout_Horizontal" keywords="[CalloutButton, layout, HorizontalLayout]" description="setting HorizontalLayout to calloutLayout property in CalloutButton"> |
| |
| <setup> |
| <ResetComponent target="navigator" className="comps.QANavigator" waitEvent="viewChangeComplete" /> |
| <RunCode code="application.navigator.pushView(views.CalloutPropertyTest)" waitTarget="navigator" waitEvent="viewChangeComplete"/> |
| <SetProperty target="navigator.activeView.calloutButtonBasic" propertyName="label" value="Callout Button" waitEvent="updateComplete" /> |
| <AssertPropertyValue target="navigator.activeView.calloutButtonBasic" propertyName="label" value="Callout Button" /> |
| |
| </setup> |
| <body> |
| <RunCode code="application.navigator.activeView.calloutButtonBasic.openDropDown()" |
| waitTarget="navigator.activeView.calloutButtonBasic" |
| waitEvent="open" /> |
| <AssertMethodValue method="value = application.navigator.activeView.calloutButtonBasic.isDropDownOpen" value="true"/> |
| |
| <SetProperty target="navigator.activeView.calloutButtonBasic" propertyName="calloutLayout" valueExpression="value=application.navigator.activeView.horizontal" /> |
| |
| <SetProperty target="navigator.activeView.calloutButtonBasic" propertyName="calloutContent" valueExpression="value=application.navigator.activeView.arr2Elements" waitEvent="updateComplete" /> |
| <AssertPropertyValue target="navigator.activeView.calloutButtonBasic.calloutContent" propertyName="length" value="2" /> |
| |
| <AssertMethodValue method="value=application.navigator.activeView.calloutButtonBasic.calloutLayout is HorizontalLayout" value="true" /> |
| <CompareBitmap url="../properties/baselines" target="navigator.activeView.containerBasic"> |
| <ConditionalValue deviceDensity="160" os="win"/> |
| <ConditionalValue deviceDensity="240" os="android"/> |
| <ConditionalValue deviceDensity="320" os="win"/> |
| <ConditionalValue deviceDensity="320" os="ios" /> |
| <ConditionalValue deviceDensity="160" os="qnx" /> </CompareBitmap> |
| </body> |
| </TestCase> |
| <TestCase testID="CalloutButton_Layout_SetTwice" keywords="[CalloutButton, layout]" description="setting callutLayout before and after opening callout in calloutbutton"> |
| |
| <setup> |
| <ResetComponent target="navigator" className="comps.QANavigator" waitEvent="viewChangeComplete" /> |
| <RunCode code="application.navigator.pushView(views.CalloutPropertyTest)" waitTarget="navigator" waitEvent="viewChangeComplete"/> |
| <SetProperty target="navigator.activeView.calloutButtonBasic" propertyName="label" value="Callout Button" waitEvent="updateComplete" /> |
| <AssertPropertyValue target="navigator.activeView.calloutButtonBasic" propertyName="label" value="Callout Button" /> |
| |
| </setup> |
| <body> |
| <SetProperty target="navigator.activeView.calloutButtonBasic" propertyName="calloutLayout" valueExpression="value=application.navigator.activeView.horizontal" /> |
| <AssertMethodValue method="value=application.navigator.activeView.calloutButtonBasic.calloutLayout is HorizontalLayout" value="true" /> |
| |
| <RunCode code="application.navigator.activeView.calloutButtonBasic.openDropDown()" |
| waitTarget="navigator.activeView.calloutButtonBasic" |
| waitEvent="open" /> |
| <AssertMethodValue method="value = application.navigator.activeView.calloutButtonBasic.isDropDownOpen" value="true"/> |
| |
| <SetProperty target="navigator.activeView.calloutButtonBasic" propertyName="calloutLayout" valueExpression="value=application.navigator.activeView.vertical" /> |
| |
| <SetProperty target="navigator.activeView.calloutButtonBasic" propertyName="calloutContent" valueExpression="value=application.navigator.activeView.arr2Elements" waitEvent="updateComplete" /> |
| <AssertPropertyValue target="navigator.activeView.calloutButtonBasic.calloutContent" propertyName="length" value="2" /> |
| |
| <AssertMethodValue method="value=application.navigator.activeView.calloutButtonBasic.calloutLayout is HorizontalLayout" value="false" /> |
| <CompareBitmap url="../properties/baselines" target="navigator.activeView.containerBasic"> |
| <ConditionalValue deviceDensity="160" os="win"/> |
| <ConditionalValue deviceDensity="240" os="android"/> |
| <ConditionalValue deviceDensity="320" os="win"/> |
| <ConditionalValue deviceDensity="320" os="ios" /> |
| <ConditionalValue deviceDensity="160" os="qnx" /> </CompareBitmap> |
| </body> |
| </TestCase> |
| <TestCase testID="CalloutButton_Layout_AssertOnClose_DestAUTO" keywords="[CalloutButton, layout]" description="setting layout after open, then close, then verify callout is null"> |
| |
| <setup> |
| <ResetComponent target="navigator" className="comps.QANavigator" waitEvent="viewChangeComplete" /> |
| <RunCode code="application.navigator.pushView(views.CalloutPropertyTest)" waitTarget="navigator" waitEvent="viewChangeComplete"/> |
| <SetProperty target="navigator.activeView.calloutButtonBasic" propertyName="label" value="Callout Button" waitEvent="updateComplete"/> |
| <AssertPropertyValue target="navigator.activeView.calloutButtonBasic" propertyName="label" value="Callout Button" /> |
| |
| </setup> |
| <body> |
| <SetProperty target="navigator.activeView.calloutButtonBasic" propertyName="calloutLayout" valueExpression="value=application.navigator.activeView.vertical" /> |
| |
| <RunCode code="application.navigator.activeView.calloutButtonBasic.openDropDown()" |
| waitTarget="navigator.activeView.calloutButtonBasic" |
| waitEvent="open" /> |
| |
| <AssertMethodValue method="value = application.navigator.activeView.calloutButtonBasic.isDropDownOpen" value="true"/> |
| |
| |
| <RunCode code="application.navigator.activeView.calloutButtonBasic.closeDropDown()" |
| waitTarget="navigator.activeView.calloutButtonBasic" |
| waitEvent="close" /> |
| <AssertMethodValue method="value = application.navigator.activeView.calloutButtonBasic.isDropDownOpen" value="false"/> |
| |
| <SetProperty target="navigator.activeView.calloutButtonBasic" propertyName="calloutLayout" valueExpression="value=application.navigator.activeView.vertical" /> |
| <!-- verify callout is null --> |
| <AssertMethodValue method="value = (application.navigator.activeView.calloutButtonBasic.callout == null)" value="true"/> |
| |
| |
| </body> |
| </TestCase> |
| <TestCase testID="CalloutButton_Layout_AssertOnClose_DestNONE" keywords="[CalloutButton, layout]" description="setting layout before open, setting destructionpolicy to never, assert layout and callout is not null on close"> |
| |
| <setup> |
| <ResetComponent target="navigator" className="comps.QANavigator" waitEvent="viewChangeComplete" /> |
| <RunCode code="application.navigator.pushView(views.CalloutPropertyTest)" waitTarget="navigator" waitEvent="viewChangeComplete"/> |
| <SetProperty target="navigator.activeView.calloutButtonBasic" propertyName="label" value="Callout Button" waitEvent="updateComplete" /> |
| <AssertPropertyValue target="navigator.activeView.calloutButtonBasic" propertyName="label" value="Callout Button" /> |
| |
| </setup> |
| <body> |
| <SetProperty target="navigator.activeView.calloutButtonBasic" propertyName="calloutLayout" valueExpression="value=application.navigator.activeView.vertical" /> |
| |
| <RunCode code="application.navigator.activeView.calloutButtonBasic.calloutDestructionPolicy = ContainerDestructionPolicy.NEVER"/> |
| <RunCode code="application.navigator.activeView.calloutButtonBasic.openDropDown()" |
| waitTarget="navigator.activeView.calloutButtonBasic" |
| waitEvent="open" /> |
| |
| <AssertMethodValue method="value = application.navigator.activeView.calloutButtonBasic.isDropDownOpen" value="true"/> |
| |
| |
| <RunCode code="application.navigator.activeView.calloutButtonBasic.closeDropDown()" |
| waitTarget="navigator.activeView.calloutButtonBasic" |
| waitEvent="close" /> |
| <AssertMethodValue method="value = application.navigator.activeView.calloutButtonBasic.isDropDownOpen" value="false"/> |
| |
| |
| <!-- verify Callout is not null --> |
| <AssertMethodValue method="value = (application.navigator.activeView.calloutButtonBasic.callout == null)" value="false"/> |
| |
| |
| <SetProperty target="navigator.activeView.calloutButtonBasic" propertyName="calloutLayout" valueExpression="value=application.navigator.activeView.vertical" /> |
| |
| </body> |
| </TestCase> |
| <TestCase testID="CalloutButton_Icon" keywords="[CalloutButton, label]" description="setting icon property for CalloutButton"> |
| |
| <setup> |
| <ResetComponent target="navigator" className="comps.QANavigator" waitEvent="viewChangeComplete" /> |
| <RunCode code="application.navigator.pushView(views.CalloutPropertyTest)" waitTarget="navigator" waitEvent="viewChangeComplete"/> |
| |
| |
| <SetStyle target="navigator.activeView.calloutButtonBasic" styleName="icon" value="@Embed(source='../../../../../Assets/Images/smallredrect.jpg')" waitEvent="updateComplete" /> |
| |
| </setup> |
| <body> |
| |
| <AssertStyleValue target="navigator.activeView.calloutButtonBasic" styleName="icon" value="@Embed(source='../../../../../Assets/Images/smallredrect.jpg')" /> |
| <!--<AssertPropertyValue target="calloutButtonBasic" propertyName="length" value="1" />--> |
| |
| |
| <CompareBitmap url="../properties/baselines" target="navigator.activeView.containerBasic"> |
| <ConditionalValue deviceDensity="160" os="win"/> |
| <ConditionalValue deviceDensity="240" os="android"/> |
| <ConditionalValue deviceDensity="320" os="win"/> |
| <ConditionalValue deviceDensity="320" os="ios" /> |
| <ConditionalValue deviceDensity="160" os="qnx" /> </CompareBitmap> |
| </body> |
| </TestCase> |
| |
| <TestCase testID="CalloutButton_MultiDpiIcon" keywords="[CalloutButton, label]" description="setting icon property with multiDPI values for CalloutButton"> |
| |
| <setup> |
| <ResetComponent target="navigator" className="comps.QANavigator" waitEvent="viewChangeComplete" /> |
| <RunCode code="application.navigator.pushView(views.CalloutPropertyTest)" waitTarget="navigator" waitEvent="viewChangeComplete"/> |
| |
| <SetStyle target="navigator.activeView.calloutButtonBasic" styleName="icon" valueExpression="value=application.navigator.activeView.multiDpiIcon" waitEvent="updateComplete" /> |
| |
| </setup> |
| <body> |
| |
| |
| <!-- to do: investigate the result and update the bitmaps --> |
| <CompareBitmap url="../properties/baselines" target="navigator.activeView.containerBasic"> |
| <ConditionalValue deviceDensity="160" os="win"/> |
| <ConditionalValue deviceDensity="240" os="android"/> |
| <ConditionalValue deviceDensity="320" os="win"/> |
| <ConditionalValue deviceDensity="320" os="ios" /> |
| <ConditionalValue deviceDensity="160" os="qnx" /> </CompareBitmap> |
| </body> |
| </TestCase> |
| <TestCase testID="CalloutButton_CalloutContentDefault" keywords="[CalloutButton, calloutContent]" description="varifying default value of calloutContent in CalloutButton"> |
| |
| <setup> |
| <ResetComponent target="navigator" className="comps.QANavigator" waitEvent="viewChangeComplete" /> |
| <RunCode code="application.navigator.pushView(views.CalloutPropertyTest)" waitTarget="navigator" waitEvent="viewChangeComplete"/> |
| <SetProperty target="navigator.activeView.calloutButtonBasic" propertyName="label" value="Callout Button" waitEvent="updateComplete"/> |
| <AssertPropertyValue target="navigator.activeView.calloutButtonBasic" propertyName="label" value="Callout Button"/> |
| |
| </setup> |
| <body> |
| |
| <RunCode code="application.navigator.activeView.calloutButtonBasic.openDropDown()" |
| waitTarget="navigator.activeView.calloutButtonBasic" |
| waitEvent="open" /> |
| <AssertMethodValue method="value = application.navigator.activeView.calloutButtonBasic.isDropDownOpen" value="true"/> |
| |
| <AssertPropertyValue target="navigator.activeView.calloutButtonBasic" propertyName="calloutContent" value="null" /> |
| |
| |
| <!-- to do: investigate the result and update the bitmaps --> |
| |
| </body> |
| </TestCase> |
| <TestCase testID="CalloutButton_CalloutContent" keywords="[CalloutButton, calloutContent]" description="setting calloutContent in CalloutButton"> |
| |
| <setup> |
| <ResetComponent target="navigator" className="comps.QANavigator" waitEvent="viewChangeComplete" /> |
| <RunCode code="application.navigator.pushView(views.CalloutPropertyTest)" waitTarget="navigator" waitEvent="viewChangeComplete"/> |
| <SetProperty target="navigator.activeView.calloutButtonBasic" propertyName="label" value="Callout Button" waitEvent="updateComplete"/> |
| <AssertPropertyValue target="navigator.activeView.calloutButtonBasic" propertyName="label" value="Callout Button"/> |
| |
| </setup> |
| <body> |
| |
| <RunCode code="application.navigator.activeView.calloutButtonBasic.openDropDown()" |
| waitTarget="navigator.activeView.calloutButtonBasic" |
| waitEvent="open" /> |
| <AssertMethodValue method="value = application.navigator.activeView.calloutButtonBasic.isDropDownOpen" value="true"/> |
| <SetProperty target="navigator.activeView.calloutButtonBasic" propertyName="calloutContent" valueExpression="value=application.navigator.activeView.arr2Elements" waitEvent="updateComplete"/> |
| |
| <AssertPropertyValue target="navigator.activeView.calloutButtonBasic.calloutContent" propertyName="length" value="2" /> |
| |
| |
| </body> |
| </TestCase> |
| </testCases> |
| </UnitTester> |