Beispiel #1
0
        public void CourseView()
        {
            try
            {
                _test = _extent.StartTest("Test Case #01: Course View by learner");
                Pages.CourseConsumption.MyCourses         mc = new Pages.CourseConsumption.MyCourses(driver);
                Pages.CourseConsumption.CourseMainContent objCourseMainContent = new Pages.CourseConsumption.CourseMainContent(driver);

                System.Threading.Thread.Sleep(2000);
                mc.CourseFilter().SendKeys("Course22");
                mc.ResumeCourse().Click();

                System.Threading.Thread.Sleep(2000);
                int totalMod = objCourseMainContent.TotalModules();
                for (int i = 2; i <= totalMod; i++)
                {
                    int totalDoc = objCourseMainContent.TotalDocsInModule(i.ToString());
                    System.Threading.Thread.Sleep(2000);
                    objCourseMainContent.ModuleExpand(i.ToString()).Click();
                    for (int j = 2; j <= totalDoc; i++)
                    {
                        System.Threading.Thread.Sleep(2000);
                        objCourseMainContent.ModuleDoc(i.ToString(), j.ToString()).Click();
                    }
                }

                _test.Log(LogStatus.Pass, "Assert Pass as condition is true");
                _extent.EndTest(_test);
            }
            catch (Exception e)
            {
                screenShotObj.GetScreenshot(driver, "createSurvey");
                _test.Log(LogStatus.Fail, "Assert Fail as condition is false");
                _extent.EndTest(_test);
            }

            _extent.Flush();
            _extent.Close();
        }
Beispiel #2
0
        public void SubscribeCourse()
        {
            try
            {
                _test = _extent.StartTest("Test Case #01: subscribing course from Explore course");
                Pages.CourseConsumption.ExploreCourses    ec = new Pages.CourseConsumption.ExploreCourses(driver);
                Pages.CourseConsumption.CourseInformation ci = new Pages.CourseConsumption.CourseInformation(driver);

                ec.SubscribeGivenCourse("Course22").Click();
                ec.SweetSuccessOkButton().Click();

                _test.Log(LogStatus.Pass, "Assert Pass as condition is true");
                _extent.EndTest(_test);

                _test = _extent.StartTest("Test Case #02: Viewing subscribed Course");
                Pages.CourseConsumption.MyCourses mc = new Pages.CourseConsumption.MyCourses(driver);

                System.Threading.Thread.Sleep(2000);
                mc.CourseFilter().SendKeys("Course22");
                mc.ResumeCourse().Click();

                System.Threading.Thread.Sleep(2000);
                ci.TakeCourse().Click();

                _test.Log(LogStatus.Pass, "Assert Pass as condition is true");
                _extent.EndTest(_test);
            }
            catch (Exception e)
            {
                screenShotObj.GetScreenshot(driver, "createSurvey");
                _test.Log(LogStatus.Fail, "Assert Fail as condition is false");
                _extent.EndTest(_test);
            }

            _extent.Flush();
            _extent.Close();
        }