public void GivenAutohoredCourseIsAlreayApprovedInTheCourseSpaceIfNotThenApproveTheAuthoredCourseInCourseSpace()
 {
     try
     {
         //Purpose: Steps To Create Test Data
         string isCourseAlreadyApproved = DatabaseTools.GetCourseApproveStatus(Enumerations.CourseType.MySpanishLabMasterCourse);
         if (isCourseAlreadyApproved == null || isCourseAlreadyApproved.Equals("False") || isCourseAlreadyApproved.Equals(""))
         {
             string getCopiedCourse = DatabaseTools.GetCourse(Enumerations.CourseType.MySpanishLabMasterCourse);
             GenericTestStep.StepToBrowsedUrlForPegasusUser("HED CS Admin");
             GenericTestStep.StepToLoggedIntoTheCourseSpaceAsHedCSAdmin();
             GenericTestStep.StepToItShouldBeOnPage("Course Enrollment");
             GenericTestStep.StepToNavigateToTheTab("Publishing");
             GenericTestStep.StepToSwitchToTheTab("Manage Products");
             GenericTestStep.StepToItShouldShowTheManageProductsPage();
             GenericTestStep.StepToSelectTheCourseToApprove("MySpanishLab Master Course");
             GenericTestStep.StepToClickedOnTheApproveCourseLink("Approve");
             GenericTestStep.StepToItShouldDisplaySuccessfulMessage("Published course marked as Approved.");
             DatabaseTools.UpdateCourseApproveStatusTrue(getCopiedCourse);
         }
     }
     catch (Exception e)
     {
         GenericHelper.Logs(e.ToString(), "FAILED");
         Assert.Fail(e.ToString());
     }
 }
