public static void ITC_CheckLastEventDate(int sub, string expectedDate, IWebDriver driver)
        {
            ////Search for subject

            string subID = sub.ToString();

            GenericFunctions.Wait(2);
            GenericFunctions.ClickOnLink("My Subjects", driver);
            GenericFunctions.waitforElement("subjectId", driver);
            driver.FindElement(By.Id("subjectId")).Clear();
            driver.FindElement(By.Id("subjectId")).SendKeys(subID);
            GenericFunctions.Wait(2);
            GenericFunctions.ClickOnButton("searchBtn", driver);
            GenericFunctions.CheckTextIsOnPage(subID, driver);
            GenericFunctions.Wait(2);
            //Get last event date
            string EventDate = driver.FindElement(By.XPath("//*[@id='Grid']/div[2]/table/tbody/tr/td[6]")).Text;


            Functions.Reporting.ReportScreenshot("AlertEmail", driver);

            //Compare actual last event date to expected last event date
            if (expectedDate.Equals(EventDate))
            {
                GenericFunctions.ReportTheTestPassed("The last event date (" + EventDate + ") is correct");
                _startUp.TestPasses++;
                _startUp.Passes++;
            }
            else
            {
                GenericFunctions.ReportTheTestFailed("The last event date is incorrect. The expected date is: " + expectedDate + " The actual date is: " + EventDate);
                _startUp.TestFails++;
                _startUp.Fails++;
            }
        }
        public static void ITC_CheckHelpText(IWebDriver driver)
        {
            var studyName = GenericFunctions.goAndGet("STUDYID");


            using (var conn = new SqlConnection(GenericFunctions.goAndGet("DBCONNECTION")))
            {
                conn.Open();

                string helpText;
                using (var command = new SqlCommand("select help_text from tbl_study where name = '" + studyName + "'"))
                {
                    command.CommandType = System.Data.CommandType.Text;
                    command.Connection  = conn;

                    var obj = command.ExecuteScalar();
                    helpText = obj.ToString();
                    helpText = helpText.Replace("<b>", "");
                    helpText = helpText.Replace("</b>", "");
                    helpText = helpText.Replace("<u>", "");
                    helpText = helpText.Replace("</u>", "");
                    helpText = helpText.Replace("<i>", "");
                    helpText = helpText.Replace("</i>", "");
                    helpText = helpText.Replace("</b>", "");
                    //help_text = help_text.Replace("<br>", "\n");
                    helpText = helpText.Replace("<center>", "");
                    helpText = helpText.Replace("</center>", "");
                }

                conn.Close();
                GenericFunctions.ClickElement(driver.FindElement(By.XPath("//div/a/img")), driver);
                GenericFunctions.CheckTextIsOnPage(helpText, driver);
                GenericFunctions.ClickElement(driver.FindElement(By.XPath("//span[@class='ui-icon ui-icon-closethick']")), driver);
            }
        }
        public static void ITC_ViewSubject(int SubjectID, IWebDriver driver)
        {
            string mySubId   = SubjectID.ToString();
            string StudyName = GenericFunctions.goAndGet("STUDYID");
            string SiteName  = GenericFunctions.goAndGet("SITEID");

            GenericFunctions.ClickOnLink("My Subjects", driver);
            GenericFunctions.Wait(12);
            Functions.Reporting.ReportScreenshot("View_Subjects", driver);

            //GenericFunctions.Type(mySubId, "subjectId", driver);
            //GenericFunctions.ClickOnButton("searchBtn", driver);
            //GenericFunctions.waitforElement(mySubId, driver);

            GenericFunctions.ClickElement(driver.FindElement(By.XPath("//*[@id=\"edit" + _dbActions.GetRowIdForSubject(SubjectID, driver) + "\"]")), driver);

            GenericFunctions.Wait(2);
            GenericFunctions.CheckTextIsOnPage("Subject Details", driver);
            GenericFunctions.CheckTextIsOnPage("Site", driver);
            GenericFunctions.CheckTextIsOnPage("Subject Identifier", driver);
            GenericFunctions.CheckTextIsOnPage("Language", driver);
            GenericFunctions.CheckTextIsOnPage("Email", driver);
            GenericFunctions.CheckTextIsOnPage("Event Schedule", driver);

            Functions.Reporting.ReportScreenshot("View_Subjectsched", driver);
        }
 public static void ITC_AlertEmail(IWebDriver driver)
 {
     GenericFunctions.ClickOnText("scheduleFeedbackMenu", driver);
     GenericFunctions.CheckTextIsOnPage("Alert Email Followup", driver);
     GenericFunctions.CheckTextIsOnPage("Select Site", driver);
     GenericFunctions.CheckTextIsOnPage("Select Subject", driver);
     GenericFunctions.CheckTextIsOnPage("Alert Email Type", driver);
     Functions.Reporting.ReportScreenshot("AlertEmail", driver);
 }
 public static void CheckPageText(IWebDriver driver)
 {
     GenericFunctions.CheckWindowTitle("InTouch Clinical", driver);
     GenericFunctions.CheckTextIsOnPage("InTouch Clinical", driver);
     GenericFunctions.CheckTextIsOnPage("Welcome " + GenericFunctions.goAndGet("USERNAME"), driver);
     GenericFunctions.CheckTextIsOnPage("Study: " + GenericFunctions.goAndGet("STUDYID"), driver);
     GenericFunctions.CheckTextIsOnPage("Log Off", driver);
     GenericFunctions.CheckTextIsOnPage("Subject Administration", driver);
     GenericFunctions.CheckTextIsOnPage("Reporting", driver);
     GenericFunctions.CheckTextIsOnPage("Subjects", driver);
 }
 public static void ITC_CheckScheduleKey(IWebDriver driver)
 {
     GenericFunctions.CheckTextIsOnPage("+Show key", driver);
     GenericFunctions.ClickOnText("+Show key", driver);
     GenericFunctions.CheckTextIsOnPage("-Hide key", driver);
     GenericFunctions.CheckTextIsOnPage("Set In the Past", driver);
     GenericFunctions.CheckTextIsOnPage("Scheduled", driver);
     GenericFunctions.CheckTextIsOnPage("Send Within 24 hours", driver);
     GenericFunctions.CheckTextIsOnPage("Sent", driver);
     GenericFunctions.ClickOnText("-Hide key", driver);
     Functions.Reporting.ReportScreenshot("Schedule_key", driver);
 }
 public static void ITC_ViewSubSched(int SubjectID, IWebDriver driver)
 {
     ITC_ViewSubject(SubjectID, driver);
     GenericFunctions.ClickOnText("Event Schedule", driver);
     GenericFunctions.CheckTextIsOnPage("Subject Schedule", driver);
     GenericFunctions.CheckTextIsOnPage("Click schedule icons to view message details.", driver);
     ITC_CheckScheduleKey(driver);
     GenericFunctions.CheckTextIsOnPage("Baseline Schedule", driver);
     GenericFunctions.CheckTextIsOnPage("Non-Baseline Schedule", driver);
     GenericFunctions.ClickElement(driver.FindElement(By.XPath("//span[@class='ui-close']")), driver);
     Functions.Reporting.ReportScreenshot("View_Subject_Sched", driver);
 }
