コード例 #1
0
        private void ButtonClear_OnClick(object sender, RoutedEventArgs e)
        {
            InputLogin.Clear();
            InputPassword1.Clear();
            InputPassword2.Clear();
            InputEmail.Clear();

            LabelShow.Text = string.Empty;
        }
コード例 #2
0
 public RegisterPage()
 {
     InitializeComponent();
     InputTicketCode.ReturnCommand   = new Command(() => InputFirstName.Focus());
     InputFirstName.ReturnCommand    = new Command(() => InputSurname.Focus());
     InputOtherRemarks.ReturnCommand = new Command(() => InputEmail.Focus());
     InputEmail.ReturnCommand        = new Command(() => InputPassword.Focus());
     InputPassword.ReturnCommand     = new Command(() => InputConfirmPassword.Focus());
 }
コード例 #3
0
        /// <summary>
        /// Performs the login using the <paramref name="username"/> & <paramref name="password"/>
        /// </summary>
        /// <param name="username">The username.</param>
        /// <param name="password">The password.</param>
        public Homepage Login(string username, string password)
        {
            WaitForLoad();

            InputEmail.Clear();
            InputEmail.SendKeys(username);

            InputPassword.Clear();
            InputPassword.SendKeys(password);

            SubmitButton.Click();

            return(new Homepage(Helper.Homepage.AbsoluteUri, Helper.HomepageTitle));
        }
コード例 #4
0
        public bool InformarEmail(string email)
        {
            bool _result = false;

            try
            {
                util.WaitForElementVisible(InputEmail, 30);
                if (InputEmail.Displayed)
                {
                    InputEmail.Click();
                    Thread.Sleep(400);
                    InputEmail.SendKeys(email);

                    _result = true;
                }
                else
                {
                }
            }
            catch
            {
            }
            return(_result);
        }
コード例 #5
0
        public void Register(string password, string promtionCode)
        {
            TestConfigManager.Instance.assertBefore(By.XPath("/html/body/app/div/section/topbar/header/nav/ul/li[5]"));
            PageObjectManager.Instance.external_InitClasses.tempMail.GetMail();
            string email = PageObjectManager.Instance.external_InitClasses.tempMail.email;

            this.ClickOnRegisterButtonTopBar();
            this.RegisterInputEmail("*****@*****.**");
            this.RegisterInputPassword(password);
            this.RegisterConfirimPassword(password);
            this.RegisterPromotionCode(promtionCode);
            if (WebDriverExtension.SeleniumSetMethods.IsFound(By.CssSelector(".error-email .error-box")))
            {
                TestConfigManager.Instance.driver.SwitchTo().Window(BrowsersFactory.Instance.newTabInstance);
                PageObjectManager.Instance.external_InitClasses.tempMail.GetMail();
                InputEmail.Clear();
                this.RegisterInputEmail(email);
            }
            this.RegisterIAccept();
            this.RegisterClickSignup();
            TestConfigManager.Instance.assertAfter(By.CssSelector(".modal-container .success-popup"));
            this.clickOKSuccess();
            System.Threading.Thread.Sleep(2000);
        }
コード例 #6
0
 private void RegisterInputEmail(string userName)
 {
     InputEmail.SendKeys(userName);
     LogManager.Instance.WriteToLog(LogManager.elogLevel.Debug, "enter the  email: " + userName + " to input field");
 }
コード例 #7
0
        private void SubmitLogin_OnClick(object sender, RoutedEventArgs e)
        {
            UserModel user = new UserModel();

            Dispatcher.Invoke(() =>
            {
                try
                {
                    if (user.Login(InputEmail.Text, InputPassword.Password))
                    {
                        switch (user.RoleId)
                        {
                        case 1:
                            //Admin
                            Admin admin = new Admin();

                            admin.Show();
                            //Close Login Window
                            Close();

                            break;

                        case 2:
                            //Secretary
                            Secretary secretary = new Secretary();

                            secretary.Show();
                            //Close Login Window
                            Close();

                            break;

                        case 3:
                            //Staff
                            Staff staff = new Staff();

                            staff.Show();
                            //Close Login Window
                            Close();

                            break;

                        case 4:
                            //Student
                            Student userStudent = new Student();

                            //Open Student Window
                            userStudent.Show();
                            Close();

                            break;
                        }
                    }
                    else
                    {
                        ErrorMsg.Text          = user.error;
                        InputPassword.Password = "";
                        InputEmail.Focus();
                    }
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex + String.Empty);
                }
            });
        }