コード例 #1
0
ファイル: TestToc.cs プロジェクト: andgein/uLearn
		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();
					}
				}
			}
		}
コード例 #2
0
ファイル: TestToc.cs プロジェクト: crassirostris/Ulearn
        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();
                    }
                }
            }
        }
コード例 #3
0
ファイル: StartPageShould.cs プロジェクト: andgein/uLearn
		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);
			}
		}
コード例 #4
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);
            }
        }
コード例 #5
0
ファイル: StartPageShould.cs プロジェクト: andgein/uLearn
		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);
			}
		}
コード例 #6
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);
            }
        }