示例#1
0
 public void LoginUser(string username, string password)
 {
     Username.Enter(username);
     Password.Enter(password);
     KeepMeLoggedIn.Check();
     LogInButton.Click(WaitForDisappear);
 }
示例#2
0
        //The main method that runs the selenium
        public int Run(User user)
        {
            int runPassed = 1;
            int likeCount;

            try
            {
                MaximiseWindow();
                NavigateToWebsite();

                SetLoginScreenElements();

                EnterCredentials();
                LogInButton.Click();

                for (int tagCount = 0; tagCount < Hashtag.Count(); tagCount++)
                {
                    likeCount = 0;

                    Thread.Sleep(10000);
                    SetHomeScreenElements();
                    EnterHashtag();
                    SetSearchTermLink();
                    ClickSearchTermLink();

                    SetHashtagImageLink();
                    ClickHashtagImageLink();

                    for (int i = 0; i < NumOfLikes; i++)
                    {
                        SetHeartButton();
                        SetNextImageButton();

                        ClickHeartButton();
                        ClickNextImageButton();
                        Thread.Sleep(3000);

                        likeCount++;

                        if (i == NumOfLikes - 1)
                        {
                            SetXButton();
                            ClickXButton();
                        }
                    }
                    user.UpdateHashtagLikes(tagCount, likeCount);

                    UpdateHashtagCounter();
                }
            }
            catch (Exception)
            {
                runPassed = 0;
            }

            Thread.Sleep(5000);
            QuitDriver();

            return(runPassed);
        }
        public LogInPage LogIn(string username, string password)
        {
            FillUsername(username);
            FillPassword(password);
            LogInButton.Click();

            return(this);
        }
示例#4
0
        public LogInVeryfyingPage LogIn(string username, string password)
        {
            FillUsername(username);
            FillPassword(password);
            LogInButton.Click();

            return(new LogInVeryfyingPage  {
                Driver = Driver
            });;
        }
示例#5
0
        public void InvalidLogIn()
        {
            Browser.WaitForElements(new List <IWebElement>()
            {
                UserName, UserPassword, LogInButton
            });
            UserName.SendKeys(Browser.getUser());
            UserPassword.SendKeys(PasswordGenerator.GetRandomPassword());

            LogInButton.Click();
        }
示例#6
0
        public void LogIn()
        {
            Browser.WaitForElements(new List <IWebElement>()
            {
                UserName, UserPassword, LogInButton
            });
            UserName.Clear();
            UserPassword.Clear();
            UserName.SendKeys(Browser.getUser());
            UserPassword.SendKeys(Browser.getPassword());

            LogInButton.Click();
        }
示例#7
0
        /// <summary>
        /// Perform the login action itself
        /// </summary>
        public void Login()
        {
            try
            {
                GenericUtilities.Wait(5);
                if (UserName.Text.Equals(userName) == false)
                {
                    if (UserName.Text != "")
                    {
                        UserName.Clear();
                    }
                    UserName.SendKeys(userName);
                }
                if (Password.Text != "")
                {
                    Password.Clear();
                }
                Password.SendKeys(password);

                //try
                //{
                //    AppiumDriver.Instance.HideKeyboard();
                //}
                //catch
                //{ }


                GenericUtilities.Wait(3);
                //UserName.Click(); //There is an issue with Password field when cursor is in it, unable to click SignIn button, do not remove this.
                LogInButton.Click();
                //LogResults.LogPass("Signed In successfully");
            }
            catch (Exception ex)
            {
                //LogResults.LogFail("Failed to Login" + ex.InnerException.Message);
            }
        }
示例#8
0
 public void ClickLoginButton()
 {
     LogInButton.Click();
 }
示例#9
0
 public void ClickOnLogInButton()
 {
     LogInButton.Click();
 }