Beispiel #2
0
 public void GivenActivityIsAlreadySubmittedByTheStudentIfNotThenSubmitTheActivityByTheStudent()
 {
     try
     {
         string isActivityAlreadySubmitted = DatabaseTools.GetSubmissionStatusOfActivity(Enumerations.ActivityType.Essay);
         if (isActivityAlreadySubmitted == null || isActivityAlreadySubmitted.Equals("False") || isActivityAlreadySubmitted.Equals(""))
         {
             GenericTestStep.StepToBrowsedUrlForPegasusUser("CsSmsStudent");
             GenericTestStep.StepToLoggedIntoTheCourseSpaceAsSMSStudent();
             GenericTestStep.StepToCloseStudentHelpTextWindow();
             GenericTestStep.StepToItShouldBeOnPage("Global Home");
             GenericTestStep.StepToSelectTheCreatedCourse(_courseName);
             GenericTestStep.StepToItShouldBeOnPage("Today's View");
             GenericTestStep.StepToNavigateToTheTab("Course Materials");
             GenericTestStep.StepToNavigateInTheEssayTypeActivityFolder();
             if (_activityName != null)
             {
                 GenericTestStep.StepToClickOnTheLink(_activityName);
             }
             GenericTestStep.StepToSubmitEssayTypeActivitybyStudent(_activityName);
             GenericTestStep.StepToClickedOnTheLogoutLinkToGetLoggedOutFromTheApplication();
         }
     }
     catch (Exception e)
     {
         GenericHelper.Logs(e.ToString(), "FAILED");
         Assert.Fail(e.ToString());
     }
 }
 public void GivenAuthoredCourseCopyIsAlreadyPublishedIfNotThenPublishTheAuthoredCourseCopy()
 {
     try
     {
         //Purpose: Steps To Create Test Data
         string isCourseAlreadyPublished = DatabaseTools.GetCoursePublishStatus(Enumerations.CourseType.MySpanishLabMasterCourse);
         if (isCourseAlreadyPublished == null || isCourseAlreadyPublished.Equals("False") || isCourseAlreadyPublished.Equals(""))
         {
             string getCopiedCourse = DatabaseTools.GetCourse(Enumerations.CourseType.MySpanishLabMasterCourse);
             if (getCopiedCourse == null)
             {
                 throw new ArgumentNullException("getCo" + "piedCourse is null");
             }
             GenericTestStep.StepToBrowsedUrlForPegasusUser("HED WS Admin");
             GenericTestStep.StepToLoggedIntoTheWorkspaceAsHedWsAdmin();
             GenericTestStep.StepToItShouldBeOnPage("Course Enrollment");
             GenericTestStep.StepToSelectTheCourse("MySpanishLab Authored Master Course");
             GenericTestStep.StepToClickOnTheCmenuOfCourse();
             GenericTestStep.StepToClickOnTheCourseCMenuOptionLink("Publish Master Course");
             GenericTestStep.StepToIShouldSeeTheNewPopup("Publishing Notes");
             GenericTestStep.StepToEnterThePublishingNotes();
             GenericTestStep.StepToClickOnThePublishButton();
             GenericTestStep.StepToItShouldDisplaySuccessfulMessage("Course published successfully.");
             DatabaseTools.UpdateCoursePublishStatusTrue(getCopiedCourse);
             GenericTestStep.StepToClickedOnTheLogoutLinkToGetLoggedOutFromTheApplication();
         }
     }
     catch (Exception e)
     {
         GenericHelper.Logs(e.ToString(), "FAILED");
         Assert.Fail(e.ToString());
     }
 }
        public void GivenSMSUserIsAlreadyEnrolledIntoTheProgramIfNotThenEnrollTheSMSUserInProgram()
        {
            try
            {
                string isProgramCourseCreated = DatabaseTools.GetCourse(Enumerations.CourseType.ProgramCourse);
                if (isProgramCourseCreated == null || isProgramCourseCreated.Equals("False") || isProgramCourseCreated.Equals(""))
                {
                    GenericTestStep.StepToBrowsedUrlForPegasusUser("CsSmsInstructor");
                    GenericTestStep.StepToLoggedIntoTheCourseSpaceAsSMSInstructor();
                    GenericTestStep.StepToIAmOnThePage("Global Home");
                    GenericTestStep.StepToCreateProgramCourse();
                    GenericTestStep.StepToClickedOnTheLogoutLinkToGetLoggedOutFromTheApplication();

                    GenericTestStep.StepToBrowsedUrlForPegasusUser("CsSmsStudent");
                    GenericTestStep.StepToLoggedIntoTheCourseSpaceAsSMSStudent();
                    GenericTestStep.StepToCloseStudentHelpTextWindow();
                    GenericTestStep.StepToIAmOnThePage("Global Home");
                    GenericTestStep.StepToEnrolStudentToCourse("ProductTypeProg");
                    GenericTestStep.StepToClickedOnTheLogoutLinkToGetLoggedOutFromTheApplication();
                }
            }
            catch (Exception e)
            {
                GenericHelper.Logs(e.ToString(), "FAILED");
                Assert.Fail(e.ToString());
            }
        }
        public void GivenSmsStudentisalreadyenrolledintotheSectionifnotthenenrolltheSmSusertoSection()
        {
            try
            {
                string isStudentEnrolled = DatabaseTools.GetEnrolledUser(Enumerations.UserType.CsSmsStudent);
                if (isStudentEnrolled == null || isStudentEnrolled.Equals("False") || isStudentEnrolled.Equals(""))
                {
                    GenericTestStep.StepToBrowsedUrlForPegasusUser("CsSmsInstructor");
                    GenericTestStep.StepToLoggedIntoTheCourseSpaceAsSMSInstructor();
                    GenericTestStep.StepToIAmOnThePage("Global Home");
                    GenericTestStep.StepToCreateProgramCourse();
                    GenericTestStep.StepToClickedOnTheLogoutLinkToGetLoggedOutFromTheApplication();

                    GenericTestStep.StepToBrowsedUrlForPegasusUser("CsSmsStudent");
                    GenericTestStep.StepToLoggedIntoTheCourseSpaceAsSMSStudent();
                    GenericTestStep.StepToCloseStudentHelpTextWindow();
                    GenericTestStep.StepToIAmOnThePage("Global Home");
                    GenericTestStep.StepToEnrolStudentToCourse("ProductTypeProg");
                    GenericTestStep.StepToSelectTheSectionName();
                    GenericTestStep.StepToClickedOnTheLogoutLinkToGetLoggedOutFromTheApplication();
                }
            }
            catch (Exception e)
            {
                GenericHelper.Logs(e.ToString(), "FAILED");
                Assert.Fail(e.ToString());
            }
        }
 public void GivenAuthoredCourseCopyAlreadyCreatedIfNotThenCreateTheAuthoredCourseCopy()
 {
     try
     {
         string isCourseAlreadyCopied = DatabaseTools.GetCourse(Enumerations.CourseType.MySpanishLabMasterCourse);
         if (isCourseAlreadyCopied == null)
         {
             //Purpose: Steps To Create Test Data
             GenericTestStep.StepToBrowsedUrlForPegasusUser("HED WS Admin");
             GenericTestStep.StepToLoggedIntoTheWorkspaceAsHedWsAdmin();
             GenericTestStep.StepToItShouldBeOnPage("Course Enrollment");
             GenericTestStep.StepToIAmOnTheUserCreationPage();
             GenericTestStep.StepToSelectTheCourse("MySpanishLab AuthoredCourse");
             GenericTestStep.StepToClickOnTheCmenuOfCourse();
             GenericTestStep.StepToClickOnTheCourseCMenuOptionLink("Copy as Master Course");
             GenericTestStep.StepToIShouldSeeTheNewPopup("Copy as Master Course");
             GenericTestStep.StepToCopyTheCourseInSameWorkspace("Master");
             GenericTestStep.StepToItShouldDisplaySuccessfulMessage("Copied as master course.");
             GenericTestStep.StepToWaitForTheCourseOutFromAssignToCopyState();
         }
     }
     catch (Exception e)
     {
         GenericHelper.Logs(e.ToString(), "FAILED");
         Assert.Fail(e.ToString());
     }
 }
 public void GivenSMSUserIsAlreadyCreatedIfNotThenCreateSMSUser()
 {
     try
     {
         string isInstructorAlreadyCreated = DatabaseTools.GetUsername(Enumerations.UserType.CsSmsInstructor);
         if (isInstructorAlreadyCreated == null || isInstructorAlreadyCreated.Equals("False") ||
             isInstructorAlreadyCreated.Equals(""))
         {
             GenericTestStep.StepToBrowsedUrlForPegasusUser("SMSRegistration");
             GenericTestStep.StepToClickedTheIAcceptButton();
             GenericTestStep.StepToCreateNewSmsUser("CsSmsInstructor");
         }
         string isstudentAlreadyCreated = DatabaseTools.GetUsername(Enumerations.UserType.CsSmsStudent);
         if (isstudentAlreadyCreated == null || isstudentAlreadyCreated.Equals("False") || isstudentAlreadyCreated.Equals(""))
         {
             GenericTestStep.StepToBrowsedUrlForPegasusUser("SMSRegistration");
             GenericTestStep.StepToClickedTheIAcceptButton();
             GenericTestStep.StepToCreateNewSmsUser("CsSmsStudent");
         }
     }
     catch (Exception e)
     {
         GenericHelper.Logs(e.ToString(), "FAILED");
         Assert.Fail(e.ToString());
     }
 }
 public void GivenStudentisalreadypromotedtoTAifnotthenpromotethestudentasTa()
 {
     try
     {
         GenericTestStep.StepToBrowsedUrlForPegasusUser("CsSmsInstructor");
         GenericTestStep.StepToLoggedIntoTheCourseSpaceAsSMSInstructor();
         GenericTestStep.StepToIAmOnThePage("Global Home");
         GenericHelper.SelectWindow("Global Home");
         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();
         GenericTestStep.StepToIAmOnThePage("Program Administration");
         GenericHelper.SelectWindow("Program Administration");
         GenericTestStep.StepToNavigateToTheTab("Sections");
         // Will need to change this line as per the authored course
         GenericHelper.SelectWindow("Program Administration");
         string sectionName = DatabaseTools.GetSectionName(Enumerations.CourseType.ProgramCourse).Trim();
         _sectionSearch.ToSearchSection(sectionName);
         _sectionSearch.SelectSectionAfterSearch();
         GenericTestStep.StepToIAmOnThePage("Calendar");
         GenericHelper.SelectWindow("Calendar");
         GenericTestStep.StepToNavigateToTheTab("Enrollments");
         GenericTestStep.StepToIAmOnThePage("Roster");
         _rosterPage.ToGrantTAPrivilege();
         GenericTestStep.StepToIAmOnThePage("Roster");
         GenericTestStep.StepToIClickedOnTheLogoutLinkToGetLoggedOutFromTheApplication();
     }
     catch (Exception e)
     {
         GenericHelper.Logs(e.ToString(), "FAILED");
         Assert.Fail(e.ToString());
     }
 }
 public void GivenCourseAssociationToProgramTypeProductIsAlreadyCreatedIfNotThenCreateAssociation()
 {
     try
     {
         string productName = DatabaseTools.GetProduct(Enumerations.ProductInstance.HedCoreProgram);
         string isMasterCourseAlreadyAssociatedToProduct = DatabaseTools.GetProductMaterCourseAssociatedStatus(productName);
         if (isMasterCourseAlreadyAssociatedToProduct == null || isMasterCourseAlreadyAssociatedToProduct.Equals("False") || isMasterCourseAlreadyAssociatedToProduct.Equals(""))
         {
             GenericTestStep.StepToBrowsedUrlForPegasusUser("HED CS Admin");
             GenericTestStep.StepToLoggedIntoTheCourseSpaceAsHedCSAdmin();
             GenericTestStep.StepToItShouldShowTheManageProductsPage();
             GenericTestStep.StepToSelectCourseInManageProductsPage("MySpanishLab Master Course");
             GenericTestStep.StepToSelectTheProductInTheRightFrame("HedCoreProgram");
             GenericTestStep.StepToAssociateTheCourseToProduct();
             GenericTestStep.StepToItShouldDisplaySuccessfulMessage("Approved courses programmed successfully.");
             DatabaseTools.UpdateProductMaterCourseAssociatedStatus(productName);
             GenericTestStep.StepToIClickedOnTheLogoutLinkToGetLoggedOutFromTheApplication();
         }
     }
     catch (Exception e)
     {
         GenericHelper.Logs(e.ToString(), "FAILED");
         Assert.Fail(e.ToString());
     }
 }
