Exemplo n.º 1
0
        public void ValidateTinnitusMixedMode()
        {
            int check = 0;

            if (KeywordImplementation.waitForObjectExist(By.Id("sliderVolumeControl"), TimeSpan.FromSeconds(1)))
            {
                check++;
                Logger.logSuccess("Slider for volume command is present");
            }
            else
            {
                Logger.logFailure("Slider for volume command is not present");
            }

            if (KeywordImplementation.waitForObjectExist(By.Id("sliderTherapyControl"), TimeSpan.FromSeconds(1)))
            {
                check++;
                Logger.logSuccess("Therapy signal is present");
            }
            else
            {
                Logger.logFailure("Therapy signal is not present");
            }

            if (check == 2)
            {
                Logger.logSuccess("The Tinnitus program is in mixed mode");
            }
            else
            {
                Logger.logFailure("The Tinnitus program is not in mixed mode");
            }
        }
Exemplo n.º 2
0
 public void ClickOnAlertMessageOk()
 {
     if (KeywordImplementation.waitForObjectExist(By.Name("OK"), TimeSpan.FromSeconds(2)))
     {
         KeywordImplementation.Click(By.Name("OK"));
     }
 }
Exemplo 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()
        {
            //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"]);
        }
Exemplo n.º 4
0
        public void ValidateTinnitusMixedMode()
        {
            int mixedModecont = 0;

            if (KeywordImplementation.waitForObjectExist(By.Id("seekBarVolume"), TimeSpan.FromSeconds(1)))
            {
                Logger.logInfo("Slider for volume command is present");
                mixedModecont++;
            }
            else
            {
                Logger.logFailure("The Volume slider is not present");
            }

            if (KeywordImplementation.waitForObjectExist(By.Id("seekBarTinnitusMasker"), TimeSpan.FromSeconds(1)))
            {
                Logger.logInfo("Therapy signal is present");
                mixedModecont++;
            }
            else
            {
                Logger.logFailure("Therapy signal is not present");
            }

            if (mixedModecont == 2)
            {
                Logger.logSuccess("Tinnitus mixed mode present");
            }
            else
            {
                Logger.logFailure("Tinnitus mixed mode not present");
            }
        }
Exemplo n.º 5
0
        private void TapOnObject(string objName)
        {
            //	((AndroidDriver<OpenQA.Selenium.Appium.Android.AndroidElement>)Accessor.getDriver()).BackgroundApp(2);


            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 = (int)(size.Height * 0.50);
            int endy   = (int)(size.Height * 0.80);
            int startx = size.Width / 2;

            ((AndroidDriver <OpenQA.Selenium.Appium.Android.AndroidElement>)Accessor.getDriver()).Swipe(startx, endy, startx, starty, 500);
            ((AndroidDriver <OpenQA.Selenium.Appium.Android.AndroidElement>)Accessor.getDriver()).Swipe(startx, starty, startx, endy, 500);

            int count = 0;

            while (count != 3 && (!KeywordImplementation.waitForObjectExist(By.Name(objName), TimeSpan.FromSeconds(1))))
            {
                ((AndroidDriver <OpenQA.Selenium.Appium.Android.AndroidElement>)Accessor.getDriver()).Swipe(startx, endy, startx, starty, 500);
                count++;
            }

            if (KeywordImplementation.waitForObjectExist(By.Name(objName), TimeSpan.FromSeconds(1)))
            {
                ((AndroidDriver <OpenQA.Selenium.Appium.Android.AndroidElement>)Accessor.getDriver()).FindElementByAndroidUIAutomator("new UiSelector().text(\"" + objName + "\")");
            }
            //KeywordImplementation.Click(By.Name(objName));
        }
Exemplo n.º 6
0
 public void ValidateControlsOnMFHomePage()
 {
     if (KeywordImplementation.waitForObjectExist(By.Id("imgViewSelectedProgram"), TimeSpan.FromSeconds(1)))
     {
         Logger.logSuccess("Brand image exists");
     }
     else
     {
         Logger.logFailure("Brand image do not exists");
     }
     if (KeywordImplementation.waitForObjectExist(By.Id("seekBarVolume"), TimeSpan.FromSeconds(1)))
     {
         Logger.logSuccess("Volume slider exists");
     }
     else
     {
         Logger.logFailure("Volume slider do not exists");
     }
     if (KeywordImplementation.waitForObjectExist(By.Id("btnVolumeMute"), TimeSpan.FromSeconds(1)))
     {
         Logger.logSuccess("Mute button exists");
     }
     else
     {
         Logger.logFailure("Mute button do not exists");
     }
     if (KeywordImplementation.waitForObjectExist(By.Id("imgMoreMenu"), TimeSpan.FromSeconds(1)))
     {
         Logger.logSuccess("Settings Button exists");
     }
     else
     {
         Logger.logFailure("Settings Button do not exists");
     }
 }
