示例#1
0
        public void ThenIAssignTheStudyPlanToNthDateAndEnsureThatItIsPastDueThroughPropertiesWindow()
        {
            try
            {
                string Actname = DatabaseTools.GetActivityName(Enumerations.ActivityType.StudyPlan);// "SP2012118115736 ";// _studyplan;// "Readiness Check Ch04";

                _calendarHedDefaultUxPage.ClickMyProfile();


                _myAccountSettingPage.SelectFrame();

                string Date = _myAccountSettingPage.GetMyProfileDate();
                string Time = _myAccountSettingPage.GetMyProfileTime();

                _myAccountSettingPage.ClickCancel();

                GenericHelper.SelectDefaultWindow();
                _calendarHedDefaultUxPage.SearchActivty(Actname);
                _calendarHedDefaultUxPage.ClickActivityCmenuInSearchView(Actname);
                _calendarHedDefaultUxPage.SelectAssignmentPropertiesCmenuOption();
                _assignContentPage.SetDateAndTime(Date, Time);
            }
            catch (Exception e)
            {
                GenericHelper.Logs(e.ToString(), "FAILED");
                Assert.Fail(e.ToString());
            }
        }
示例#2
0
        public void ThenICreateStudyPlanFromCourseMaterialTab()
        {
            try
            {
                GenericHelper.WaitUtilWindow("Course Materials");
                _contentLibraryUxPage.ClickAddCourseMaterialsButton();
                if (!_contentLibraryUxPage.IsStudyPlanOptionPresent())
                {
                    GenericTestStep.StepToNavigateToTheTab("Preferences");
                    _generalPreferencesPage.SelectSkillsAndStandards();
                    _standardSkillPreferencesPage.SelectNeitherRadioButtonAndSave();
                    GenericTestStep.StepToNavigateToTheTab("Course Materials");
                    _contentLibraryUxPage.GetControlToLeftFrame();
                    _contentLibraryUxPage.ClickAddCourseMaterialsButton();
                }

                //create study plan
                string studyPlanName = GenericHelper.GenerateUniqueVariable("SP");
                _contentLibraryUxPage.StudyPlanCreation(studyPlanName);
                _contentLibraryUxPage.GetControlToLeftFrame();
                string SPName = DatabaseTools.GetActivityName(Enumerations.ActivityType.StudyPlan);
                GenericTestStep.StepToAddTheActivityToMyCourse(SPName);
            }
            catch (Exception e)
            {
                GenericHelper.Logs(e.ToString(), "FAILED");
                Assert.Fail(e.ToString());
            }
        }
        public void ThenIGenerateReportBySelectingTwoStudyPlan()
        {
            try
            {
                GenericHelper.SelectWindow("Reports");
                _rptGcOptionsUxPage.ClickSelectStudyPlans();

                GenericHelper.SelectWindow("Select Study Plan");

                string sp1 = DatabaseTools.GetActivityName(Enumerations.ActivityType.Sp1With3Rem);
                _rptSelectAssessmentsPage.SelectStudyPlan(sp1);
                string sp2 = DatabaseTools.GetActivityName(Enumerations.ActivityType.Sp2With3Rem);
                _rptSelectAssessmentsPage.SelectStudyPlan(sp2);

                _rptSelectAssessmentsPage.ClickAddButton();

                GenericHelper.SelectWindow("Reports");
                string stu = DatabaseTools.GetUsername(Enumerations.UserType.CsSmsStudent);//"SMSUSER";//

                _rptGcOptionsUxPage.ClickSelectStudents();
                GenericHelper.SelectWindow("Select Students");
                _rptSelectStudentsPage.SelectStudent(stu);
                _rptSelectStudentsPage.ClickAddButton();

                _rptCommonCriteriaPage.RunReport();

                GenericHelper.WaitUtilWindow("Study Plan Results");
            }
            catch (Exception e)
            {
                GenericHelper.Logs(e.ToString(), "FAILED");
                Assert.Fail(e.ToString());
            }
        }