示例#8
0
 //[Test]
 public void WhiteBeltTraining()
 {
     _startUp.driver.Navigate().GoToUrl("https://test.itc.excointouch.com/");
     GenericFunctions.CheckTextIsOnPage("Enter your username and password:"******"Reports", _startUp.driver);
     GenericFunctions.CheckTextIsOnPage("Username", _startUp.driver);
     GenericFunctions.Type("abrown", "UserName", _startUp.driver);
     GenericFunctions.Type("Password", "Password", _startUp.driver);
     GenericFunctions.ClickOnButton("logonBtn", _startUp.driver);
     GenericFunctions.SelectFromList("DEMO1", "studyId", _startUp.driver);
     GenericFunctions.CheckTextIsOnPage("Subject Enrolment", _startUp.driver);
     GenericFunctions.ClickOnLink("Reporting", _startUp.driver);
 }
 public static void ITC_Invalid(string IDORPASS, IWebDriver driver)
 {
     driver.Navigate().GoToUrl(GenericFunctions.goAndGet("UIUXURL"));
     GenericFunctions.CheckWindowTitle("Exco Intouch Online Services", driver);
     GenericFunctions.CheckTextIsOnPage("Online Services", driver);
     GenericFunctions.CheckTextIsOnPage("Enter your username and password:"******"Username", driver);
     GenericFunctions.CheckTextIsOnPage("Password", driver);
     GenericFunctions.Type((IDORPASS == "Username" ? "INVALIDUSERNAME" : GenericFunctions.goAndGet("USERNAME")), "UserName", driver);
     GenericFunctions.Type((IDORPASS == "Password" ? "INVALIDPASSWORD" : GenericFunctions.goAndGet("PASSWORD")), "Password", driver);
     GenericFunctions.ClickOnButton("logonBtn", driver);
     GenericFunctions.CheckTextIsOnPage("Login was unsuccessful. Please correct the errors and try again.", driver);
     GenericFunctions.CheckTextIsOnPage("Your login attempt was not successful. Please try again", driver);
 }
        public static int ITC_EnrolSubject(IWebDriver driver)
        {
            var studyName = GenericFunctions.goAndGet("STUDYID");
            var siteName  = GenericFunctions.goAndGet("SITEID");
            var subjMob   = GenericFunctions.goAndGet("SUBJECTPHONE");

            var subjectId = (_dbActions.CountSubjects(driver) == 0 ? Convert.ToInt32(GenericFunctions.goAndGet("SITEPREFIX") + "0001") : _dbActions.GetLatestSubjectId(studyName, siteName, driver));

            GenericFunctions.ClickOnText("enrolmentLink", driver);
            GenericFunctions.Wait(5);
            GenericFunctions.SelectDropDownByText(siteName, "siteId", driver);
            GenericFunctions.Wait(5);
            //GenericFunctions.Type("English", "patientLanguageDropDown", driver);
            GenericFunctions.Type("" + subjectId, "userIdentifier", driver);
            GenericFunctions.Type(subjectId + "*****@*****.**", "SubjectEMail", driver);
            GenericFunctions.Type(subjMob, "SubjectMSISDN", driver);
            //GenericFunctions.Type("7700910000", "SubjectMSISDN", driver);
            GenericFunctions.Wait(5);

            var myDate = DateTime.Today.AddHours(23);

            datePicker(driver);

            //ItcTimePicker(2,myDate,driver);

            GenericFunctions.Type("In what city or town does your nearest sibling live?", "SecurityQuestionDropDownList", driver);
            GenericFunctions.Type("Nottingham", "Patient_SecurityQuestionAnswer", driver);

            Functions.Reporting.ReportScreenshot("Reg", driver);;
            //GenericFunctions.Wait(5);
            GenericFunctions.waitforElement("submitBtn", driver);
            GenericFunctions.ClickOnButton("submitBtn", driver);

            GenericFunctions.Wait(2);

            GenericFunctions.CheckTextIsOnPage(subjectId + " has been successfully enrolled in the study.", driver);
            Functions.Reporting.ReportScreenshot("Enrol", driver);
            return(subjectId);
        }
        public static void ITC_Login(IWebDriver driver)
        {
            string username  = GenericFunctions.goAndGet("USERNAME");
            string password  = GenericFunctions.goAndGet("PASSWORD");
            string studyName = GenericFunctions.goAndGet("STUDYID");

            // Login
            driver.Navigate().GoToUrl(GenericFunctions.goAndGet("UIUXURL"));
            GenericFunctions.CheckWindowTitle("Exco Intouch Online Services", driver);
            GenericFunctions.CheckTextIsOnPage("Online Services", driver);
            GenericFunctions.CheckTextIsOnPage("Enter your username and password:"******"Username", driver);
            GenericFunctions.CheckTextIsOnPage("Password", driver);
            GenericFunctions.CheckTextIsOnPage("Knowledge Centre", driver);
            GenericFunctions.Type(username, "UserName", driver);
            GenericFunctions.Type(password, "Password", driver);
            Functions.Reporting.ReportScreenshot("Log", driver);
            GenericFunctions.ClickOnButton("logonBtn", driver);


            CheckPageText(driver);
        }
        public static void ITC_Withdraw(int SubjectID, IWebDriver driver)
        {
            string sEnv = GenericFunctions.goAndGet("ENVIRONMENT");
            int    IntSubjectID;

            //This is no longer needed. WC
            IntSubjectID = _dbActions.GetRowIdForSubject(SubjectID, driver);

            GenericFunctions.ClickOnLink("Subject Administration", driver);

            GenericFunctions.Wait(10);
            //((IJavaScriptExecutor)driver).ExecuteScript("window.alert = function(){}");
            ((IJavaScriptExecutor)driver).ExecuteScript("window.confirm = function(){return true;}");
            GenericFunctions.ClickElement(driver.FindElement(By.XPath("//td[2]/a[@id='edit" + SubjectID + "']")), driver);
            GenericFunctions.Wait(5);
            Functions.Reporting.ReportScreenshot("Withdraw", driver);

            //IAlert alert = driver.SwitchTo().Alert();
            //alert.Accept(); //for two buttons, choose the affirmative one

            GenericFunctions.Wait(2);
            GenericFunctions.CheckTextIsOnPage("Subject " + SubjectID + " has been successfully withdrawn from the study.", driver);
        }