Exemplo n.º 7
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"]);
        }
        public void SwitchAudiogramAvailableinEditScreen(bool on, bool alert)
        {
            string message         = null;
            var    switchAudiogram = KeywordImplementation.UIObject(By.Id("switchAudiogramEnable"), TimeSpan.FromSeconds(1));

            if ((on.Equals(true) && (switchAudiogram.GetAttribute("value").Equals("0") || switchAudiogram.GetAttribute("value").Equals("false"))) || (on.Equals(false) && (switchAudiogram.GetAttribute("value").Equals("1") || switchAudiogram.GetAttribute("value").Equals("true"))))
            {
                switchAudiogram.Click();
                message = on?"Switch on the audiogram":"Switch off the audiogram";
                Logger.logInfo(message);
            }
            Logger.logSnapshot();
            if (KeywordImplementation.waitForObjectExist(By.ClassName("UIAAlert"), TimeSpan.FromSeconds(2)))
            {
                if (alert.Equals(true))
                {
                    KeywordImplementation.Click(By.Id("OK"));
                    Logger.logInfo("OK the alert");
                }
                else
                {
                    KeywordImplementation.Click(By.Id("Cancel"));
                    Logger.logInfo("Cancel the alert");
                }
            }
        }
        public void ValidateDeleteClientOption()
        {
            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.20);
            int endy   = (int)(size.Height * 0.50);
            int startx = size.Width / 2;

            int count = 0;

            while (count != 3 && (!KeywordImplementation.waitForObjectExist(By.Id("Delete Client"), TimeSpan.FromSeconds(1))))
            {
                ((IOSDriver <IOSElement>)Accessor.getDriver()).Swipe(startx, endy, startx, starty, 500);
                count++;
            }

            if (KeywordImplementation.waitForObjectExist(By.Id("Delete Client"), TimeSpan.FromSeconds(2)))
            {
                Logger.logSuccess("Delete client option exist");
            }
            else
            {
                Logger.logFailure("Delete client option does not exist");
            }
        }
        public void EditPatient(string lastName, string firstName)
        {
            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 = (int)(size.Height * 0.50);
            int endy   = (int)(size.Height * 0.20);
            int startx = size.Width / 2;

            int count = 0;

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

            Logger.logInfo(string.Format("Edit the patient with info '{0}, {1}'", lastName, firstName));
            KeywordImplementation.TypeText(By.Id("txtLastName"), lastName);
            KeywordImplementation.Click(By.XPath("//UIAWindow[2]//UIAButton[contains(@name,'Done')]"));
            KeywordImplementation.TypeText(By.Id("txtFirstName"), firstName);
            KeywordImplementation.Click(By.XPath("//UIAWindow[2]//UIAButton[contains(@name,'Done')]"));
            //TapOnLeftButton("Press the back key");
        }
Exemplo n.º 11
0
        public void ValidateButtonExist(string buttonName)
        {
            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 = (int)(size.Height * 0.50);
            int endy   = (int)(size.Height * 0.20);
            int startx = size.Width / 2;

            int count = 0;

            while (count != 3 && (!KeywordImplementation.waitForObjectExist(By.Name(buttonName), TimeSpan.FromSeconds(1))))
            {
                ((IOSDriver <IOSElement>)Accessor.getDriver()).Swipe(startx, starty, startx, endy, 500);
                count++;
            }

            if (KeywordImplementation.waitForObjectExist(By.Name(buttonName), TimeSpan.FromSeconds(2)))
            {
                Logger.logSuccess(string.Format("'{0}' is exist", buttonName));
            }
            else
            {
                Logger.logFailure(string.Format("'{0}' does not exist", buttonName));
            }
        }
Exemplo n.º 12
0
        public void ClickRateTheAppNow()
        {
            TestModuleRunner.Run(new AdbClear());
            TestModuleRunner.Run(new AndroidSuiteSetUp());
            CloseApp();
            bool check = false;

            for (int i = 3; i <= 20; i++)
            {
                StartApp(false);
                Logger.logInfo(string.Format("{0} Run of app ", i));
                if (i == 20 && KeywordImplementation.waitForObjectExist(By.Name("Rate the App Now"), TimeSpan.FromSeconds(1)))
                {
                    Logger.logSuccess(string.Format("Rate the app pop-up found at {0}th iteration", i), true);
                    KeywordImplementation.Click(By.Name("Rate the App Now"));
                    check = true;
                    break;
                }
                CloseApp();
            }
            if (!check)
            {
                Logger.logFailure("Rate the app pop-up not found", true);
            }
        }
