示例#1
0
        void ReleaseDesignerOutlets()
        {
            if (AddButton != null)
            {
                AddButton.Dispose();
                AddButton = null;
            }

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

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

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

            if (ValidationLabel != null)
            {
                ValidationLabel.Dispose();
                ValidationLabel = null;
            }
        }
 public MainPage FillFormFieldsWithCorrectData(string userName, string password)
 {
     UserNameField.SendKeys(userName);
     PasswordField.SendKeys(password);
     BtnLogin.Submit();
     return(new MainPage());
 }
示例#3
0
 private void ClearForm()
 {
     UserNameField.Clear();
     PasswordField.Clear();
     RetypePasswordField.Clear();
     EmailField.Clear();
 }
示例#4
0
 public void LogInUser(string username, string password)
 {
     UserNameField.SendKeys(username);
     PasswordField.SendKeys(password);
     RememberMeCheckBox.Click();
     LogIn.Submit();
 }
        public override void ViewDidLayoutSubviews( )
        {
            base.ViewDidLayoutSubviews( );

            HeaderLabel.Frame = new CGRect(0, View.Frame.Height * .05f, View.Frame.Width, HeaderLabel.Bounds.Height);

            Version.Layer.Position = new CGPoint((View.Bounds.Width - Version.Bounds.Width) / 2, HeaderLabel.Frame.Bottom);

            // measure and size the username field
            UserNameField.Bounds = new CGRect(0, 0, View.Bounds.Width * .40f, 0);
            CGSize size = UserNameField.SizeThatFits(UserNameField.Bounds.Size);

            UserNameField.Bounds = new CGRect(UserNameField.Bounds.X, UserNameField.Bounds.Y, UserNameField.Bounds.Width, (float)System.Math.Ceiling(size.Height * 1.25f));

            UserNameField.Layer.Position = new CGPoint((View.Bounds.Width - UserNameField.Bounds.Width) / 2, HeaderLabel.Frame.Bottom + 50);


            PasswordField.Bounds = new CGRect(0, 0, View.Bounds.Width * .40f, 0);
            size = PasswordField.SizeThatFits(PasswordField.Bounds.Size);
            PasswordField.Bounds = new CGRect(PasswordField.Bounds.X, PasswordField.Bounds.Y, PasswordField.Bounds.Width, (float)System.Math.Ceiling(size.Height * 1.25f));

            PasswordField.Layer.Position = new CGPoint((View.Bounds.Width - PasswordField.Bounds.Width) / 2, UserNameField.Frame.Bottom + 10);


            LoginButton.Bounds         = new CGRect(0, 0, 100, LoginButton.Bounds.Height);
            LoginButton.Layer.Position = new CGPoint((View.Bounds.Width - LoginButton.Bounds.Width) / 2, PasswordField.Frame.Bottom + 30);

            LoginResult.Frame = new CGRect(0, LoginButton.Frame.Bottom + 20, View.Frame.Width, LoginResult.Bounds.Height);

            float width  = 100;
            float height = 100;

            BusyIndicator.Frame = new RectangleF(((float)View.Bounds.Width - width) / 2, (float)LoginButton.Frame.Bottom + 100, width, height);
        }
示例#6
0
 public void Login()
 {
     UserNameField.Set("username");
     UserNameField.Clear();
     UserNameField.GetText();
     PassWordField.Set("password");
     SubmitButton.Click();
 }
