Beispiel #1
0
//		string _isRatetheApp = "false";
//		[TestVariable("635e797b-0685-4779-afc7-0c158b0b4142")]
//		public string isRatetheApp
//		{
//			get { return _isRatetheApp; }
//			set { _isRatetheApp = value; }
//		}


        /// <summary>
        /// Performs the playback of actions in this module.
        /// </summary>
        /// <remarks>You should not call this method directly, instead pass the module
        /// instance to the <see cref="TestModuleRunner.Run(ITestModule)"/> method
        /// that will in turn invoke this method.</remarks>
        void ITestModule.Run()
        {
            Mouse.DefaultMoveTime        = 300;
            Keyboard.DefaultKeyPressTime = 100;
            Delay.SpeedFactor            = 1.0;

            string applicationName = TestSuite.Current.Parameters["AppName"];
            string appActivity     = "md558fba4ce7ce0bf1978fcd2662fa3cc65.SplashActivity";

            //appActivity="md56f35e8d86ebdc1429f36073ae400eed3.SplashActivity";
            KeywordImplementation.LaunchAndroidApp(TestSuite.Current.Parameters["Device"], applicationName, appActivity);
            //	KeywordImplementation.LaunchAndroidApp(TestSuite.Current.Parameters["Device"],applicationName,appActivity);

            if (KeywordImplementation.waitForObjectExist(By.Name("OK"), TimeSpan.FromSeconds(5)))
            {
                KeywordImplementation.Click(By.Name("OK"));
            }
            if (isPopup)
            {
                if (KeywordImplementation.waitForObjectExist(By.Name("Not now"), TimeSpan.FromSeconds(1)))
                {
                    KeywordImplementation.Click(By.Name("Not now"));
                }
                else if (KeywordImplementation.waitForObjectExist(By.Name("Später vielleicht"), TimeSpan.FromSeconds(1)))
                {
                    KeywordImplementation.Click(By.Name("Später vielleicht"));
                }
            }

            Report.Info(TestSuite.Current.Parameters["Device"]);
        }
Beispiel #2
0
        /// <summary>
        /// Performs the playback of actions in this module.
        /// </summary>
        /// <remarks>You should not call this method directly, instead pass the module
        /// instance to the <see cref="TestModuleRunner.Run(ITestModule)"/> method
        /// that will in turn invoke this method.</remarks>
        void ITestModule.Run()
        {
            //initialising HI values globally based on the AppBrand.
            BrandBasedHINames();
            Mouse.DefaultMoveTime        = 300;
            Keyboard.DefaultKeyPressTime = 100;
            Delay.SpeedFactor            = 1.0;

            string applicationName = TestSuite.Current.Parameters["AppName"];
            string appActivity     = "md56f35e8d86ebdc1429f36073ae400eed3.SplashActivity";

            KeywordImplementation.LaunchAndroidApp(TestSuite.Current.Parameters["Device"], applicationName, appActivity);
//			KeywordImplementation.LaunchAndroidApp(TestSuite.Current.Parameters["Device"],applicationName,appActivity);

            if (KeywordImplementation.waitForObjectExist(By.Name("OK"), TimeSpan.FromSeconds(5)))
            {
                KeywordImplementation.Click(By.Name("OK"));
            }

            //Handling "Connect to cloud" window
//			if(KeywordImplementation.waitForObjectExist(By.Name("Would you like to connect to cloud ?"),TimeSpan.FromSeconds(2)))
//			{
//				KeywordImplementation.Click(By.Name("NO"));
//				Delay.Seconds(2);
//			}
            Report.Info(TestSuite.Current.Parameters["Device"]);
        }