Exemplo n.º 13
0
 private void PTEDone()
 {
     if (KeywordImplementation.waitForObjectExist(By.Id("Img_PureToneInst_Skip"), TimeSpan.FromSeconds(2)))
     {
         KeywordImplementation.Click(By.Id("Img_PureToneInst_Skip"));
     }
     KeywordImplementation.Click(By.Id("ImgBtn_PureToneInst_Next"));
 }
Exemplo n.º 14
0
 private void TapOnOk()
 {
     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"));
     }
 }
Exemplo n.º 15
0
 private void SelectCustoEarMoldContinue()
 {
     Logger.logInfo("Select Custom Ear Molds Continue");
     KeywordImplementation.Click(By.Id("Btn_CustomMolds_Continue"));
     if (KeywordImplementation.waitForObjectExist(By.Name("OK"), TimeSpan.FromSeconds(5)))
     {
         KeywordImplementation.Click(By.Name("OK"));
     }
 }
Exemplo n.º 16
0
 public void PermissionPopUpHandle()
 {
     if (KeywordImplementation.waitForObjectExist(By.Name("ALLOW"), TimeSpan.FromSeconds(3)))
     {
         KeywordImplementation.Click(By.Name("ALLOW"));
     }
     else if (KeywordImplementation.waitForObjectExist(By.Name("Allow"), TimeSpan.FromSeconds(3)))
     {
         KeywordImplementation.Click(By.Name("Allow"));
     }
 }
        public void TapOnRecommendedHearingAid(string objectName)
        {
            var size   = Accessor.getDriver().Manage().Window.Size;
            int starty = (int)(size.Height * 0.50);
            int endy   = (int)(size.Height * 0.20);
            int startx = size.Width / 2;
            int count  = 0;

            while (count != 3 && (!KeywordImplementation.waitForObjectExist(By.Id("Txt_HIRecommended"), TimeSpan.FromSeconds(1))))
            {
                ((AndroidDriver <OpenQA.Selenium.Appium.Android.AndroidElement>)Accessor.getDriver()).Swipe(startx, starty, startx, endy, 500);
                count++;
            }

            KeywordImplementation.Click(By.Name(objectName));
        }
Exemplo n.º 18
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"));
            }
        }
        public void ScrollUp()
        {
            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 = (int)(size.Height * 0.50);
            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, 500);
                count++;
            }
        }
Exemplo n.º 20
0
        public void ValidateContentsContains(string contents, bool isFound)
        {
            string[] contentsArray = contents.Split(';');

            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.50);
            int endy   = (int)(size.Height * 0.20);
            int startx = size.Width / 2;

            foreach (string str in contentsArray)
            {
                bool check = false;

                int count = 0;
                while (count != 3 && (!KeywordImplementation.waitForObjectExist(By.XPath("//*[contains(@value,'" + str + "')]"), TimeSpan.FromSeconds(1))))
                {
                    ((IOSDriver <IOSElement>)Accessor.getDriver()).Swipe(startx, starty, startx, endy, 50);
                    count++;
                }

                if (KeywordImplementation.waitForObjectExist(By.XPath("//*[contains(@value,'" + str + "')]"), TimeSpan.FromSeconds(1)))
                {
                    check = true;
                }

                string message = null;
                if (check == isFound)
                {
                    message = isFound?string.Format("Information '{0}' text has found", str):string.Format("Information '{0}' text has not found", str);
                    Logger.logSuccess(message);
                }
                else
                {
                    message = isFound?string.Format("Information '{0}' text has not found", str):string.Format("Information '{0}' text has found", str);
                    Logger.logFailure(message);
                }
            }
            Logger.logSnapshot();
        }
Exemplo n.º 21
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"]);
        }
Exemplo n.º 22
0
        public void ValidateContents(string contents)
        {
            string[] contentsArray = contents.Split(';');

            foreach (string str in contentsArray)
            {
                bool check = false;
                //KeywordImplementation.SwipeVerticle(3,0.60,0.20,By.Name(str));
                KeywordImplementation.SwipeVerticle(3, 0.60, 0.20, By.XPath("//*[contains(@text,'" + str + "')]"));
                if (KeywordImplementation.waitForObjectExist(By.XPath("//*[contains(@text,'" + str + "')]"), TimeSpan.FromSeconds(1)))
                {
                    check = true;
                    Logger.logSuccess(string.Format("Information '{0}' text has found", str));
                }

                if (!check)
                {
                    Logger.logFailure(string.Format("Information '{0}' text has not found", str));
                }
            }
            Logger.logSnapshot();
        }
