public void SelectTheProgramCourseFromGlobalHomePage()
 {
     try
     {
         bool announcementClose = GenericHelper.CloseAnnouncementPage();
         if (announcementClose)
         {
             GenericHelper.Logs("Annoucement page has been closed successfully", "Passed");
         }
         else
         {
             GenericHelper.Logs("Annoucement page is still not closed", "Failed");
         }
         string courseName = DatabaseTools.GetCourse(Enumerations.CourseType.ProgramCourse).Trim();
         GenericHelper.WaitUntilElement(By.PartialLinkText(courseName));
         WebDriver.FindElement(By.PartialLinkText(courseName)).SendKeys("");
         WebDriver.FindElement(By.PartialLinkText(courseName)).Click();
     }
     catch (Exception e)
     {
         GenericHelper.Logs(e.ToString(), "FAILED");
         GenericStepDefinition.ThenIClickedOnTheLogoutLinkToGetLoggedOutFromTheApplication();
         Assert.Fail(string.Format("Exception of type {0} cau" + "ght: {1}", e.GetType(), e.Message));
     }
 }
 public void WhenIEnterSectionAsTeacher()
 {
     try
     {
         string sectionName = DatabaseTools.GetSectionName(Enumerations.CourseType.ProgramCourse);
         GenericHelper.SelectWindow("Program Administration");
         GenericHelper.WaitUntilElement(By.Id("_ctl0_PageContent_ifrmMiddle"));
         WebDriver.FindElement(By.Id("_ctl0_PageContent_ifrmMiddle"));
         WebDriver.SwitchTo().Frame("_ctl0_PageContent_ifrmMiddle");
         GenericHelper.WaitUntilElement(By.PartialLinkText("Search"));
         WebDriver.FindElement(By.PartialLinkText("Search")).Click();
         //WebDriver.SwitchTo().ActiveElement();
         GenericHelper.WaitUntilElement(By.Id("txtSectionDetail"));
         WebDriver.FindElement(By.Id("txtSectionDetail")).Clear();
         WebDriver.FindElement(By.Id("txtSectionDetail")).SendKeys(sectionName);
         GenericHelper.WaitUntilElement(By.Id("lnkbuttonsearch"));
         WebDriver.FindElement(By.Id("lnkbuttonsearch")).Click();
         WebDriver.SwitchTo().DefaultContent();
         GenericHelper.SelectWindow("Program Administration");
         GenericHelper.WaitUntilElement(By.Id("_ctl0_PageContent_ifrmMiddle"));
         WebDriver.FindElement(By.Id("_ctl0_PageContent_ifrmMiddle"));
         WebDriver.SwitchTo().Frame("_ctl0_PageContent_ifrmMiddle");
         GenericHelper.WaitUntilElement(By.XPath("//div[@id='grdTemplateSection$divContent']/descendant::th[@class='thCourseInQ']/span"));
         IWebElement sectionClick = WebDriver.FindElement(By.XPath("//div[@id='grdTemplateSection$divContent']/descendant::th[@class='thCourseInQ']/span"));
         sectionClick.Click();
         GenericHelper.WaitUtilWindow("Calendar");
     }
     catch (Exception e)
     {
         GenericHelper.Logs(e.ToString(), "FAILED");
         GenericStepDefinition.ThenIClickedOnTheLogoutLinkToGetLoggedOutFromTheApplication();
         Assert.Fail(string.Format("Exception of type {0} cau" + "ght: {1}", e.GetType(), e.Message));
     }
 }
 public void WhenIGrantthestudentasTa()
 {
     try
     {
         GenericTestStep.StepToLoggedIntoTheCourseSpaceAsSMSInstructor();
         GenericTestStep.StepToIAmOnThePage("Global Home");
         GenericHelper.SelectWindow("Global Home");
         string courseName = DatabaseTools.GetCourse(Enumerations.CourseType.InstructorCourse).Trim();
         GenericHelper.WaitUntilElement(By.PartialLinkText(courseName));
         WebDriver.FindElement(By.PartialLinkText(courseName)).SendKeys("");
         WebDriver.FindElement(By.PartialLinkText(courseName)).Click();
         GenericTestStep.StepToIAmOnThePage("Calendar");
         // Will need to change this line as per the authored course
         GenericHelper.SelectWindow("Calendar");
         GenericTestStep.StepToNavigateToTheTab("Enrollments");
         GenericTestStep.StepToIAmOnThePage("Roster");
         _rosterPage.ToGrantTAPrivilege();
         GenericTestStep.StepToIClickedOnTheLogoutLinkToGetLoggedOutFromTheApplication();
     }
     catch (Exception e)
     {
         GenericHelper.Logs(e.ToString(), "FAILED");
         GenericStepDefinition.ThenIClickedOnTheLogoutLinkToGetLoggedOutFromTheApplication();
         Assert.Fail(string.Format("Exception of type {0} cau" + "ght: {1}", e.GetType(), e.Message));
     }
 }
 public void CreateInstructorCourse()
 {
     try
     {
         _toCreateinstructorCourse.ToCreateCatalogCourse("MasterCourse");
     }
     catch (Exception e)
     {
         GenericHelper.Logs(e.ToString(), "Failed");
         GenericStepDefinition.ThenIClickedOnTheLogoutLinkToGetLoggedOutFromTheApplication();
         Assert.Fail(string.Format("Exception of type {0} cau" + "ght: {1}", e.GetType(), e.Message));
     }
 }
 public void WhenIEnterTheTemplateAsTeacher()
 {
     try
     {
         _manageTemplateHed.ToSearchForAssignedHedProgramAdmin();
         GenericTestStep.StepToIAmOnThePage("Calendar");
     }
     catch (Exception e)
     {
         GenericHelper.Logs(e.ToString(), "FAILED");
         GenericStepDefinition.ThenIClickedOnTheLogoutLinkToGetLoggedOutFromTheApplication();
         Assert.Fail(string.Format("Exception of type {0} cau" +
                                   "ght: {1}", e.GetType(), e.Message));
     }
 }
 public void SMSUserIsAlreadyCreatedTheSection()
 {
     try
     {
         string IsSectionCreated = DatabaseTools.GetSectionName(Enumerations.CourseType.ProgramCourse);
         if (IsSectionCreated == null || IsSectionCreated.Equals("False") || IsSectionCreated.Equals(""))
         {
             _manageTemplateHed.ToCreateSections();
         }
     }
     catch (Exception e)
     {
         GenericHelper.Logs(e.ToString(), "FAILED");
         GenericStepDefinition.ThenIClickedOnTheLogoutLinkToGetLoggedOutFromTheApplication();
         Assert.Fail(string.Format("Exception of type {0} cau" + "ght: {1}", e.GetType(), e.Message));
     }
 }
