public static void EditEmployee()
        {
            #region ReachingEmployee
            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);

            HumanityMenu.ClickStaff(wd);
            wd.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(5);
            #endregion

            #region EditingEmployee
            HumanityStaff.ClickEmployee1(wd);
            //Was reaching Employee page successful?
            #region Pass/Fail
            if (wd.Url.Contains(HumanityStaff.Employee1_URL))
            {
                Console.WriteLine("Pass");
            }
            else
            {
                Console.WriteLine("Fail");
            }
            #endregion
            wd.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(5);
            HumanityEditStaff.ClickEditDetails(wd);
            //Was reaching Edit Employee page successful?
            #region Pass/Fail
            if (wd.Url.Contains(HumanityEditStaff.Edit_Staff_URL))
            {
                Console.WriteLine("Pass");
            }
            else
            {
                Console.WriteLine("Fail");
            }
            #endregion
            wd.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(5);
            HumanityEditStaff.SendNickName(wd, "Safi");
            wd.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(5);
            Thread.Sleep(3000);
            HumanityEditStaff.SendUploadPicture(wd);
            wd.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(5);
            Thread.Sleep(3000);
            HumanityEditStaff.ClickSaveEmployee(wd);
            wd.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(5);
            Thread.Sleep(3000);
            wd.Quit();
            #endregion
        }
Exemple #2
0
        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();
        }