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(); } } } }
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(); } } } }
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()); } }
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>(); } }
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(); } }
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>(); } }
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); }
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); }