示例#4
0
        public void ThenOnLaunchingPreTestAndPostTestPastDueMessageShouldDisplayForPastDueStudyPlanAndSubmitPretestAndPost()
        {
            try
            {
                string sp = DatabaseTools.GetActivityName(Enumerations.ActivityType.StudyPlan);
                _studTodoDonePage.OpenStudyPlan(sp);
                GenericHelper.WaitUtilWindow("Open Study Plan");
                GenericHelper.SelectWindow("Open Study Plan");
                _drtDefaultUxPage.ClickBegin();
                GenericHelper.WaitUtilWindow("Pre Test");
                GenericHelper.SelectWindow("Pre Test");
                if (_studentPresentationPage.VerifyPastDueMsg())
                {
                    GenericHelper.Logs("on launching pretest Past due message displayed ", "PASSED");
                }
                else
                {
                    GenericHelper.Logs("on launching pretest Past due message not displayed", "PASSED");
                    throw new Exception("on launching pretest Past due message not displayed");
                }
                _studentPresentationPage.AnswerTrue();
                _studentPresentationPage.SubmitActivity();
                WebDriver.Close();
                GenericHelper.SelectWindow("Open Study Plan");
                WebDriver.Navigate().Refresh();
                Thread.Sleep(4000);
                GenericHelper.WaitUtilWindow("Open Study Plan");
                GenericHelper.SelectWindow("Open Study Plan");

                _drtDefaultUxPage.ClickBeginForPostTest();
                GenericHelper.WaitUtilWindow("Post Test");
                GenericHelper.SelectWindow("Post Test");
                if (_studentPresentationPage.VerifyPastDueMsg())
                {
                    GenericHelper.Logs("on launching posttest Past due message displayed ", "PASSED");
                }
                else
                {
                    GenericHelper.Logs("on launching posttest Past due message not displayed", "PASSED");
                    throw new Exception("on launching posttest Past due message not displayed");
                }
                _studentPresentationPage.AnswerTrue();
                _studentPresentationPage.SubmitActivity();
                WebDriver.Close();
                GenericHelper.WaitUtilWindow("Open Study Plan");
                GenericHelper.SelectWindow("Open Study Plan");
                _drtDefaultUxPage.BackToPreviousFolder();
            }
            catch (Exception e)
            {
                GenericHelper.Logs(e.ToString(), "FAILED");
                Assert.Fail(e.ToString());
            }
        }
示例#5
0
 public void ThenISelectTheStudyPlanAndAssignToAnyDueDateSaysNthDate()
 {
     try
     {
         string SPName = DatabaseTools.GetActivityName(Enumerations.ActivityType.StudyPlan);
         _calendarHedDefaultUxPage.AssignActivityToCurrentDate(SPName);
         //_showAssignedContentListPage.ClickYesButton();
     }
     catch (Exception e)
     {
         GenericHelper.Logs(e.ToString(), "FAILED");
         Assert.Fail(e.ToString());
     }
 }
示例#6
0
 public void ThenIClickedOnTheViewGradesOfTheStudyPlanColumnWhereStudyAssignedThroughPropertiesWindow()
 {
     try
     {
         string spName = DatabaseTools.GetActivityName(Enumerations.ActivityType.StudyPlan); //_studyplan;//"Readiness Check Ch04";
         _gbDefaultUxPage.SearchActivityByTitle(spName);
         _gbInstructorUxPage.ClickViewGrades(spName);
     }
     catch (Exception e)
     {
         GenericHelper.Logs(e.ToString(), "FAILED");
         Assert.Fail(e.ToString());
     }
 }
示例#7
0
 public void ThenIClickedOnTheViewGradesOfTheStudyPlanColumn()
 {
     try
     {
         string spName = DatabaseTools.GetActivityName(Enumerations.ActivityType.StudyPlan);
         _gbDefaultUxPage.SearchActivityByTitle(spName);
         _gbInstructorUxPage.ClickViewGrades(spName);
     }
     catch (Exception e)
     {
         GenericHelper.Logs(e.ToString(), "FAILED");
         Assert.Fail(e.ToString());
     }
 }