Exemplo n.º 23
0
        public void ValidateContentsWithContentDesc(string objectName, bool isFound)
        {
            int  swipeCnt = 0;
            bool check    = false;

            string[] validationObjectArray = objectName.Split(';');
            foreach (string obj in  validationObjectArray)
            {
                while (swipeCnt != 3)
                {
                    if (KeywordImplementation.waitForObjectExist(By.XPath("//*[contains(@content-desc,'" + obj + "')]"), TimeSpan.FromSeconds(1)))
                    {
                        check = true;
                        break;
                    }
                    if (!check)
                    {
                        KeywordImplementation.SwipeVerticle(swipeCnt, 0.50, 0.20, By.XPath("//*[contains(@content-desc,'" + obj + "')]"));
                        swipeCnt++;
                    }
                    else
                    {
                        break;
                    }
                }
                string message = null;
                if (check == isFound)
                {
                    message = isFound?string.Format("'{0}' is found", obj):string.Format("'{0}' is not found", obj);
                    Logger.logSuccess(message);
                }
                else
                {
                    message = isFound?string.Format("'{0}' is not found", obj):string.Format("'{0}' is found", obj);
                    Logger.logFailure(message);
                }
            }
            Logger.logSnapshot();
        }
Exemplo n.º 24
0
 public void ValidateRateOurApp(string AppRate, bool isPopup, int runCount)
 {
     //bool check=false;
     for (int i = 1; i <= runCount; i++)
     {
         StartApp(false);
         Logger.logInfo(string.Format("{0} Run of App", i));
         if (isPopup.Equals(true))
         {
             if (i == runCount && KeywordImplementation.waitForObjectExist(By.Name("Rate our app"), TimeSpan.FromSeconds(2)))
             {
                 Logger.logSuccess(string.Format("Rate the app pop-up found at {0}th iteration", i), true);
                 ValidateContents("Not now;No rating;Rate the App Now");
                 KeywordImplementation.Click(By.Name(AppRate));
                 //	check=true;
                 break;
             }
             else if (i == runCount && !KeywordImplementation.waitForObjectExist(By.Name("Rate our app"), TimeSpan.FromSeconds(2)))
             {
                 Logger.logFailure("Rate the app - automatic pop-up not found");
                 break;
             }
         }
         else if (isPopup.Equals(false))
         {
             if (KeywordImplementation.waitForObjectExist(By.Name("Rate our app"), TimeSpan.FromSeconds(2)))
             {
                 Logger.logFailure(string.Format("Rate the app - automatic pop-up found at {0} itteration", i));
                 break;
             }
             else if (i == runCount)
             {
                 Logger.logSuccess("Rate the app - automatic pop-up not found");
             }
         }
         CloseApp();
     }
 }
Exemplo n.º 25
0
        public void VerifyTextHighlighted(string objectName)
        {
            //Logger.logWarn("Information has to be added to identify highlighted text");
            var size   = Accessor.getDriver().Manage().Window.Size;
            int starty = (int)(size.Height * 0.50);
            int endy   = (int)(size.Height * 0.20);
            int startx = size.Width / 2;
            int count  = 0;

            while (count != 3 && (!KeywordImplementation.waitForObjectExist(By.Name(objectName), TimeSpan.FromSeconds(1))))
            {
                ((AndroidDriver <OpenQA.Selenium.Appium.Android.AndroidElement>)Accessor.getDriver()).Swipe(startx, starty, startx, endy, 500);
                count++;
            }
            if (KeywordImplementation.UIObject(By.Id("Active Step")).GetAttribute("value").Equals(objectName, StringComparison.CurrentCultureIgnoreCase))
            {
                Logger.logSuccess(string.Format("'{0}' is highlighted", objectName));
            }
            else
            {
                Logger.logFailure(string.Format("'{0}'is not highlighted", objectName));
            }
        }
Exemplo n.º 26
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"));
                }
            }
        }
Exemplo n.º 27
0
        /// <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();
                }
            }
        }
Exemplo n.º 28
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";

            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();
                }
            }
        }
Exemplo n.º 29
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();
                }
            }
        }
Exemplo n.º 30
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();
                }
            }
        }