示例#7
0
 public void Login(string un, string pw)
 {
     UserNameField.Set(un);
     UserNameField.Clear();
     UserNameField.GetText();
     PassWordField.Set(pw);
     SubmitButton.Click();
 }
        public override void TouchesEnded(NSSet touches, UIEvent evt)
        {
            base.TouchesEnded(touches, evt);

            // if they tap somewhere outside of the text fields,
            // hide the keyboard
            UserNameField.ResignFirstResponder( );
            PasswordField.ResignFirstResponder( );
        }
        public LoginPage LoginWithEmptyCreds()
        {
            UserNameField.Clear();
            UserPasswordField.Clear();
            var loginPage = new LoginPage(WebDriver);

            LoginBtn.ClickAndWaitForPageToLoad(loginPage);
            return(loginPage);
        }
        public LoginPage LoginWithEmptyPassword()
        {
            UserNameField.Clear();
            UserPasswordField.SendKeys(ConfigurationManager.AppSettings["user"]);
            UserPasswordField.Clear();
            var loginPage = new LoginPage(WebDriver);

            LoginBtn.ClickAndWaitForPageToLoad(loginPage);
            return(loginPage);
        }
        public void AOSLogin(string username, string password)
        {
            string CurrentWindow = driver.CurrentWindowHandle;

            UserLink.Click();
            System.Threading.Thread.Sleep(3000);
            driver.SwitchTo().Window(driver.WindowHandles.Last());
            UserNameField.SendKeys(username);
            PasswordField.SendKeys(password);
            SignInButton.Click();
        }
        public HomePage LoginToApp()
        {
            EnterButton.Click();
            UserNameField.Clear();
            UserNameField.SendKeys(ConfigurationManager.AppSettings["user"]);
            UserPasswordField.Clear();
            UserPasswordField.SendKeys(ConfigurationManager.AppSettings["password"]);
            var homepage = new HomePage(WebDriver);

            LoginBtn.ClickAndWaitForPageToLoad(homepage);
            return(homepage);
        }
示例#13
0
        public LoginPage LoginWithNoUserNameAndNoPasswordSpecified()
        {
            NavigateToPage();

            UserNameField.Clear();

            PasswordField.Clear();

            SignInButton.Click();

            return(this);
        }
示例#14
0
        public LoginPage LoginWithNonExistingUserWithoutPasswordSpecified()
        {
            NavigateToPage();

            UserNameField.Clear();
            UserNameField.SendKeys("NonExistingUsername");

            PasswordField.Clear();

            SignInButton.Click();

            return(this);
        }
示例#15
0
        public LoginPage LoginWithNoPasswordSpecified()
        {
            NavigateToPage();

            UserNameField.Clear();
            UserNameField.SendKeys(TestUser.Username);

            PasswordField.Clear();

            SignInButton.Click();

            return(this);
        }
示例#16
0
        public IPage LoginWithValidCredentials(string userName, string password)
        {
            NavigateToPage();

            UserNameField.Clear();
            UserNameField.SendKeys(userName);

            PasswordField.Clear();
            PasswordField.SendKeys(password);

            SignInButton.Click();

            return(PageHelper.ResolvePage(WebDriver));
        }
示例#17
0
        public ActivationRequestedPage RegisterNewUser()
        {
            NavigateToPage();

            ClearForm();

            UserNameField.SendKeys(TestUser.Username + "2");
            PasswordField.SendKeys(TestUser.Password);
            RetypePasswordField.SendKeys(TestUser.Password);
            EmailField.SendKeys("*****@*****.**");

            SignUpButton.Click();

            return(new ActivationRequestedPage(WebDriver));
        }
示例#18
0
        public RegisterPage RegisterUsingAlreadyTakenEmail()
        {
            NavigateToPage();

            ClearForm();

            UserNameField.SendKeys(TestUser.Username + "2");
            PasswordField.SendKeys(TestUser.Password);
            RetypePasswordField.SendKeys(TestUser.Password);
            EmailField.SendKeys(TestUser.Email);

            SignUpButton.Click();

            return(this);
        }
 public void EnterUsername(string username)
 {
     try
     {
         Console.Out.WriteLineAsync("Enter UserName " + username);
         //waitForVisibility(Driver, UserNameField);
         UserNameField.Clear();
         UserNameField.SendKeys(username);
     }
     catch (NoSuchElementException e)
     {
         Console.Out.WriteLineAsync("Fail: Enter UserName " + username);
         throw e;
     }
 }