Beispiel #10
0
 public void GivenManualGradedQuestionIsAlreadySubmittedIfNotThenSubmitTheManualGraded()
 {
     try
     {
         string isActivityAlreadySubmitted = DatabaseTools.GetSubmissionStatusOfActivity(Enumerations.ActivityType.Essay);
         if (isActivityAlreadySubmitted == null || isActivityAlreadySubmitted.Equals("False") || isActivityAlreadySubmitted.Equals(""))
         {
             GenericTestStep.StepToBrowsedUrlForPegasusUser("CsSmsStudent");
             GenericTestStep.StepToLoggedIntoTheCourseSpaceAsSMSStudent();
             GenericTestStep.StepToCloseStudentHelpTextWindow();
             GenericTestStep.StepToItShouldBeOnPage("Global Home");
             GenericTestStep.StepToSelectTheSectionName();
             GenericTestStep.StepToItShouldBeOnPage("Today's View");
             GenericTestStep.StepToNavigateToTheTab("Course Materials");
             GenericTestStep.StepToNavigateInTheEssayTypeActivityFolder();
             if (_activityName != null)
             {
                 GenericTestStep.StepToClickOnTheLink(_activityName);
             }
             GenericTestStep.StepToSubmitEssayTypeActivitybyStudent(_activityName);
             GenericTestStep.StepToClickedOnTheLogoutLinkToGetLoggedOutFromTheApplication();
             // To submit grades by teacher
             GenericTestStep.StepToLoggedIntoTheCourseSpaceAsSMSInstructor();
             GenericTestStep.StepToIAmOnThePage("Global Home");
             GenericHelper.SelectWindow("Global Home");
             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();
             GenericTestStep.StepToIAmOnThePage("Program Administration");
             GenericHelper.SelectWindow("Program Administration");
             GenericTestStep.StepToNavigateToTheTab("Sections");
             GenericHelper.SelectWindow("Program Administration");
             string sectionName = DatabaseTools.GetSectionName(Enumerations.CourseType.ProgramCourse).Trim();
             _SectionSearch.ToSearchSection(sectionName);
             _SectionSearch.SelectSectionAfterSearch();
             GenericTestStep.StepToIAmOnThePage("Calendar");
             GenericHelper.SelectWindow("Calendar");
             GenericTestStep.StepToNavigateToTheTab("Gradebook");
             GenericHelper.SelectWindow("Gradebook");
             _gbDefaultUxPage.SearchActivityByTitle("SAM 0A-33 El mundo hispano.");
             _gbInstructorUXPage.ClickActivityCmenu("SAM 0A-33 El mundo hispano.");
             _gbInstructorUXPage.ClickViewAllSubmissionsLink();
             _viewSubmissionPage.OpenActivityViewSubmissionPage();
             _viewSubmissionPage.GiveSubmissionByTeacher("Teacher");
             GenericTestStep.StepToClickedOnTheLogoutLinkToGetLoggedOutFromTheApplication();
         }
     }
     catch (Exception e)
     {
         GenericHelper.Logs(e.ToString(), "FAILED");
         Assert.Fail(e.ToString());
     }
 }
