Example #1
0
 public static bool IssubjectMenu(AndroidDriver driver)
 {
     if (driver.FindElementsByName("Subject Menu").Any())
     {
         if (driver.FindElementByName("Medications").GetAttribute("enabled") == "true")
         {
             return(true);
         }
     }
     return(false);
 }
 public override IEnumerable <AndroidElement> FindAllElements(AndroidDriver <AndroidElement> searchContext)
 {
     return(searchContext.FindElementsByName(Value));
 }
Example #3
0
        public static bool amIspecial(AndroidDriver driver)
        {
            bool bamSpecial  = false;
            var  vCollection = driver.FindElementsByClassName("android.widget.EditText");
            //int randomInt;
            //string randomText;
            //string myText;
            Random random = new Random();

            //check to see if screen is special

            //am i the new VRC screen?
            if (driver.FindElementsByName("New VRC").Any())
            {
                //Console.WriteLine("SPECIAL - New VRC start");

                //standroid.GetScreenShot(driver, "screenshot");

                //New VRC screen - select Yes then Next
                driver.FindElementByName("Yes").Click();
                Thread.Sleep(500);
                driver.FindElementByName("Next").Click();
                Thread.Sleep(500);
                //Console.WriteLine("SPECIAL - New VRC completed with YES");
            }


            //am i the Injection Location screen?
            if (IsElementPresent("InjectionSiteLocationActivity", driver))
            //if (driver.FindElementsByName("InjectionSiteLocationActivity").Count() > 0)
            {
                ScreenInjectionSiteLocation(driver);
                bamSpecial = true;
                return(bamSpecial);
            }

            //am i the temperature screen?
            //if (driver.FindElementsByName("Oral Temperature").Count() > 0)
            if (IsElementPresent("TemperatureEntryActivity", driver))
            {
                screenTemperature(driver);
                //return special
                return(true);
            }

            //am i the Training Complete screen?
            if (driver.FindElementsByName("The training module is now complete.").Count() > 0)
            {
                SpecialTrainingCompleteStartNewVrc(driver);
                //return special

                return(true);
            }

            //am i an ER screen?
            if (driver.FindElementsByName("ER including urgent health centers").Count() > 0 && driver.FindElementsByClassName("android.widget.CheckBox").Count() == 3)
            {
                screenER(driver);
                return(true);
            }

            //am i a LOG screen?
            if (driver.FindElementsByName("TAP TO ADD").Count() > 0)
            {
                screenLog(driver);
                return(true);
            }

            //am i the VSC instructions screen?
            if (IsElementPresent("VscInstructionsActivity", driver))
            {
                screenVSC(driver);
                return(true);
            }
            //am i the ISRd6 instructions screen?
            if (IsElementPresent("Isrd6InstructionsActivity", driver))
            {
                screenISRD6(driver);
                return(true);
            }
            // If OnGoing is not required the diary will be completed at random and could still have some ongoing events
            //Check if OnGoing is required - OnGoing set in globals
            if (Globals.Run.PsOnGoing == "Yes")
            {
                //am i the Ongoing events screen?
                if (driver.FindElementsByName("Ongoing events").Any())
                {
                    screenOnGoing(driver);
                    return(true);
                }
            }


            //I'm not special :[
            return(false);
        }