示例#20
0
 public void DeleteTestUser()
 {
     for (int i = 0; i < Elements.Count; i++)
     {
         Elements[i].Click();
         if ((UserNameField.GetAttribute("value") == "*****@*****.**"))
         {
             DeleteButton.Click();
             i = -1;
         }
         else
         {
             CancelButton.Click();
         }
     }
 }
示例#21
0
 public void Delete()
 {
     for (int i = 0; i < Elements.Count; i++)
     {
         Elements[i].Click();
         if ((UserNameField.GetAttribute("value") != "*****@*****.**"))
         {
             DeleteButton.Click();
             i = -1;
         }
         else
         {
             CancelButton.Click();
         }
     }
 }
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            var set = this.CreateBindingSet <AddUserView, AddUserViewModel>();

            set.Bind(AddButton).For(v => v.BindClicked()).To(vm => vm.AddUserCommand);
            set.Bind(CancelButton).For(v => v.BindClicked()).To(vm => vm.CancelCommand);
            set.Bind(UserNameField).To(vm => vm.UserName);
            _userNameEditingDidEndOnExitSubscription = UserNameField.WeakSubscribe(nameof(UserNameField.EditingDidEndOnExit), UserNameField_EditingDidEndOnExit);
            set.Bind(PasswordField).To(vm => vm.Password);
            set.Bind(PasswordField).For(v => v.BindEditingDidEndOnExit()).To(vm => vm.ValidateAndAddCommand);
            set.Bind(ValidationLabel).To(vm => vm.ValidationMessage);

            set.Apply();

            UserNameField.BecomeFirstResponder();
        }
 public void FillFormFieldsWithCorrectData(string userName, string password)
 {
     UserNameField.SendKeys(userName);
     PasswordField.SendKeys(password);
 }