Exemple #7
0
        public void ThenItShouldBeAllowedToAttemptActivityForSpecifiedNumberOfTimesForStudent()
        {
            try
            {
                GenericHelper.SelectDefaultWindow();
                //_contentLibraryUxPage.GetControlToLeftFrame();
                //string actName = DatabaseTools.GetActivityName(Enumerations.ActivityType.MyTest);
                //GenericTestStep.StepToAddTheActivityToMyCourse(actName);
                GenericStepDefinition.ClickedOnTheLogoutLinkToGetLoggedOutFromTheApplication();
                GenericTestStep.StepToLoggedIntoTheCourseSpaceAsSMSStudent();
                GenericTestStep.StepToItShouldBeOnPage("Global Home");
                GenericTestStep.StepToselectthecoursefromGlobalhomepage();
                GenericTestStep.StepToNavigateToTheTab("Course Materials");

                //string actName = DatabaseTools.GetActivityName(Enumerations.ActivityType.MyTest);
                _coursePreviewMainUxPage.OpenAsset("Test201324125450");
                //_showMessagePage.ClickContinue();
                GenericHelper.WaitUtilWindow("Web Activity");
                GenericHelper.SelectWindow("Web Activity");
                _studentPresentationPage.SubmitActivity();
                WebDriver.Close();
                //_coursePreviewMainUxPage.OpenAsset(actName);


                //if (_errorMessagePage.VerifyErrorMessage())
                //{
                //    GenericHelper.Logs("Error message displayed On attempting the activity more than specified attempt", "PASSED");
                //}
                //else
                //{
                //    GenericHelper.Logs("Error message not displayed On attempting the activity more than specified attempt", "FAILED");
                //    throw new Exception("Error message not displayed On attempting the activity more than specified attempt");
                //}
                //WebDriver.Close();
                GenericHelper.SelectDefaultWindow();
                GenericStepDefinition.ClickedOnTheLogoutLinkToGetLoggedOutFromTheApplication();
            }
            catch (Exception e)
            {
                GenericHelper.Logs(e.ToString(), "FAILED");
                Assert.Fail(e.ToString());
            }
        }