Beispiel #3
0
        /// <summary>
        /// Performs the playback of actions in this module.
        /// </summary>
        /// <remarks>You should not call this method directly, instead pass the module
        /// instance to the <see cref="TestModuleRunner.Run(ITestModule)"/> method
        /// that will in turn invoke this method.</remarks>
        void ITestModule.Run()
        {
            Mouse.DefaultMoveTime        = 300;
            Keyboard.DefaultKeyPressTime = 100;
            Delay.SpeedFactor            = 1.0;

            string applicationName = TestSuite.Current.Parameters["AppName"];
            string appActivity     = "md5887522972be76f398b6ce0dd53353466.MainActivity";

            //appActivity="md56f35e8d86ebdc1429f36073ae400eed3.SplashActivity";

            KeywordImplementation.LaunchAndroidApp(TestSuite.Current.Parameters["Device"], applicationName, appActivity);

            if (KeywordImplementation.waitForObjectExist(By.Name("Skip"), TimeSpan.FromSeconds(15)))
            {
                KeywordImplementation.Click(By.Name("Skip"));
            }

            Report.Info(TestSuite.Current.Parameters["Device"]);
        }
        /// <summary>
        /// Performs the playback of actions in this module.
        /// </summary>
        /// <remarks>You should not call this method directly, instead pass the module
        /// instance to the <see cref="TestModuleRunner.Run(ITestModule)"/> method
        /// that will in turn invoke this method.</remarks>
        void ITestModule.Run()
        {
            //initialising HI values globally based on the AppBrand.
            BrandBasedHINames();
            Mouse.DefaultMoveTime        = 300;
            Keyboard.DefaultKeyPressTime = 100;
            Delay.SpeedFactor            = 1.0;

            string applicationName = TestSuite.Current.Parameters["AppName"];
            string appActivity     = "md56f35e8d86ebdc1429f36073ae400eed3.SplashActivity";

            try
            {
                KeywordImplementation.LaunchAndroidApp(TestSuite.Current.Parameters["Device"], applicationName, appActivity);

//				KeywordImplementation.LaunchAndroidApp(TestSuite.Current.Parameters["Device"], applicationName, appActivity);
                Report.Info("Platform Version " + ((AndroidDriver <OpenQA.Selenium.Appium.Android.AndroidElement>)Accessor.getDriver()).Capabilities.GetCapability("platformVersion"));               ////..getCapabilities().getCapability("platformVersion")
                Report.Info("Device Name " + ((AndroidDriver <OpenQA.Selenium.Appium.Android.AndroidElement>)Accessor.getDriver()).Capabilities.GetCapability("deviceName"));

                if (KeywordImplementation.waitForObjectExist(By.Name("OK"), TimeSpan.FromSeconds(5)))
                {
                    KeywordImplementation.Click(By.Name("OK"));
                }
                var size = Accessor.getDriver().Manage().Window.Size;

                //Swipe from Bottom to Top and Top to bottom
                //Find swipe start and end point from screen's width and height.
                int  starty = 0, endy = 0, startx = 0;
                bool isTablet = size.Width >= 600;
                starty = (int)(size.Height * 0.50);
                endy   = (int)(size.Height * 0.20);
                startx = size.Width / 2;
                int count = 0;
                while (count != 3 && (!KeywordImplementation.waitForObjectExist(By.Id("Btn_AppInfo_Accept"), TimeSpan.FromSeconds(1))))
                {
                    ((AndroidDriver <OpenQA.Selenium.Appium.Android.AndroidElement>)Accessor.getDriver()).Swipe(startx, starty, startx, endy, 500);
                    count++;
                }
                Report.Success("Welcome Page screen is available");
                Logger.logSnapshot();
                KeywordImplementation.Click(By.Id("CheckBox_AcceptTAndC"));
                KeywordImplementation.Click(By.Id("Btn_AppInfo_Accept"));
                Delay.Seconds(15);
                // For SSO
//				((AndroidDriver<OpenQA.Selenium.Appium.Android.AndroidElement>)Accessor.getDriver()).Swipe(startx, starty, startx, endy, 0);
//				((AndroidDriver<OpenQA.Selenium.Appium.Android.AndroidElement>)Accessor.getDriver()).Swipe(startx, starty, startx, endy, 0);
//				//                KeywordImplementation.SwipeVerticle(3,0.50,0.20,By.XPath("//*[contains(@content-desc,'Yes, Allow')]"));
//				KeywordImplementation.Click(By.XPath("//*[contains(@content-desc,'Yes, Allow')]"));
//
                if (KeywordImplementation.waitForObjectExist(By.Name("Country"), TimeSpan.FromSeconds(3)))
                {
                    KeywordImplementation.Click(By.Name("Done"));
                }

                KeywordImplementation.TypeText(By.Id("Txt_Legitimation_Code1"), "8981");
                KeywordImplementation.TypeText(By.Id("Txt_Legitimation_Code2"), "9313");
                KeywordImplementation.TypeText(By.Id("Txt_Legitimation_Code3"), "9666");
                Report.Success("Access code screeen is available");
                Logger.logSnapshot();
                KeywordImplementation.Click(By.Name("Done"));
                Delay.Seconds(3);

                Ranorex.Report.Success(Accessor.getDriver().FindElement(By.Id("Txt_Legitimation_Msg")).Text);
                Logger.logSnapshot();
                while (count != 3 && (!KeywordImplementation.waitForObjectExist(By.Id("Continue"), TimeSpan.FromSeconds(1))))
                {
                    ((AndroidDriver <OpenQA.Selenium.Appium.Android.AndroidElement>)Accessor.getDriver()).Swipe(startx, starty, startx, endy, 500);
                    count++;
                }
                KeywordImplementation.Click(By.Name("Continue"));
                if (applicationName.Equals("com.connexx.fit2go", StringComparison.CurrentCultureIgnoreCase))
                {
                    KeywordImplementation.Click(By.Name("Done"));
                }

                Ranorex.Report.Success("Customer Ear Molds screen is available");
                Logger.logSnapshot();
                count = 0;
                while (count != 3 && (!KeywordImplementation.waitForObjectExist(By.Id("Btn_CustomMolds_Continue"), TimeSpan.FromSeconds(1))))
                {
                    ((AndroidDriver <OpenQA.Selenium.Appium.Android.AndroidElement>)Accessor.getDriver()).Swipe(startx, starty, startx, endy, 500);
                    count++;
                }
                KeywordImplementation.Click(By.Id("Btn_CustomMolds_Continue"));
                //Selecting the HIs from the list available for recommendation
                //SwitchToChooseHI();

                if (KeywordImplementation.waitForObjectExist(By.Id("Txt_CommonAlert_Title"), TimeSpan.FromSeconds(3)))
                {
                    Ranorex.Report.Success("Security alert has popped up");
                    Logger.logSnapshot();
                    KeywordImplementation.Click(By.Name("OK"));
                }

                Logger.logSnapshot();

                if (TestSuite.Current.Parameters["isTablet"].Equals("True", StringComparison.CurrentCultureIgnoreCase))
                {
                    KeywordImplementation.Click(By.Id("Tab_Cutomer_Settings"));
                }
                else
                {
                    TearDown.CloseApplication();
                    TestModuleRunner.Run(new STSAndBasic.AndroidSetUp());

                    KeywordImplementation.Click(By.Id("Btn_ActionBar_Right"), "Click on Settings");
                }
                Delay.Seconds(2);
                SwitchSettingOmniture(false);
            }
            finally
            {
                if (Accessor.getDriver() != null)
                {
                    Accessor.getDriver().Quit();
                }
            }
        }
        /// <remarks>You should not call this method directly, instead pass the module
        /// instance to the <see cref="TestModuleRunner.Run(ITestModule)"/> method
        /// that will in turn invoke this method.</remarks>
        void ITestModule.Run()
        {
            Mouse.DefaultMoveTime        = 300;
            Keyboard.DefaultKeyPressTime = 100;
            Delay.SpeedFactor            = 1.0;

            string applicationName = TestSuite.Current.Parameters["AppName"];
            string appActivity     = "md558fba4ce7ce0bf1978fcd2662fa3cc65.SplashActivity";

            try
            {
                KeywordImplementation.LaunchAndroidApp(TestSuite.Current.Parameters["Device"], applicationName, appActivity);
                //KeywordImplementation.LaunchAndroidApp(TestSuite.Current.Parameters["Device"],applicationName,appActivity);
                Report.Info("Platform Version " + ((AndroidDriver <OpenQA.Selenium.Appium.Android.AndroidElement>)Accessor.getDriver()).Capabilities.GetCapability("platformVersion"));             ////..getCapabilities().getCapability("platformVersion")
                Report.Info("Device Name " + ((AndroidDriver <OpenQA.Selenium.Appium.Android.AndroidElement>)Accessor.getDriver()).Capabilities.GetCapability("deviceName"));

                if (KeywordImplementation.waitForObjectExist(By.Name("OK"), TimeSpan.FromSeconds(5)))
                {
                    KeywordImplementation.Click(By.Name("OK"));
                }
                var size = Accessor.getDriver().Manage().Window.Size;

                //Swipe from Bottom to Top and Top to bottom
                //Find swipe start and end point from screen's width and height.
                int  starty = 0, endy = 0, startx = 0;
                bool isTablet = size.Width >= 600;
                starty = (int)(size.Height * 0.50);
                endy   = (int)(size.Height * 0.20);
                startx = size.Width / 2;
                int count = 0;
                while (count != 3 && (!KeywordImplementation.waitForObjectExist(By.Name("Accept & Continue"), TimeSpan.FromSeconds(1))))
                {
                    ((AndroidDriver <OpenQA.Selenium.Appium.Android.AndroidElement>)Accessor.getDriver()).Swipe(startx, starty, startx, endy, 500);
                    count++;
                }
                Report.Success("App Info screen is available");
                Logger.logSnapshot();
                KeywordImplementation.Click(By.Name("Accept & Continue"));

                if (KeywordImplementation.waitForObjectExist(By.Name("Welcome to the touchControl app."), TimeSpan.FromSeconds(3)))
                {
                    KeywordImplementation.Click(By.Name("Manual Setup"));
                }

                if (KeywordImplementation.waitForObjectExist(By.Name("Allow"), TimeSpan.FromSeconds(3)))
                {
                    KeywordImplementation.Click(By.Name("Allow"));
                }

                KeywordImplementation.Click(By.Name("Signia Products"));

                //A confirmation sound played from the hearing aids indicates a successful pairing.Did you hear the confirmation sound?
                //	if(KeywordImplementation.waitForObjectExist(By.XPath("//*contains[@value,'']"),TimeSpan.FromSeconds(3)))
                if (KeywordImplementation.waitForObjectExist(By.Id("textViewSoundTest"), TimeSpan.FromSeconds(3)))
                {
                    KeywordImplementation.Click(By.Name("Yes"));
                    Logger.logSnapshot();
                }
                KeywordImplementation.Click(By.Name("Yes"));
                KeywordImplementation.Click(By.Name("6"));
                if (KeywordImplementation.waitForObjectExist(By.Name("Do you use a tinnitus program?"), TimeSpan.FromSeconds(3)))
                {
                    KeywordImplementation.Click(By.Name("Yes"));
                }
                KeywordImplementation.Click(By.Name("6"));

                ////Swipe from Bottom to Top and Top to bottom
                while (count != 3 && (!KeywordImplementation.waitForObjectExist(By.Name("Continue"), TimeSpan.FromSeconds(1))))
                {
                    ((AndroidDriver <OpenQA.Selenium.Appium.Android.AndroidElement>)Accessor.getDriver()).Swipe(startx, starty, startx, endy, 500);
                    count++;
                }
                KeywordImplementation.Click(By.Name("Continue"));


                if (KeywordImplementation.waitForObjectExist(By.Name("Setup is Complete."), TimeSpan.FromSeconds(3)))
                {
                    Ranorex.Report.Success("Setup is completed");
                    Logger.logSnapshot();
                    KeywordImplementation.Click(By.Name("Continue"));
                }
                //Disable Omniture Settings
                if (!Convert.ToBoolean(isOmnitureOn))
                {
                    TapOnSettings();
                    SwitchUsageStatistics(Convert.ToBoolean(isOmnitureOn));
                }


                //Logger.logSnapshot();
            }
            finally
            {
                if (Accessor.getDriver() != null)
                {
                    Accessor.getDriver().Quit();
                }
            }
        }