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 UploadImageTests() { IWebDriver wd = new ChromeDriver(Constants.ChromeDriver); wd.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(9); wd.Manage().Window.Maximize(); Debug.WriteLine("Driver inicijalizovan HA!"); HumanityLogin.Login(wd, Constants.UserName, Constants.Password); System.Threading.Thread.Sleep(6000); Console.WriteLine("Verzija je {0}", HumanityProfile.GetVersion(wd)); System.Threading.Thread.Sleep(3000); wd.Navigate().GoToUrl("https://zemicka.humanity.com/app/staff/detail/5353116/"); System.Threading.Thread.Sleep(3000); HumanityEditStaff.ClickEditDetails(wd); HumanityEditStaff.SendUploadPicture(wd, Constants.ProfilePicture); HumanityEditStaff.ClickSaveEmployee(wd); wd.Quit(); }
public static void SigningOut() { #region ReachingSignOut IWebDriver wd = new ChromeDriver(Constants.Chrome_Driver_Path); wd.Manage().Window.Maximize(); Debug.WriteLine("Driver initialized."); wd.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(3); wd.Navigate().GoToUrl(HumanityLoginPage.Humanity_Login_URL); HumanityLoginTests.FillOutLogin(wd, "*****@*****.**", "pandanagrani"); HumanityLoginPage.ClickLoginButton(wd); wd.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(5); #endregion #region SigningOut try { HumanityProfile.ClickProfileMenu(wd); wd.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(5); HumanityProfile.ClickSignOut(wd); wd.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(5); //Was signing out successful? #region Pass/Fail if (wd.Url.Contains(HumanityHome.Humanity_Signed_Out_URL)) { Console.WriteLine("Pass"); } else { Console.WriteLine("Fail"); } #endregion Thread.Sleep(3000); wd.Quit(); } catch (Exception e) { Console.WriteLine(e.StackTrace); } #endregion }
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); }