public void ThenItShouldShownUpTheChangesDoneInTheDefaultPreferencesOfTheActivityForTheNewlyCreatedActivity() { try { GenericTestStep.StepToNavigateToTheTab("Course Materials"); string newTest = GenericHelper.GenerateUniqueVariable("NewTest"); GenericHelper.SelectWindow("Course Materials"); _contentLibraryUxPage.ClickAddCourseMaterialsButton(); _contentLibraryUxPage.SelectWebActivity(); GenericHelper.WaitUtilWindow("Create activity"); GenericHelper.SelectDefaultWindow(); _addAssessmentPage.EnterActivityName(newTest); _addAssessmentPage.SelectRandomActivity(); _addAssessmentPage.ClickSaveAndContinue(); _randomAssessmentPage.NavigatePreferencesTab(); if (_randomAssessmentPage.GetQuestionsCount() == "2") { GenericHelper.Logs("Changes done for 'questions per page' and 'SpecifyNumberOfAttempts' in the default preferences are reflected for the new activity", "PASSED"); } else { GenericHelper.Logs("Changes done for 'questions per page' and 'SpecifyNumberOfAttempts' in the default preferences are not reflected for the new activity", "PASSED"); throw new Exception("Changes done for 'questions per page' and 'SpecifyNumberOfAttempts' in the default preferences are not reflected for the new activity"); } if (_randomAssessmentPage.verifyDefaultStyleSheetSelected() == "MSL100" && _randomAssessmentPage.GetTimeValue() == "02") { GenericHelper.Logs("Changes done for 'style sheet ' and 'Time required to complete the activity' in the default preferences are reflected for the new activity", "PASSED"); } else { GenericHelper.Logs("Changes done for 'style sheet ' and 'Time required to complete the activity' in the default preferences are not reflected for the new activity", "PASSED"); throw new Exception("Changes done for 'style sheet ' and 'Time required to complete the activity' in the default preferences are not reflected for the new activity"); } if (_randomAssessmentPage.GetValueOfThresholdScore() == "60") { GenericHelper.Logs("Changes done for 'Threshold Score' in the default preferences are reflected for the new activity", "PASSED"); } else { GenericHelper.Logs("Changes done for 'ThresholdScore' in the default preferences are not reflected for the new activity", "PASSED"); throw new Exception("Changes done for 'ThresholdScore' and in the default preferences are not reflected for the new activity"); } } catch (Exception e) { GenericHelper.Logs(e.ToString(), "FAILED"); Assert.Fail(e.ToString()); } }
public void StudyPlanCreation(string studyPlanName) { SelectAddStudyPlan(); GenericHelper.WaitUtilWindow("Create Study Plan"); _drtDefaultUxPage.EnterSSPName(studyPlanName); //pretest _drtDefaultUxPage.ClickCreateTestForPretest(); GenericHelper.WaitUtilWindow("Create Pre-test:"); _addAssessmentPage.EnterActivityName("PreTest"); _addAssessmentPage.ClickSaveAndContinue(); _randomAssessmentPage.ClickAddQuestions(); _randomAssessmentPage.ClickCreateNewQuestion(); GenericHelper.WaitUtilWindow("Create New Question"); GenericHelper.SelectWindow("Create New Question"); _selectQuestionTypePage.SelectTrueFalse(); _selectQuestionTypePage.CreateTrueFalseQuestion(); _randomAssessmentPage.ClickSaveAndReturn(); if (_drtDefaultUxPage.VerifySuccesfullMessage("Pre Test created successfully.")) { GenericHelper.Logs("SuccessFull message displayed for creation of PreTest", "PASSED"); } else { GenericHelper.Logs("SuccessFull message not displayed for creation of PreTest", "FAILED"); throw new Exception("SuccessFull message not displayed for creation of PreTest"); } //posttest _drtDefaultUxPage.ClickCreateTestForPretest(); GenericHelper.WaitUtilWindow("Create Post-test"); _addAssessmentPage.EnterActivityName("PostTest"); _addAssessmentPage.ClickSaveAndContinue(); _randomTopicListPage.ClickAddQuestions(); _randomTopicListPage.ClickCreateNewQuestion(); GenericHelper.WaitUtilWindow("Create New Question"); GenericHelper.SelectWindow("Create New Question"); _selectQuestionTypePage.SelectTrueFalseForPostTest(); _trueFalsePage.CreateTrueFalseQuestionForPostTest(); _randomAssessmentPage.ClickSaveAndReturn(); if (_drtDefaultUxPage.VerifySuccesfullMessage("Post Test created successfully.")) { GenericHelper.Logs("SuccessFull message displayed for creation of PostTest", "PASSED"); } else { GenericHelper.Logs("SuccessFull message not displayed for creation of PostTest", "FAILED"); throw new Exception("SuccessFull message not displayed for creation of PostTest"); } GenericHelper.SelectDefaultWindow(); _drtDefaultUxPage.SaveSSP(); GenericHelper.WaitUtilWindow("Course Materials"); if (GenericHelper.VerifySuccesfullMessage("Study Plan added successfully.")) { GenericHelper.Logs("SuccessFull message displayed for creation of Study Plan", "PASSED"); DatabaseTools.UpdateActivity(Enumerations.ActivityType.StudyPlan, studyPlanName); } else { GenericHelper.Logs("SuccessFull message not displayed for creation of Study Plan", "FAILED"); throw new Exception("SuccessFull message not displayed for creation of Study Plan"); } }