示例#8
0
 public void WhenISelectEditOptionOfActivity()
 {
     try
     {
         string actName = DatabaseTools.GetActivityName(Enumerations.ActivityType.MyTest);
         _contentLibraryUxPage.ClickActivityCmenu(actName);
         _contentLibraryUxPage.SelectEditCmenuOption();
     }
     catch (Exception e)
     {
         GenericHelper.Logs(e.ToString(), "FAILED");
         Assert.Fail(e.ToString());
     }
 }
示例#9
0
 public void ThenIUnassignTheStudyplan()
 {
     try
     {
         string SPName = DatabaseTools.GetActivityName(Enumerations.ActivityType.StudyPlan);
         _calendarHedDefaultUxPage.UnAssignActivity(SPName);
         _showMessagePage.ClickOk();
         Thread.Sleep(2000);
         GenericHelper.SelectDefaultWindow();
     }
     catch (Exception e)
     {
         GenericHelper.Logs(e.ToString(), "FAILED");
         Assert.Fail(e.ToString());
     }
 }
示例#10
0
 public void ThenIEditTheActivityAndNavigateToGradesTab()
 {
     try
     {
         GenericHelper.WaitUtilWindow("Course Materials");
         GenericHelper.SelectWindow("Course Materials");
         _contentLibraryUxPage.GetControlToLeftFrame();
         string actName = DatabaseTools.GetActivityName(Enumerations.ActivityType.MyTest);
         _contentLibraryUxPage.ClickActivityCmenu(actName);
         _contentLibraryUxPage.SelectEditCmenuOption();
         _randomAssessmentPage.NavigateGradesTab();
     }
     catch (Exception e)
     {
         GenericHelper.Logs(e.ToString(), "FAILED");
         Assert.Fail(e.ToString());
     }
 }
示例#11
0
        public void ThenIAssignTheStudyPlanToNthDateAndEnsureThatItIsPastDue()
        {
            try

            {
                GenericHelper.WaitUntilElement(By.XPath("//td[@class='HighlightTodayCell']"));


                string SPName = DatabaseTools.GetActivityName(Enumerations.ActivityType.StudyPlan);

                _calendarHedDefaultUxPage.AssignActivityToPreviousDate(SPName);
                _showAssignedContentListPage.ClickYesButton();
                GenericHelper.SelectDefaultWindow();
            }
            catch (Exception e)
            {
                GenericHelper.Logs(e.ToString(), "FAILED");
                Assert.Fail(e.ToString());
            }
        }
示例#12
0
 public void ThenISelectTheStudyPlanAndCanFindMoveButtonInTopOfTheCalendar()
 {
     try
     {
         string SPName = DatabaseTools.GetActivityName(Enumerations.ActivityType.StudyPlan);
         _calendarHedDefaultUxPage.SelectCheckBoxOfActivityInAdvanceView(SPName);
         if (_calendarHedDefaultUxPage.VerifyIsMoveButtonEnabled())
         {
             GenericHelper.Logs("Move button is Enabled", "PASSED");
         }
         else
         {
             GenericHelper.Logs("Move button is not Enabled", "FAILED");
             throw new Exception("Move button is not Enabled");
         }
     }
     catch (Exception e)
     {
         GenericHelper.Logs(e.ToString(), "FAILED");
         Assert.Fail(e.ToString());
     }
 }
