Exemplo n.º 1
0
        public void GivenIAmALoggedInUser()
        {
            if (PerfectoUtils.OCRTextCheckPoint(driver, "Patient", 6))
            {
                return;
            }
            SignInPage.ClickStartSignIn(driver);
            if (PerfectoUtils.OCRTextCheckPoint(driver, "Patient", 6))
            {
                return;
            }

            SignInPage.SignIn(driver);
        }
Exemplo n.º 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));
        }