public static void TestFillForm() { IWebDriver wd = new ChromeDriver(Constants.WEBDRIVER_PATH); wd.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(3); wd.Manage().Window.Maximize(); Debug.WriteLine("Drive Initialized!"); //wd.Navigate().GoToUrl(HuamnityLogin.URL1); try { HumanityHome.NavigateTo(wd); Thread.Sleep(3000); HumanityHome.ClickCookies(wd); HumanityHome.ClickLogIn(wd); Thread.Sleep(3000); FillForm(wd, "*****@*****.**", "Mikica345"); HuamnityLogin.ClickButtonLogIn(wd); if (wd.Url.Contains(HuamnityLogin.URL1)) { Console.WriteLine("Login Pass"); MessageBox.Show("Successfully login"); } else { Console.WriteLine("Login Fail"); MessageBox.Show("Login Fail"); } } catch (Exception izuzetak) { Console.WriteLine(izuzetak.ToString()); } }
public static void TestSignOut() { try { IWebDriver wd = new ChromeDriver(Constants.WEBDRIVER_PATH); wd.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(3); wd.Manage().Window.Maximize(); Debug.WriteLine("Drive Initialized!"); HumanityHome.NavigateTo(wd); HumanityHome.ClickCookies(wd); HumanityHome.ClickLogIn(wd); TestLogin.FillForm(wd, "*****@*****.**", "Mikica345"); HuamnityLogin.ClickButtonLogIn(wd); HumanityProfile.ClickProfileMenu(wd); Thread.Sleep(3000); HumanityProfile.ClickSignOut(wd); Thread.Sleep(3000); if (wd.Url.Contains("https://chemschool.humanity.com/app/")) { MessageBox.Show("Successfully logout"); } else { MessageBox.Show("Login Fail"); } } catch (Exception izuzetak) { Console.WriteLine(izuzetak.ToString()); } }
public static void TeostGoToLogin() { IWebDriver wd = new ChromeDriver(Constants.WEBDRIVER_PATH); wd.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(3); wd.Manage().Window.Maximize(); Debug.WriteLine("Drive Initialized!"); HumanityHome.NavigateTo(wd); Thread.Sleep(3000); HumanityHome.ClickCookies(wd); HumanityHome.ClickLogIn(wd); Thread.Sleep(3000); }
public static void LogInTest() { IWebDriver wd = new ChromeDriver(Constants.WEBDRIVER_PATH); wd.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(3); wd.Manage().Window.Maximize(); Debug.WriteLine("Driver initialized!!"); ExcelUtility.OpenFile(Constants.LOGIN_EXCEL_PATH); ExcelUtility.LoadWorkSheet(0); for (int i = 1; i < ExcelUtility.GetRowCount(); i++) { string email = ExcelUtility.GetDataAt(i, 0); string pass = ExcelUtility.GetDataAt(i, 1); HumanityHome.NavigateTo(wd); System.Threading.Thread.Sleep(3000); HumanityHome.ClickLogin(wd); System.Threading.Thread.Sleep(3000); HumanityLogIn.SendEmail(wd, email); HumanityLogIn.SendPass(wd, pass); HumanityLogIn.ClickLogin(wd); System.Threading.Thread.Sleep(3000); if (wd.Url.Contains(HumanityMenu.URL)) { Console.WriteLine("PASS, Register loaded successfully!"); ExcelUtility.SetData(i, "PASS"); } else { Console.WriteLine("FAIL, Page failed loading!"); ExcelUtility.SetData(i, "FAIL"); } wd.Manage().Cookies.DeleteAllCookies(); //delete all cookies } ExcelUtility.CloseFile(); wd.Quit(); }
public static void TestUploadPicture() { IWebDriver wd = new ChromeDriver(Constants.WEBDRIVER_PATH); wd.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(3); wd.Manage().Window.Maximize(); Debug.WriteLine("Drive Initialized!"); Thread.Sleep(3000); HumanityHome.NavigateTo(wd); HumanityHome.ClickCookies(wd); HumanityHome.ClickLogIn(wd); TestLogin.FillForm(wd, "*****@*****.**", "Mikica345"); HuamnityLogin.ClickButtonLogIn(wd); HumanityProfile.ClickProfileMenu(wd); HumanityProfile.ClickProfile(wd); HumanityEditStaff.ClickEditDetails(wd); HumanityEditStaff.ClickUploadPicture(wd); Thread.Sleep(5000); HumanityEditStaff.SendNickname(wd, "Maki"); HumanityEditStaff.ClickSaveButton(wd); }