Exemple #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();
					}
				}
			}
		}
Exemple #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();
                    }
                }
            }
        }
Exemple #3
0
		public void NotBeLoggedIn()
		{
			using (var driver = new ChromeDriver())
			{
				driver.Navigate().GoToUrl(ULearnUrls.StartPage);
				UlearnDriver ulearnDriver = new UlearnDriver(driver);
				var startPage = ulearnDriver.Get<StartPage>();

				startPage.GoToSignInPage();

				ulearnDriver.GoToStartPage();
				var isLogin = ulearnDriver.LoggedIn;
				Assert.IsFalse(isLogin);
			}
		}
        public void NotBeLoggedIn()
        {
            using (var driver = new ChromeDriver())
            {
                driver.Navigate().GoToUrl(ULearnUrls.StartPage);
                UlearnDriver ulearnDriver = new UlearnDriver(driver);
                var          startPage    = ulearnDriver.Get <StartPage>();

                startPage.GoToSignInPage();

                ulearnDriver.GoToStartPage();
                var isLogin = ulearnDriver.LoggedIn;
                Assert.IsFalse(isLogin);
            }
        }
Exemple #5
0
		public void GoToSignInPage()
		{
			using (IWebDriver driver = new ChromeDriver())
			{
				driver.Navigate().GoToUrl(ULearnUrls.StartPage);
				UlearnDriver ulearnDriver = new UlearnDriver(driver);
				var startPage = ulearnDriver.Get<StartPage>();

				startPage.GoToSignInPage();
				Assert.AreEqual(PageType.SignInPage, ulearnDriver.GetCurrentPageType());

				ulearnDriver.GoToStartPage();
				var isLogin = ulearnDriver.LoggedIn;
				Assert.IsFalse(isLogin);
			}
		}
        public void GoToSignInPage()
        {
            using (IWebDriver driver = new ChromeDriver())
            {
                driver.Navigate().GoToUrl(ULearnUrls.StartPage);
                UlearnDriver ulearnDriver = new UlearnDriver(driver);
                var          startPage    = ulearnDriver.Get <StartPage>();

                startPage.GoToSignInPage();
                Assert.AreEqual(PageType.SignInPage, ulearnDriver.GetCurrentPageType());

                ulearnDriver.GoToStartPage();
                var isLogin = ulearnDriver.LoggedIn;
                Assert.IsFalse(isLogin);
            }
        }