Exemplo n.º 1
0
 public void LoginUser(string username, string password)
 {
     Username.Enter(username);
     Password.Enter(password);
     KeepMeLoggedIn.Check();
     LogInButton.Click(WaitForDisappear);
 }
Exemplo n.º 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);
        }
        void ReleaseDesignerOutlets()
        {
            if (ActivityIndicator != null)
            {
                ActivityIndicator.Dispose();
                ActivityIndicator = null;
            }

            if (LogInButton != null)
            {
                LogInButton.Dispose();
                LogInButton = null;
            }

            if (LoginField != null)
            {
                LoginField.Dispose();
                LoginField = null;
            }

            if (PasswordField != null)
            {
                PasswordField.Dispose();
                PasswordField = null;
            }

            if (RegistrationButton != null)
            {
                RegistrationButton.Dispose();
                RegistrationButton = null;
            }
        }
 private void EnterKeyDown(object sender, KeyEventArgs e)
 {
     if (e.Key == Key.Enter && LogInButton.IsEnabled)
     {
         LogInButton.RaiseEvent(new RoutedEventArgs(Button.ClickEvent));
     }
 }
Exemplo n.º 5
0
        void ReleaseDesignerOutlets()
        {
            if (BackButton != null)
            {
                BackButton.Dispose();
                BackButton = null;
            }

            if (ForgotYourPasswordButton != null)
            {
                ForgotYourPasswordButton.Dispose();
                ForgotYourPasswordButton = null;
            }

            if (LogInButton != null)
            {
                LogInButton.Dispose();
                LogInButton = null;
            }

            if (PasswordLabel != null)
            {
                PasswordLabel.Dispose();
                PasswordLabel = null;
            }

            if (UserNameLabel != null)
            {
                UserNameLabel.Dispose();
                UserNameLabel = null;
            }
        }
        void ReleaseDesignerOutlets()
        {
            if (UsernameLabel != null)
            {
                UsernameLabel.Dispose();
                UsernameLabel = null;
            }

            if (PasswordLabel != null)
            {
                PasswordLabel.Dispose();
                PasswordLabel = null;
            }

            if (LogInButton != null)
            {
                LogInButton.Dispose();
                LogInButton = null;
            }

            if (SignUpButton != null)
            {
                SignUpButton.Dispose();
                SignUpButton = null;
            }
        }
Exemplo n.º 7
0
 private void LogOutButton_Click(object sender, EventArgs e)
 {
     ResetDataBinding();
     LogInButton.Image = ImageCollection["LoginActive"];
     LogInButton.Invalidate();
     context = null;
     RestoreButton.Visible = true;
 }
Exemplo n.º 8
0
        public LogInPage LogIn(string username, string password)
        {
            FillUsername(username);
            FillPassword(password);
            LogInButton.Click();

            return(this);
        }
Exemplo n.º 9
0
        public LogInVeryfyingPage LogIn(string username, string password)
        {
            FillUsername(username);
            FillPassword(password);
            LogInButton.Click();

            return(new LogInVeryfyingPage  {
                Driver = Driver
            });;
        }
Exemplo n.º 10
0
        public void InvalidLogIn()
        {
            Browser.WaitForElements(new List <IWebElement>()
            {
                UserName, UserPassword, LogInButton
            });
            UserName.SendKeys(Browser.getUser());
            UserPassword.SendKeys(PasswordGenerator.GetRandomPassword());

            LogInButton.Click();
        }
Exemplo n.º 11
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();
        }
        void ReleaseDesignerOutlets()
        {
            if (LogInButton != null)
            {
                LogInButton.Dispose();
                LogInButton = null;
            }

            if (TextLabel != null)
            {
                TextLabel.Dispose();
                TextLabel = null;
            }
        }
Exemplo n.º 13
0
        void ReleaseDesignerOutlets()
        {
            if (EmailTextField != null)
            {
                EmailTextField.Dispose();
                EmailTextField = null;
            }

            if (ErrorTextLabel != null)
            {
                ErrorTextLabel.Dispose();
                ErrorTextLabel = null;
            }

            if (LogInButton != null)
            {
                LogInButton.Dispose();
                LogInButton = null;
            }

            if (LoginViaFacebookButton != null)
            {
                LoginViaFacebookButton.Dispose();
                LoginViaFacebookButton = null;
            }

            if (PasswordTextField != null)
            {
                PasswordTextField.Dispose();
                PasswordTextField = null;
            }

            if (SignUpButton != null)
            {
                SignUpButton.Dispose();
                SignUpButton = null;
            }
        }
Exemplo n.º 14
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);
            }
        }
Exemplo n.º 15
0
        void ReleaseDesignerOutlets()
        {
            if (BlurVisualEffect != null)
            {
                BlurVisualEffect.Dispose();
                BlurVisualEffect = null;
            }

            if (HummigbirdButton != null)
            {
                HummigbirdButton.Dispose();
                HummigbirdButton = null;
            }

            if (LoginBackgroundView != null)
            {
                LoginBackgroundView.Dispose();
                LoginBackgroundView = null;
            }

            if (LogInButton != null)
            {
                LogInButton.Dispose();
                LogInButton = null;
            }

            if (LogOutButton != null)
            {
                LogOutButton.Dispose();
                LogOutButton = null;
            }

            if (MyAnimeListButton != null)
            {
                MyAnimeListButton.Dispose();
                MyAnimeListButton = null;
            }

            if (PasswordTextField != null)
            {
                PasswordTextField.Dispose();
                PasswordTextField = null;
            }

            if (ProblemsButton != null)
            {
                ProblemsButton.Dispose();
                ProblemsButton = null;
            }

            if (RegisterButton != null)
            {
                RegisterButton.Dispose();
                RegisterButton = null;
            }

            if (UsernameTextField != null)
            {
                UsernameTextField.Dispose();
                UsernameTextField = null;
            }
        }
Exemplo n.º 16
0
 public void ClickOnLogInButton()
 {
     LogInButton.Click();
 }
Exemplo n.º 17
0
 public void ClickLoginButton()
 {
     LogInButton.Click();
 }