public void EditHomeworkMark(Homework homework, string newMark)
 {
     HomeworkPage.Instance.Navigate();
     HomeworkPage.Instance.FillFormWithValueInRange(homework, newMark);
     HomeworkPage.Instance.UpdateButton.ScrollToVisible();
     HomeworkPage.Instance.UpdateButton.MouseClick(MouseClickType.LeftClick, 0, 0, ArtOfTest.Common.OffsetReference.AbsoluteCenter);
 }
 public void AddHomeworkWithCorrectData()
 {
     var homework = new Homework("ДСА2016", "Рекурсия", "GiantTestUser", "4", true);
     var homeworkFileName = "TestHomeworkForUpload.xlsx";
     this.homeworkFacade.CreateHomework(homework, homeworkFileName);
     HomeworkPageAsserter.AssertHomeworkExist(HomeworkPage.Instance, homework);
 }
 public void FilterByCourseLectureUserAndEvaluation()
 {
     var homework = new Homework("ДСА2016", "Рекурсия", "GiantTestUser", "4", true);
     var homeworkFileName = "TestHomeworkForUpload.xlsx";
     this.homeworkFacade.CreateHomework(homework, homeworkFileName);
     this.homeworkFacade.FilterHomeworkGridByCourseLectureUserAndEvaluation(homework);
     HomeworkPageAsserter.AssertHomeworkExist(HomeworkPage.Instance, homework);
 }
        public void CreateHomework(Homework homework, string fileName)
        {
            HomeworkPage.Instance.Navigate();
            if (HomeworkPage.Instance.ContainsHomework(homework))
            {
                HomeworkPage.Instance.DeleteHomework(homework);
            }

            AddHomeworkPage.Instance.Navigate();
            AddHomeworkPage.Instance.FillForm(homework, fileName);
        }
Exemple #5
0
        public void EditHomeworkMarkInGrid()
        {
            var homework = new Homework("ДСА2016", "Рекурсия", "GiantTestUser", "4", true);
            string homeworkFileName = "TestHomeworkForUpload.xlsx";
            string newMark = "5";
            this.homeworkFacade.CreateHomework(homework, homeworkFileName);
            HomeworkPageAsserter.AssertHomeworkExist(HomeworkPage.Instance, homework);
            this.homeworkFacade.EditHomeworkMark(homework, newMark);
            HomeworkPageAsserter.AssertPopupIsClosed(HomeworkPage.Instance);

            homework.Mark = newMark;
            HomeworkPageAsserter.AssertHomeworkExist(HomeworkPage.Instance, homework);
        }
        public void AddHomeworkWithOurOfRangeCorseName()
        {
            var homework = new Homework(
                "ThisCourseNameIsOverOneHundredCharactersAndShouldBeTooLongToBeAValidCourseNameAndShouldBeNotAcceptedByTelerikAcademySystem",
                string.Empty,
                "GiantTestUser",
                "4",
                true);

            var homeworkFileName = "TestHomeworkForUpload.xlsx";
            this.homeworkFacade.CreateHomework(homework, homeworkFileName);
            AddHomeworkPageAsserter.CourseValidationMessageIsVisible(AddHomeworkPage.Instance, AddHomeworkConstants.CourseNameErrorMessageTooLong);
        }
 public void FilterHomeworkGridByCourseLectureUserAndEvaluation(Homework homework)
 {
     HomeworkPage.Instance.Navigate();
     HomeworkPage.Instance.SelectCourse(homework.CourseName);
     HomeworkPage.Instance.SelectLecture(homework.LectureName);
     HomeworkPage.Instance.SelectUserName(homework.UserName);
     HomeworkPage.Instance.SelectForEvaluation(homework.ForEvaluation);
 }
 public void DownloadUserHomework(Homework homework, string fileName)
 {
     HomeworkPage.Instance.Navigate();
     HomeworkPage.Instance.DownloadHomework(homework, fileName);
 }
 public static void AssertHomeworkExist(this HomeworkPage page, Homework homework)
 {
     bool isAdded = page.ContainsHomework(homework);
     Assert.IsTrue(isAdded, "Homework is not added");
 }