public static void ClickRefill(RemoteWebDriver driver)
        {
            do
            {
                Console.WriteLine("Wait for 5 seconds medications page to open " + PerfectoHooks.CurrentDevice.DeviceDetails.Name);
                Thread.Sleep(5000);
            } while (PerfectoUtils.OCRTextCheckPoint(driver, "Retrieving", 6));

            if (PerfectoUtils.IsTablet())
            {
                PerfectoUtils.OCRTextClick(driver, "Refill a prescription", 90, 20, 1, false, 1, false);
            }
            else
            {
                driver.FindElementByXPath(RefillMedicationButton).Click();
            }

            PerfectoUtils.RotateDevice(driver, Constants.Rotation.LANDSCAPE);
            Thread.Sleep(1000);
            PerfectoUtils.RotateDevice(driver, Constants.Rotation.PORTRAIT);
            Thread.Sleep(1000);
            PerfectoUtils.RotateDevice(driver, Constants.Rotation.LANDSCAPE);
            Thread.Sleep(1000);
            PerfectoUtils.RotateDevice(driver, Constants.Rotation.PORTRAIT);
            Thread.Sleep(1000);
        }
Example #2
0
        public static void ClickPatient(AppiumDriver <IWebElement> driver)
        {
            //Ipad has no home page
            if (PerfectoUtils.IsiPad())
            {
                return;
            }

            if (PerfectoUtils.IsTablet())
            {
                Console.WriteLine("About to click patient link - sleep for tablet " + PerfectoHooks.CurrentDevice.DeviceDetails.Name);

                Thread.Sleep(15000);
            }

            driver.Manage().Timeouts().ImplicitlyWait(TimeSpan.FromSeconds(25));
            driver.FindElementByXPath(PatientButton).Click();
            driver.Manage().Timeouts().ImplicitlyWait(TimeSpan.FromSeconds(6));
            //App sends to authenticate if haven't already authenticated after opening app

            try
            {
                if (driver.FindElementsByXPath(UsernameField).Count > 0)
                {
                    Console.WriteLine("Redirected to sign in - attempt sign in " + PerfectoHooks.CurrentDevice.DeviceDetails.Name);
                    SignInPage.SignIn(driver);
                }
                {
                    Console.WriteLine("login screen not found " + PerfectoHooks.CurrentDevice.DeviceDetails.Name);
                }
            }
            catch (Exception)
            {
            }
            driver.Manage().Timeouts().ImplicitlyWait(TimeSpan.FromSeconds(15));
        }