示例#13
0
        public void ThenIAssignedAnyActivityAlongWithStudyPlanToAnyDueDateSayNIsTheDate()
        {
            try
            {
                string SPName = DatabaseTools.GetActivityName(Enumerations.ActivityType.StudyPlan);
                _calendarHedDefaultUxPage.AssignActivityToCurrentDate(SPName);

                _showAssignedContentListPage.ClickYesButton();


                string Actname = "03-01 Span Practice- Vocabulary: La casa";
                _calendarHedDefaultUxPage.SearchActivty(Actname);
                _calendarHedDefaultUxPage.UnAssignActivityInSearchView(Actname);
                _calendarHedDefaultUxPage.AssignActivityToCurrentDateInSearchView("03-01 Span Practice- Vocabulary: La casa");
                _showAssignedContentListPage.ClickYesButton();
                GenericHelper.SelectDefaultWindow();
            }
            catch (Exception e)
            {
                GenericHelper.Logs(e.ToString(), "FAILED");
                Assert.Fail(e.ToString());
            }
        }
        // Code to Drag and drop the activity in to the right frame
        public void ToDragAndDrop()
        {
            try
            {
                GenericHelper.SelectWindow("Calendar");
                string courseNameFolder = DatabaseTools.GetActivityName(Enumerations.ActivityType.Folder);
                // Code to Drag and drop the activity in to the right frame
                int rowNo = 2;
                GenericHelper.WaitUntilElement(By.XPath("//div[@id='TreeViewContainer']/table[" + rowNo + "]"));
                string getcourseName = WebDriver.FindElement(By.XPath("//div[@id='TreeViewContainer']/table[" + rowNo + "]")).Text.Trim();
                if (courseNameFolder == getcourseName)
                {
                    WebDriver.FindElement(By.XPath("//table[@id='grdCourse']/tbody/tr[" + rowNo + "]/td/INPUT[contains(@onclick,'ToGetCourseID(this);')]")).Click();
                    GenericHelper.Logs("ContainerCourse has been successfully selected", "passed");
                }
                while (courseNameFolder != getcourseName)
                {
                    rowNo         = rowNo + 1;
                    getcourseName = WebDriver.FindElement(By.XPath("//div[@id='TreeViewContainer']/table[" + rowNo + "]")).Text.Trim();

                    if (courseNameFolder == getcourseName)
                    {
                        IWebElement movetoQuestion =
                            WebDriver.FindElement(By.XPath("//div[@id='TreeViewContainer']/table[" + rowNo + "]"));

                        IWebElement pickFolder = WebDriver.FindElement(By.XPath("//div[@id='TreeViewContainer']/table[" + rowNo + "]/tbody/tr/td[3]/descendant::div[@title='Benchmark Tests']"));
                        if (Browser.Equals("FF") || Browser.Equals("GC"))
                        {
                            if (Browser.Equals("FF"))
                            {
                                WebDriver.FindElement(
                                    By.XPath("//div[@id='TreeViewContainer']/table[" + rowNo +
                                             "]/tbody/tr/td[3]/descendant::div[@title='Benchmark Tests']")).SendKeys("");
                            }
                            IWebElement sourceElement = WebDriver.FindElement(By.XPath("//div[@id='TreeViewContainer']/table[" + rowNo + "]/tbody/tr/td[3]/descendant::div[@title='Benchmark Tests']"));
                            IWebElement element       = WebDriver.FindElement(By.XPath("//div[@id='TreeViewContainer']/table[" + rowNo + "]/tbody/tr/td[2]/descendant::img[@onclick='ImitateGridTreeNodeExpand(this)']"));
                            IWebElement target        = WebDriver.FindElement(By.XPath("//span[@class='dvDueAssignmentsTodayHeaderTextCss']"));
                            (new Actions(WebDriver)).DragAndDrop(element, target).Build().Perform();
                            Thread.Sleep(5000);
                            IWebElement element1 = WebDriver.FindElement(By.XPath("//div[@id='TreeViewContainer']/table[" + rowNo + "]/tbody/tr/td[2]/descendant::img[@onclick='ImitateGridTreeNodeExpand(this)']"));
                            IWebElement target1  = WebDriver.FindElement(By.XPath("//span[@class='dvDueAssignmentsTodayHeaderTextCss']"));
                            (new Actions(WebDriver)).DragAndDrop(element1, target1).Build().Perform();
                            Thread.Sleep(5000);
                            break;
                        }
                        else
                        {
                            // Purpose: Grab Calendar Element
                            Actions builder = new Actions(WebDriver);
                            GenericHelper.WaitUntilElement(
                                By.XPath("//div[@id='TreeViewContainer']/table[" + rowNo +
                                         "]/tbody/tr/td[3]/descendant::div[@title='Benchmark Tests']"));
                            WebDriver.FindElement(By.XPath("//div[@id='TreeViewContainer']/table[" + rowNo + "]/tbody/tr/td[3]/descendant::div[@title='Benchmark Tests']")).SendKeys("");
                            builder.ClickAndHold(pickFolder).Build().Perform();
                            // Purpose: Switch to the Frame (you havent told webdriver to un-grab)
                            WebDriver.SwitchTo().DefaultContent();
                            // Purpose: Move and Drop Element on Calendar
                            IWebElement targetElement = WebDriver.FindElement(By.XPath("//div[@class='dvDueAssignmentsTodayHeaderCss']"));
                            builder.MoveToElement(targetElement).Release().Build().Perform();
                            Thread.Sleep(5000);
                            break;
                        }
                    }
                }
            }
            catch (WebDriverException e)
            {
                GenericHelper.Logs(e.ToString(), "FAILED");
                throw new Exception(e.ToString());
            }
        }
        public void GivenStudentHasAlreadySubmittedTheStudyPlansIfNotThenSubmitTheStudyPlans()
        {
            try
            {
                bool SubmissionStatus1 = true;
                bool SubmissionStatus2 = true;
                bool SubmissionStatus3 = true;

                bool SubmissionStatus = true;

                string isSpAlreadySubmitted1 = DatabaseTools.GetSubmissionStatusOfActivity(Enumerations.ActivityType.SpWith1Rem);
                if (isSpAlreadySubmitted1 == null || isSpAlreadySubmitted1.Equals("False") || isSpAlreadySubmitted1.Equals(""))
                {
                    SubmissionStatus1 = false;
                }
                string isSpAlreadySubmitted2 = DatabaseTools.GetSubmissionStatusOfActivity(Enumerations.ActivityType.Sp1With3Rem);
                if (isSpAlreadySubmitted2 == null || isSpAlreadySubmitted2.Equals("False") || isSpAlreadySubmitted2.Equals(""))
                {
                    SubmissionStatus2 = false;
                }
                string isSpAlreadySubmitted3 = DatabaseTools.GetSubmissionStatusOfActivity(Enumerations.ActivityType.Sp2With3Rem);
                if (isSpAlreadySubmitted3 == null || isSpAlreadySubmitted3.Equals("False") || isSpAlreadySubmitted3.Equals(""))
                {
                    SubmissionStatus3 = false;
                }

                SubmissionStatus = SubmissionStatus1 && SubmissionStatus2;

                if ((SubmissionStatus && SubmissionStatus3) == false)
                {
                    string isSpAlreadySubmitted = DatabaseTools.GetSubmissionStatusOfActivity(Enumerations.ActivityType.SpWith1Rem);
                    if (isSpAlreadySubmitted == null || isSpAlreadySubmitted.Equals("False") || isSpAlreadySubmitted.Equals(""))
                    {
                        string _SpName = DatabaseTools.GetActivityName(Enumerations.ActivityType.SpWith1Rem);

                        GenericTestStep.StepToBrowsedUrlForPegasusUser("CsSmsStudent");
                        GenericTestStep.StepToLoggedIntoTheCourseSpaceAsSMSStudent();
                        GenericTestStep.StepToCloseStudentHelpTextWindow();
                        GenericTestStep.StepToIAmOnThePage("Global Home");
                        GenericTestStep.StepToSelectTheCreatedCourse(_courseName);
                        GenericTestStep.StepToItShouldBeOnPage("Today's View");
                        GenericTestStep.StepToNavigateToTheTab("Course Materials");

                        if (_SpName != null)
                        {
                            _coursePreviewMainUxPage.OpenAsset(_SpName);
                        }
                        GenericHelper.WaitUtilWindow("Open Study Plan");
                        _drtDefaultUxPage.ClickBegin();
                        _showMessagePage.ClickContinue();
                        GenericHelper.SelectWindow("Pre Test");
                        _studentPresentationPage.AnswerFalse();
                        _studentPresentationPage.SubmitActivity();
                        WebDriver.Close();
                        GenericHelper.SelectWindow("Open Study Plan");
                        WebDriver.Navigate().Refresh();
                        Thread.Sleep(4000);

                        // studymaterial presentation
                        GenericHelper.WaitUtilWindow("Open Study Plan");
                        GenericHelper.SelectWindow("Open Study Plan");
                        _drtStudentUxPage.SelectAllAvailableStudyMaterial();
                        _drtStudentUxPage.SelectFrame();
                        _drtStudentUxPage.OpenFirstStudyMaterial();
                        Thread.Sleep(2000);
                        GenericHelper.SelectWindow("Web Activity");
                        _studentPresentationPage.AnswerTrue();
                        _studentPresentationPage.SubmitActivity();
                        WebDriver.Close();
                        GenericHelper.SelectWindow("Open Study Plan");
                        // WebDriver.Navigate().Refresh();
                        //Thread.Sleep(4000);
                        _drtDefaultUxPage.ClickReturnToCourse();
                        Thread.Sleep(4000);
                        DatabaseTools.UpdateSubmissionStatusOfActivity(_SpName);
                    }

                    string isSp2AlreadySubmitted = DatabaseTools.GetSubmissionStatusOfActivity(Enumerations.ActivityType.Sp1With3Rem);
                    if (isSp2AlreadySubmitted == null || isSp2AlreadySubmitted.Equals("False") || isSp2AlreadySubmitted.Equals(""))
                    {
                        string _SpName = DatabaseTools.GetActivityName(Enumerations.ActivityType.Sp1With3Rem);

                        GenericTestStep.StepToBrowsedUrlForPegasusUser("CsSmsStudent");
                        GenericTestStep.StepToLoggedIntoTheCourseSpaceAsSMSStudent();
                        GenericTestStep.StepToCloseStudentHelpTextWindow();
                        GenericTestStep.StepToIAmOnThePage("Global Home");
                        GenericTestStep.StepToSelectTheCreatedCourse(_courseName);
                        GenericTestStep.StepToItShouldBeOnPage("Today's View");
                        GenericTestStep.StepToNavigateToTheTab("Course Materials");

                        if (_SpName != null)
                        {
                            _coursePreviewMainUxPage.OpenAsset(_SpName);
                        }
                        GenericHelper.WaitUtilWindow("Open Study Plan");
                        _drtDefaultUxPage.ClickBegin();
                        _showMessagePage.ClickContinue();
                        GenericHelper.SelectWindow("Pre Test");
                        _studentPresentationPage.AnswerFalse();
                        _studentPresentationPage.SubmitActivity();
                        WebDriver.Close();
                        GenericHelper.SelectWindow("Open Study Plan");
                        WebDriver.Navigate().Refresh();
                        Thread.Sleep(4000);


                        // studymaterial presentation
                        // first studymaterial
                        GenericHelper.WaitUtilWindow("Open Study Plan");
                        GenericHelper.SelectWindow("Open Study Plan");
                        _drtStudentUxPage.SelectAllAvailableStudyMaterial();
                        _drtStudentUxPage.SelectFrame();
                        _drtStudentUxPage.OpenFirstStudyMaterial();
                        Thread.Sleep(2000);
                        GenericHelper.SelectWindow("Web Activity");
                        _studentPresentationPage.AnswerFalse();
                        _studentPresentationPage.SubmitActivity();
                        WebDriver.Close();
                        GenericHelper.SelectWindow("Open Study Plan");
                        WebDriver.Navigate().Refresh();
                        Thread.Sleep(4000);

                        // Second studymaterial
                        GenericHelper.WaitUtilWindow("Open Study Plan");
                        GenericHelper.SelectWindow("Open Study Plan");
                        _drtStudentUxPage.SelectFrame();
                        _drtStudentUxPage.OpenSecondStudyMaterial();
                        Thread.Sleep(2000);
                        GenericHelper.SelectWindow("Web Activity");
                        _studentPresentationPage.AnswerTrue();
                        _studentPresentationPage.SubmitActivity();
                        WebDriver.Close();
                        GenericHelper.SelectWindow("Open Study Plan");
                        WebDriver.Navigate().Refresh();
                        Thread.Sleep(4000);

                        // Third studymaterial
                        GenericHelper.WaitUtilWindow("Open Study Plan");
                        GenericHelper.SelectWindow("Open Study Plan");
                        _drtStudentUxPage.SelectFrame();
                        _drtStudentUxPage.OpenThirdStudyMaterial();
                        Thread.Sleep(2000);
                        GenericHelper.SelectWindow("Web Activity");
                        _studentPresentationPage.AnswerTrue();
                        _studentPresentationPage.SubmitActivity();
                        WebDriver.Close();
                        GenericHelper.SelectWindow("Open Study Plan");
                        WebDriver.Navigate().Refresh();
                        Thread.Sleep(4000);
                        _drtDefaultUxPage.ClickReturnToCourse();
                        Thread.Sleep(4000);
                        DatabaseTools.UpdateSubmissionStatusOfActivity(_SpName);
                    }

                    string isSp3AlreadySubmitted = DatabaseTools.GetSubmissionStatusOfActivity(Enumerations.ActivityType.Sp2With3Rem);
                    if (isSp3AlreadySubmitted == null || isSp3AlreadySubmitted.Equals("False") || isSp3AlreadySubmitted.Equals(""))
                    {
                        string _SpName = DatabaseTools.GetActivityName(Enumerations.ActivityType.Sp2With3Rem);

                        GenericTestStep.StepToBrowsedUrlForPegasusUser("CsSmsStudent");
                        GenericTestStep.StepToLoggedIntoTheCourseSpaceAsSMSStudent();
                        GenericTestStep.StepToCloseStudentHelpTextWindow();
                        GenericTestStep.StepToIAmOnThePage("Global Home");
                        GenericTestStep.StepToSelectTheCreatedCourse(_courseName);
                        GenericTestStep.StepToItShouldBeOnPage("Today's View");
                        GenericTestStep.StepToNavigateToTheTab("Course Materials");

                        if (_SpName != null)
                        {
                            _coursePreviewMainUxPage.OpenAsset(_SpName);
                        }
                        GenericHelper.WaitUtilWindow("Open Study Plan");
                        _drtDefaultUxPage.ClickBegin();
                        _showMessagePage.ClickContinue();
                        GenericHelper.SelectWindow("Pre Test");
                        _studentPresentationPage.AnswerFalse();
                        _studentPresentationPage.SubmitActivity();
                        WebDriver.Close();
                        GenericHelper.SelectWindow("Open Study Plan");
                        WebDriver.Navigate().Refresh();
                        Thread.Sleep(4000);


                        // studymaterial presentation
                        // first studymaterial
                        GenericHelper.WaitUtilWindow("Open Study Plan");
                        GenericHelper.SelectWindow("Open Study Plan");
                        _drtStudentUxPage.SelectAllAvailableStudyMaterial();
                        _drtStudentUxPage.SelectFrame();
                        _drtStudentUxPage.OpenFirstStudyMaterial();
                        Thread.Sleep(2000);
                        GenericHelper.SelectWindow("Web Activity");
                        _studentPresentationPage.AnswerFalse();
                        _studentPresentationPage.SubmitActivity();
                        WebDriver.Close();
                        GenericHelper.SelectWindow("Open Study Plan");
                        WebDriver.Navigate().Refresh();
                        Thread.Sleep(4000);

                        // Second studymaterial
                        GenericHelper.WaitUtilWindow("Open Study Plan");
                        GenericHelper.SelectWindow("Open Study Plan");
                        _drtStudentUxPage.SelectFrame();
                        _drtStudentUxPage.OpenSecondStudyMaterial();
                        Thread.Sleep(2000);
                        GenericHelper.SelectWindow("Web Activity");
                        _studentPresentationPage.AnswerTrue();
                        _studentPresentationPage.SubmitActivity();
                        WebDriver.Close();
                        GenericHelper.SelectWindow("Open Study Plan");
                        WebDriver.Navigate().Refresh();
                        Thread.Sleep(4000);

                        // Third studymaterial
                        GenericHelper.WaitUtilWindow("Open Study Plan");
                        GenericHelper.SelectWindow("Open Study Plan");
                        _drtStudentUxPage.SelectFrame();
                        _drtStudentUxPage.OpenThirdStudyMaterial();
                        Thread.Sleep(2000);
                        GenericHelper.SelectWindow("Web Activity");
                        _studentPresentationPage.AnswerTrue();
                        _studentPresentationPage.SubmitActivity();
                        WebDriver.Close();
                        GenericHelper.SelectWindow("Open Study Plan");
                        WebDriver.Navigate().Refresh();
                        Thread.Sleep(4000);

                        _drtDefaultUxPage.ClickReturnToCourse();
                        Thread.Sleep(4000);
                        DatabaseTools.UpdateSubmissionStatusOfActivity(_SpName);
                    }
                    GenericTestStep.StepToClickedOnTheLogoutLinkToGetLoggedOutFromTheApplication();
                }
            }
            catch (Exception e)
            {
                GenericHelper.Logs(e.ToString(), "FAILED");
                Assert.Fail(e.ToString());
            }
        }
