Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
 public void GivenPopup(string action, string popupName)
 {
     //driver.Context = Constants.VISUAL;
     if (Checkpoint(popupName, driver, 20))
     {
         PerfectoUtils.OCRTextClick(driver, action, 90, 20, 2);
         Thread.Sleep(1000);
     }
 }
Ejemplo n.º 3
0
        public void GivenIClick(string buttonName, string pageName)
        {
            Thread.Sleep(2000);

            switch (pageName)
            {
            case "Popup":
                switch (buttonName)
                {
                case "OK":
                    if (Checkpoint("OK", driver, 20))
                    {
                        driver.Context = Constants.NATIVEAPP;
                        driver.FindElementByXPath("//*[@resource-id='android:id/button1']").Click();
                    }
                    break;

                case "Yes":
                    if (Checkpoint("Yes", driver, 20))
                    {
                        driver.Context = Constants.NATIVEAPP;
                        driver.FindElementByXPath("//*[@resource-id='android:id/button1']").Click();
                    }
                    break;

                case "No":
                    if (Checkpoint("No", driver, 20))
                    {
                        driver.Context = Constants.NATIVEAPP;
                        driver.FindElementByXPath("//*[@resource-id='android:id/button2']").Click();
                    }
                    break;

                case "Allow":
                    PerfectoUtils.OCRTextClick(driver, "Allow", 90, 20, 2);
                    break;

                case "Cancel":
                    PerfectoUtils.OCRTextClick(driver, "Cancel", 90, 20, 1);
                    break;

                default:
                    break;
                }
                break;

            case "Home":
                switch (buttonName)
                {
                //case "Patient":
                //    PerfectoUtils.OCRTextClick(driver, "Patient", 90, 20, 1);
                //    Thread.Sleep(2000);
                //    break;
                case "Patient":
                    driver.Context = Constants.NATIVEAPP;
                    HomePage.ClickPatient(driver);
                    break;

                default:
                    break;
                }
                break;

            case "Patient":
                switch (buttonName)
                {
                case "???":
                    driver.Context = Constants.NATIVEAPP;
                    //PatientPage.;
                    break;

                default:
                    break;
                }
                break;

            case "Patient Menu":
                switch (buttonName)
                {
                case "Medications":
                    PatientMenuPage.ValidateOnPatientHeader(driver);
                    PatientMenuPage.GoToMedicationPage(driver);
                    break;

                default:
                    break;
                }
                break;

            case "Medications":
                switch (buttonName)
                {
                case "Refill a Prescription":
                    driver.Context = Constants.NATIVEAPP;
                    MedicationPage.ClickRefill(driver);
                    break;
                }
                break;
            //case "Navigation":
            //    switch (buttonName)
            //    {
            //        case "Menu":
            //            Navigation.ClickMenu(driver);
            //            break;
            //        case "Store Locator":
            //            PerfectoUtils.OCRTextClick(driver, "Complete", 90, 20, 1);
            //            Thread.Sleep(2000);
            //            Navigation.ClickStoreLocator(driver);
            //            break;
            //        default:
            //            break;
            //    }
            //    break;

            case "ExtraCare Card":
                switch (buttonName)
                {
                case "View My Deals & Rewards":
                    driver.FindElementByXPath("//*[@resource-id='com.cvs.launchers.cvs:id/showDealsDragDowntv']").Click();
                    break;

                default:
                    break;
                }
                break;

            case "Your Deals & Rewards":
                switch (buttonName)
                {
                case "Remove ExtraCare Card":
                    PerfectoUtils.Swipe(driver, "50%,80%", "50%,30%");
                    Thread.Sleep(1000);
                    PerfectoUtils.Swipe(driver, "50%,80%", "50%,30%");
                    Thread.Sleep(1000);
                    PerfectoUtils.Swipe(driver, "50%,80%", "50%,30%");
                    Thread.Sleep(1000);
                    PerfectoUtils.Swipe(driver, "50%,80%", "50%,30%");
                    Thread.Sleep(1000);
                    PerfectoUtils.OCRTextClick(driver, "Remove ExtraCare Card", 90, 0, 1, true);
                    Thread.Sleep(1000);
                    break;

                default:
                    break;
                }
                break;

            default:
                break;
            }
            Thread.Sleep(1000);
        }