示例#24
0
        public override void ViewDidLayoutSubviews( )
        {
            base.ViewDidLayoutSubviews( );

            nfloat headerHeight = 0;

            ScrollView.Bounds = View.Bounds;

            // see if there's a safe area due to this being a "notch" device
            nfloat safeAreaTopInset = 0;
            nfloat safeAreaBotInset = 0;

            // Make sure they're on iOS 11 before checking for insets. This is only needed for iPhone X anyways, which shipped with iOS 11.
            if (UIDevice.CurrentDevice.CheckSystemVersion(11, 0))
            {
                safeAreaTopInset = UIApplication.SharedApplication.KeyWindow.SafeAreaInsets.Top;
                safeAreaBotInset = UIApplication.SharedApplication.KeyWindow.SafeAreaInsets.Bottom;
            }

            // if there's no top safe area, there WILL be a header, so adjust for it.
            if (safeAreaTopInset == 0)
            {
                HeaderView.Frame = new CGRect(View.Frame.Left, 0, View.Frame.Width, StyledTextField.StyledFieldHeight);

                // setup the header shadow
                UIBezierPath shadowPath = UIBezierPath.FromRect(HeaderView.Bounds);
                HeaderView.Layer.MasksToBounds = false;
                HeaderView.Layer.ShadowColor   = UIColor.Black.CGColor;
                HeaderView.Layer.ShadowOffset  = new CoreGraphics.CGSize(0.0f, .0f);
                HeaderView.Layer.ShadowOpacity = .23f;
                HeaderView.Layer.ShadowPath    = shadowPath.CGPath;

                // the logo may not exist if we're on a display with a notch
                if (LogoView != null)
                {
                    LogoView.Layer.Position = new CoreGraphics.CGPoint((HeaderView.Bounds.Width - LogoView.Bounds.Width) / 2, 0);
                }

                headerHeight = HeaderView.Bounds.Height;

                // only move down the scrollview if there's a header
                ScrollView.Frame = new CGRect(View.Frame.Left, HeaderView.Frame.Bottom, View.Frame.Right, View.Frame.Bottom - headerHeight);
            }
            else
            {
                // otherwise, there's a safe area, so no header. We should therefore adjust the scrollview to be at the top of the window.
                ScrollView.Frame = new CGRect(View.Frame.Left, View.Frame.Top + safeAreaTopInset, View.Frame.Right, View.Frame.Bottom - (safeAreaBotInset + safeAreaTopInset));
            }


            UserNameField.SetFrame(new CGRect(-10, View.Frame.Height * .10f, View.Frame.Width + 20, StyledTextField.StyledFieldHeight));
            PasswordField.SetFrame(new CGRect(UserNameField.Background.Frame.Left, UserNameField.Background.Frame.Bottom, View.Frame.Width + 20, StyledTextField.StyledFieldHeight));

            // use the facebook image's button width, as it looks good.
            nfloat buttonWidth = FBImageView.Bounds.Width;

            LoginButton.Frame = new CGRect((ScrollView.Bounds.Width - buttonWidth) / 2, PasswordField.Background.Frame.Bottom + 20, buttonWidth, ControlStyling.ButtonHeight);
            LoginResult.SetFrame(new CGRect(UserNameField.Background.Frame.Left, LoginButton.Frame.Bottom + 20, View.Frame.Width + 20, StyledTextField.StyledFieldHeight));

            AdditionalOptions.Frame = new CGRect((View.Bounds.Width - AdditionalOptions.Bounds.Width) / 2, LoginResult.Background.Frame.Bottom + 10, AdditionalOptions.Bounds.Width, ControlStyling.ButtonHeight);

            // setup the "Forgot account, Register or Facebook"
            ForgotPasswordButton.Frame = new CGRect((View.Bounds.Width - buttonWidth) / 2, AdditionalOptions.Frame.Bottom + 5, buttonWidth, ControlStyling.ButtonHeight);
            RegisterButton.Frame       = new CGRect((View.Bounds.Width - buttonWidth) / 2, ForgotPasswordButton.Frame.Bottom + 15, buttonWidth, ControlStyling.ButtonHeight);
            OrSpacerLabel.Frame        = new CGRect((View.Bounds.Width - OrSpacerLabel.Bounds.Width) / 2, RegisterButton.Frame.Bottom + 5, OrSpacerLabel.Bounds.Width, FBImageView.Bounds.Height);
            FacebookLogin.Frame        = new CGRect((View.Bounds.Width - FBImageView.Bounds.Width) / 2, OrSpacerLabel.Frame.Bottom + 5, FBImageView.Bounds.Width, FBImageView.Bounds.Height);
            //

            CancelButton.Frame = new CGRect((View.Frame.Width - CancelButton.Frame.Width) / 2, FacebookLogin.Frame.Bottom + 20, CancelButton.Frame.Width, CancelButton.Frame.Height);

            FBImageView.Layer.Position = new CoreGraphics.CGPoint(FacebookLogin.Bounds.Width / 2, FacebookLogin.Bounds.Height / 2);

            if (WebLayout != null)
            {
                WebLayout.LayoutChanged(new CGRect(0, 0, ScrollView.Frame.Width, ScrollView.Frame.Height));
            }

            BlockerView.SetBounds(View.Frame.ToRectF( ));

            ScrollView.ContentSize = new CGSize(View.Bounds.Width, Math.Max(ScrollView.Bounds.Height * 1.02f, CancelButton.Frame.Bottom + 20 + headerHeight));
        }
示例#25
0
 /// <summary>
 /// Enter the username into the field
 /// </summary>
 /// <param name="username">The username to be entered.</param>
 public void EnterUsername(string username)
 {
     UserNameField.Clear();
     UserNameField.SendKeys(username);
 }
示例#26
0
 public void LoginToContentEditor(string username, string password)
 {
     UserNameField.SendKeys(username);
     PasswordField.SendKeys(password);
     LoginButton.Click();
 }
示例#27
0
 public void SetUserName(string username)
 {
     UserNameField.SendKeys(username);
 }