Esempio n. 1
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()
        {
            //Set HI names based on brand of APP
            BrandBasedHINames();
            string applicationName = TestSuite.Current.Parameters["AppName"];
            //	string appActivity="md56f35e8d86ebdc1429f36073ae400eed3.SplashActivity";
            string appPath = TestSuite.Current.Parameters["AppPath"];

            KeywordImplementation.LaunchiOSApp(new Uri("http://" + TestSuite.Current.Parameters["Uri"] + ":4723/wd/hub"), TestSuite.Current.Parameters["Device"], applicationName, appPath);
            //KeywordImplementation.LaunchiOSApp(new Uri("http://"+TestSuite.Current.Parameters["Uri"]+":4723/wd/hub"),TestSuite.Current.Parameters["Device"],applicationName,appPath);

            if (KeywordImplementation.waitForObjectExist(By.Id("OK"), TimeSpan.FromSeconds(5)))
            {
                KeywordImplementation.Click(By.Id("OK"));
            }
        }
Esempio n. 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()
        {
            string applicationName = TestSuite.Current.Parameters["AppName"];
            string appPath         = TestSuite.Current.Parameters["AppPath"];

            KeywordImplementation.LaunchiOSApp(new Uri("http://" + TestSuite.Current.Parameters["Uri"] + ":4723/wd/hub"), TestSuite.Current.Parameters["Device"], applicationName, appPath);

            if (KeywordImplementation.waitForObjectExist(By.Id("OK"), TimeSpan.FromSeconds(5)))
            {
                KeywordImplementation.Click(By.Id("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"));
                }
            }
        }
Esempio n. 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()
        {
            BrandBasedHINames();
            try
            {
                Report.Info("Brand   " + TestSuite.Current.Parameters["Brand"]);
                Report.Info("Device   " + TestSuite.Current.Parameters["Device"]);
                Report.Info("App   " + TestSuite.Current.Parameters["AppName"]);
                string applicationName = TestSuite.Current.Parameters["AppName"];
                string appPath         = TestSuite.Current.Parameters["AppPath"];

                KeywordImplementation.LaunchiOSApp(new Uri("http://" + TestSuite.Current.Parameters["Uri"] + ":4723/wd/hub"), TestSuite.Current.Parameters["Device"], applicationName, appPath);

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

                /*****************************/
                //Swipe from Bottom to Top
                //Find swipe start and end point from screen's width and height.
                int starty = (int)(size.Height * 0.70);
                int endy   = (int)(size.Height * 0.20);
                int startx = size.Width / 2;

                int count = 0;
                while (count != 3 && (!KeywordImplementation.waitForObjectExist(By.Id("Accept & Continue"), TimeSpan.FromSeconds(1))))
                {
                    ((IOSDriver <IOSElement>)Accessor.getDriver()).Swipe(startx, starty, startx, endy, 1000);
                    count++;
                }
                Report.Success("Welcome Page screen is available");
                KeywordImplementation.Click(By.Id("AgreeCheckBox"));
                Logger.logSnapshot();
                KeywordImplementation.Click(By.Id("Accept & Continue"));
                Delay.Seconds(15);
                if (KeywordImplementation.waitForObjectExist(By.Id("Country"), TimeSpan.FromSeconds(3)))
                {
                    Logger.logSuccess("Country selection screen is shown");
                    Logger.logSnapshot();

                    while (count <= 25 && (!KeywordImplementation.waitForObjectExist(By.Id("Rest of World"), TimeSpan.FromSeconds(1))))
                    {
                        ((IOSDriver <IOSElement>)Accessor.getDriver()).Swipe(startx, starty, startx, endy, 500);
                        count++;
                    }
                    KeywordImplementation.Click(By.Id("Rest of World"));
                    KeywordImplementation.Click(By.Id("Done"));
                }

                KeywordImplementation.TypeText(By.Id("Passcode1"), "8981");
                KeywordImplementation.TypeText(By.Id("Passcode2"), "9313");
                KeywordImplementation.TypeText(By.Id("Passcode3"), "9666");

                Report.Success("Access code screeen is available");
                Logger.logSnapshot();
                KeywordImplementation.Click(By.Id("Done"));

                Delay.Seconds(10);
                Ranorex.Report.Success(Accessor.getDriver().FindElement(By.Id("Code entered successfully.")).Text);
                Logger.logSnapshot();
                KeywordImplementation.Click(By.Id("Continue"));
                if (TestSuite.Current.Parameters["Brand"].Equals("Connexx", StringComparison.CurrentCultureIgnoreCase))
                {
                    KeywordImplementation.Click(By.Name("Done"));
                }

                Ranorex.Report.Success("Customer Ear Molds screen is available");
                Logger.logSnapshot();
                KeywordImplementation.Click(By.Id("Continue"));
                //KeywordImplementation.Click(By.Id("Continue"));

                if (KeywordImplementation.waitForObjectExist(By.XPath("//UIAAlert[@name='Sensitive Client Data']"), TimeSpan.FromSeconds(3)))
                {
                    Ranorex.Report.Success("Security alert has popped up");
                    Logger.logSnapshot();
                    KeywordImplementation.Click(By.Id("OK"));
                }

                Logger.logSnapshot();
                if (TestSuite.Current.Parameters["isTablet"].Equals("True", StringComparison.CurrentCultureIgnoreCase))
                {
                    KeywordImplementation.Click(By.Id("SettingsIcon"));
                }
                else
                {
                    KeywordImplementation.Click(By.Id("NavBarRight"));
                }

                SwitchSettingOmniture(false);

//				}
            }
            finally
            {
                if (Accessor.getDriver() != null)
                {
                    Accessor.getDriver().Quit();
                }
            }
        }
Esempio n. 4
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()
        {
            try
            {
                Report.Info("Brand   " + TestSuite.Current.Parameters["Brand"]);
                Report.Info("Device   " + TestSuite.Current.Parameters["Device"]);
                Report.Info("App   " + TestSuite.Current.Parameters["AppName"]);
                string applicationName = TestSuite.Current.Parameters["AppName"];
                string appPath         = TestSuite.Current.Parameters["AppPath"];

                KeywordImplementation.LaunchiOSApp(new Uri("http://" + TestSuite.Current.Parameters["Uri"] + ":4723/wd/hub"), TestSuite.Current.Parameters["Device"], applicationName, appPath);


                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))))
                {
                    ((IOSDriver <IOSElement>)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(1)))
                {
                    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,'Did you hear the confirmation sound?')]"), TimeSpan.FromSeconds(1)))
                {
                    KeywordImplementation.Click(By.Name("Yes"));
                    Logger.logSnapshot();
                }

                if (KeywordImplementation.waitForObjectExist(By.XPath("//*[contains(@value,'Do you use different hearing programs on your hearing aids for different conditions?')]"), TimeSpan.FromSeconds(1)))
                {
                    KeywordImplementation.Click(By.Name("Yes"));
                    Logger.logSnapshot();
                }
                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))))
                {
                    ((IOSDriver <IOSElement>)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"));
                }


                if (!Convert.ToBoolean(isOmnitureOn))
                {
                    Logger.logInfo("Click on Settings icon");
                    KeywordImplementation.Click(By.Id("Main LowerBar more"));
                    KeywordImplementation.Click(By.Id("switchUsageStatistics"));
                }

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