Beispiel #11
0
 public static void BrowsedUrlForPegasusUser(string usertype)
 {
     try
     {
         GenericTestStep.StepToBrowsedUrlForPegasusUser(usertype);
     }
     catch (Exception e)
     {
         GenericHelper.Logs(e.ToString(), "FAILED");
         Assert.Fail(e.ToString());
     }
 }
Beispiel #12
0
 public void WhenIHaveLoggedIntoTheCourseSpaceAsTeachingAssistant()
 {
     try
     {
         GenericTestStep.StepToBrowsedUrlForPegasusUser("CsSmsStudent");
         GenericTestStep.StepToLoggedIntoTheCourseSpaceAsTeachingAssistant();
         GenericTestStep.StepToCloseStudentHelpTextWindow();
     }
     catch (Exception e)
     {
         GenericHelper.Logs(e.ToString(), "FAILED");
         throw new Exception(e.ToString());
     }
 }
 public void WhenIEnrollTheStudentInToTheSection()
 {
     try
     {
         GenericTestStep.StepToBrowsedUrlForPegasusUser("CsSmsStudent");
         GenericTestStep.StepToLoggedIntoTheCourseSpaceAsSMSStudent();
         GenericTestStep.StepToCloseStudentHelpTextWindow();
         GenericHelper.SelectWindow("Global Home");
         WebDriver.SwitchTo().DefaultContent();
         GenericHelper.CloseAnnouncementPage();
         GenericTestStep.StepToEnrolStudentToCourse("ProductTypeProg");
         GenericTestStep.StepToClickedOnTheLogoutLinkToGetLoggedOutFromTheApplication();
     }
     catch (Exception e)
     {
         GenericHelper.Logs(e.ToString(), "FAILED");
         Assert.Fail(e.ToString());
     }
 }
        public void GivenGivenTestingCourseCopyAlreadyCreatedIfNotThenCreateTheTestingCourseCopy()
        {
            string isTestingCourseCopyAlreadyCreated = DatabaseTools.GetCourse(Enumerations.CourseType.TestingCourse);

            if (isTestingCourseCopyAlreadyCreated == null || isTestingCourseCopyAlreadyCreated.Equals("False") ||
                isTestingCourseCopyAlreadyCreated.Equals(""))
            {
                GenericTestStep.StepToBrowsedUrlForPegasusUser("HED WS Admin");
                GenericTestStep.StepToLoggedIntoTheWorkspaceAsHedWsAdmin();
                GenericTestStep.StepToIAmOnTheUserCreationPage();
                GenericTestStep.StepToSelectTheCourse("MySpanishLab AuthoredCourse");
                GenericTestStep.StepToClickOnTheCmenuOfCourse();
                GenericTestStep.StepToClickOnTheCourseCMenuOptionLink("Copy as Testing Course");
                GenericTestStep.StepToIShouldSeeTheNewPopup("Copy as Testing Course");
                GenericTestStep.StepToCopyTheCourseInSameWorkspace("Testing");
                GenericTestStep.StepToItShouldDisplaySuccessfulMessage("Copied as test course.");
                GenericTestStep.StepToWaitForTheTestingCourseOutFromAssignToCopyState();
            }
        }
 public void GivenProgramTypeProductIsAlreadyCreatedIfNotThenCreateANewProgramTypeProduct()
 {
     try
     {
         string isProductAlreadyCreated = DatabaseTools.GetProduct(Enumerations.ProductInstance.HedCoreProgram);
         if (isProductAlreadyCreated == null || isProductAlreadyCreated.Equals("False") || isProductAlreadyCreated.Equals(""))
         {
             GenericTestStep.StepToBrowsedUrlForPegasusUser("HED CS Admin");
             GenericTestStep.StepToLoggedIntoTheCourseSpaceAsCSAdmin();
             GenericTestStep.StepToItShouldShowTheManageProductsPage();
             GenericTestStep.StepToClickTheCreateNewProductLink();
             GenericTestStep.StepToCreateHedGeneralTypeProduct("HedCoreProgram");
             GenericTestStep.StepToItShouldDisplaySuccessfulMessage("New product created successfully.");
         }
     }
     catch (Exception e)
     {
         GenericHelper.Logs(e.ToString(), "FAILED");
         Assert.Fail(e.ToString());
     }
 }
 public void GivenUserAlreadyCreatedInTheWorkspaceIfNotThenCreateTheUserInWrokspace()
 {
     try
     {
         string isUserAlreadyCreated = DatabaseTools.GetUsername(Enumerations.UserType.HedWsInstructor);
         if (isUserAlreadyCreated == null || isUserAlreadyCreated.Equals("False") || isUserAlreadyCreated.Equals(""))
         {
             //Purpose: Steps To Create Test Data
             GenericTestStep.StepToBrowsedUrlForPegasusUser("HED WS Admin");
             GenericTestStep.StepToLoggedIntoTheWorkspaceAsHedWsAdmin();
             GenericTestStep.StepToItShouldBeOnPage("Course Enrollment");
             GenericTestStep.StepToIAmOnTheUserCreationPage();
             GenericTestStep.StepTocreatetheUser();
         }
     }
     catch (Exception e)
     {
         GenericHelper.Logs(e.ToString(), "FAILED");
         Assert.Fail(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());
            }
        }