示例#16
0
        //Purpose: Method to select a folder type activity (benchmark for authored) in the left frame after scrolling
        public void ToSelectMathXl()
        {
            int rowNo = 2;

            WebDriver.SwitchTo().Frame("ifrmleft");
            string folderNameFromDb    = DatabaseTools.GetActivityName(Enumerations.ActivityType.Folder).Trim();
            string folderNameFromFrame =
                WebDriver.FindElement(
                    By.XPath("//table[@id='grdContentLibrary']/tbody/tr[" + rowNo + "]")).Text.Trim();

            if (folderNameFromDb == folderNameFromFrame)
            {
                WebDriver.FindElement(By.XPath("//table[@id='grdContentLibrary']/tbody/tr[" + rowNo + "]//img[contains(@src,'/Pegasus/images/spacer.gif')]")).Click();
                GenericHelper.Logs("Folder has been successfully selected", "passed");
            }
            while (folderNameFromDb != folderNameFromFrame)
            {
                rowNo = rowNo + 1;
                folderNameFromFrame = WebDriver.FindElement(By.XPath("//table[@id='grdContentLibrary']/tbody/tr[" + rowNo + "]")).Text.Trim();
                if (folderNameFromDb == folderNameFromFrame)
                {
                    var js = WebDriver as IJavaScriptExecutor;
                    if (js != null)
                    {
                        var title = (string)js.ExecuteScript("window.scrollBy(0,200)", "");
                    }
                    IWebElement menu    = WebDriver.FindElement(By.XPath("//table[@id='grdContentLibrary']/tbody/tr[" + rowNo + "]//img[contains(@src,'/Pegasus/images/spacer.gif')]"));
                    var         builder = new Actions(WebDriver);
                    builder.MoveToElement(menu).Build().Perform();
                    WebDriver.FindElement(By.XPath("//table[@id='grdContentLibrary']/tbody/tr[" + rowNo + "]//img[contains(@src,'/Pegasus/images/spacer.gif')]")).Click();
                    GenericHelper.Logs("Folder has been successfully selected", "passed");
                }
            }

            // Below code is to select the home work type activity
            int rowNoHomework = 2;

            Thread.Sleep(4000);
            WebDriver.SwitchTo().ActiveElement();
            string homeworkName = DatabaseTools.GetActivityName(Enumerations.ActivityType.Homework).Trim();

            GenericHelper.WaitUntilElement(By.XPath("//table[@id='grdContentLibrary']/tbody/tr[" + rowNoHomework + "]"));
            string homeworkNamefromFrame = WebDriver.FindElement(
                By.XPath("//table[@id='grdContentLibrary']/tbody/tr[" + rowNoHomework + "]")).Text.Trim();

            if (homeworkName == homeworkNamefromFrame)
            {
                WebDriver.FindElement(By.XPath("//table[@id='grdContentLibrary']/tbody/tr[" + rowNoHomework + "]//INPUT[@id='grdContentLibrary$_ctrl1']")).Click();
                GenericHelper.Logs("Homework Type activity has been successfully selected", "passed");
            }
            while (homeworkName != homeworkNamefromFrame)
            {
                rowNoHomework         = rowNoHomework + 1;
                homeworkNamefromFrame = WebDriver.FindElement(
                    By.XPath("//table[@id='grdContentLibrary']/tbody/tr[" + rowNoHomework + "]")).Text.Trim();

                if (homeworkName == homeworkNamefromFrame)
                {
                    WebDriver.FindElement(By.XPath("//table[@id='grdContentLibrary']/tbody/tr[" + rowNoHomework + "]//INPUT[@id='grdContentLibrary$_ctrl1']")).Click();
                    GenericHelper.Logs("Homework Type activity has been successfully selected", "passed");
                }
                WebDriver.SwitchTo().DefaultContent();
            }
        }