Ejemplo n.º 1
0
		public void TestUnits()
		{
			using (var driver = new ChromeDriver())
			{
				driver.Navigate().GoToUrl(ULearnUrls.StartPage);
				UlearnDriver ulearnDriver = new UlearnDriver(driver);
				var regPage = ulearnDriver.GoToRegistrationPage();
				var random = new Random();
				var login = random.Next().ToString();
				var password = random.Next().ToString();
				regPage.SignUp(login, password);
				var startPage = ulearnDriver.GoToStartPage();
				startPage.GoToCourse(Titles.BasicProgrammingTitle);
				var toc = ulearnDriver.GetToc();
				var unitsNames = toc.GetUnitsName();

				foreach (var unitName in unitsNames)
				{
					if (!ulearnDriver.GetToc().GetUnitControl(unitName).Collapse)
						ulearnDriver.GetToc().GetUnitControl(unitName).Click();
					var slidesNames = ulearnDriver.GetToc().GetUnitControl(unitName).GetSlidesName();
					foreach (var slideName in slidesNames)
					{
						ulearnDriver.GetToc().GetUnitControl(unitName).GetSlides().First(x => x.Name == slideName).Click();
					}
				}
			}
		}
Ejemplo n.º 2
0
        public void TestUnits()
        {
            using (var driver = new ChromeDriver())
            {
                driver.Navigate().GoToUrl(ULearnUrls.StartPage);
                UlearnDriver ulearnDriver = new UlearnDriver(driver);
                var          regPage      = ulearnDriver.GoToRegistrationPage();
                var          random       = new Random();
                var          login        = random.Next().ToString();
                var          password     = random.Next().ToString();
                regPage.SignUp(login, password);
                var startPage = ulearnDriver.GoToStartPage();
                startPage.GoToCourse(Titles.BasicProgrammingTitle);
                var toc        = ulearnDriver.GetToc();
                var unitsNames = toc.GetUnitsName();

                foreach (var unitName in unitsNames)
                {
                    if (!ulearnDriver.GetToc().GetUnitControl(unitName).Collapse)
                    {
                        ulearnDriver.GetToc().GetUnitControl(unitName).Click();
                    }
                    var slidesNames = ulearnDriver.GetToc().GetUnitControl(unitName).GetSlidesName();
                    foreach (var slideName in slidesNames)
                    {
                        ulearnDriver.GetToc().GetUnitControl(unitName).GetSlides().First(x => x.Name == slideName).Click();
                    }
                }
            }
        }
Ejemplo n.º 3
0
 private static IEnumerable <string> FindTexErrors(string courseId)
 {
     using (var driver = new UlearnDriver())
     {
         driver.GoToRegistrationPage().SignUpAsRandomUser();
         return((
                    from page in driver.EnumeratePages(courseId)
                    from tex in driver.TeX
                    where !tex.IsRendered
                    select page.GetSlideName() + " TeX is not rendered! " + tex.GetContent()
                    ).ToList());
     }
 }
Ejemplo n.º 4
0
 public void CheckAnswers()
 {
     using (var driver = new ChromeDriver())
     {
         driver.Navigate().GoToUrl(ULearnUrls.StartPage);
         UlearnDriver ulearnDriver = new UlearnDriver(driver);
         ulearnDriver.GoToRegistrationPage();
         var registrationPage = ulearnDriver.Get <RegistrationPage>();
         ulearnDriver.LoginAdminAndGoToCourse(Titles.BasicProgrammingTitle);
         //var first
         var page = ulearnDriver.Get <SlidePage>();
     }
 }
Ejemplo n.º 5
0
		private static IEnumerable<string> FindTexErrors(string courseId)
		{
			using (var driver = new UlearnDriver())
			{
				driver.GoToRegistrationPage().SignUpAsRandomUser();
				return (
					from page in driver.EnumeratePages(courseId)
					from tex in driver.TeX
					where !tex.IsRendered
					select page.GetSlideName() + " TeX is not rendered! " + tex.GetContent()
					).ToList();
			}
		}
Ejemplo n.º 6
0
		public void CheckAnswers()
		{
			using (var driver = new ChromeDriver())
			{
				driver.Navigate().GoToUrl(ULearnUrls.StartPage);
				UlearnDriver ulearnDriver = new UlearnDriver(driver);
				ulearnDriver.GoToRegistrationPage();
				var registrationPage = ulearnDriver.Get<RegistrationPage>();
				ulearnDriver.LoginAdminAndGoToCourse(Titles.BasicProgrammingTitle);
				//var first
				var page = ulearnDriver.Get<SlidePage>();
			}
		}
Ejemplo n.º 7
0
		public void EnumeratePages()
		{
			var exceptions = new List<Exception>();
			var screenshotsPath = new List<string>();
			var r = new Random();
			var login = r.Next().ToString();
			var password = r.Next().ToString();
			using (var driver = new ChromeDriver())
			{
				driver.Navigate().GoToUrl(ULearnUrls.StartPage);
				var uDriver = new UlearnDriver(driver);
				var regPage = uDriver.GoToRegistrationPage();
				regPage.SignUp(login, password);

				var pages = uDriver.EnumeratePages("ForTests", login, password);
				TestAllSlides(pages, uDriver, exceptions, screenshotsPath, driver);
			}
			Verdict(exceptions, screenshotsPath);
		}
Ejemplo n.º 8
0
        public void EnumeratePages()
        {
            var exceptions      = new List <Exception>();
            var screenshotsPath = new List <string>();
            var r        = new Random();
            var login    = r.Next().ToString();
            var password = r.Next().ToString();

            using (var driver = new ChromeDriver())
            {
                driver.Navigate().GoToUrl(ULearnUrls.StartPage);
                var uDriver = new UlearnDriver(driver);
                var regPage = uDriver.GoToRegistrationPage();
                regPage.SignUp(login, password);

                var pages = uDriver.EnumeratePages("ForTests", login, password);
                TestAllSlides(pages, uDriver, exceptions, screenshotsPath, driver);
            }
            Verdict(exceptions, screenshotsPath);
        }