Пример #1
0
 /// <summary>
 /// Login to TA Dashboard page
 /// </summary>
 /// <param name="username">The username.</param>
 /// <param name="password">The password.</param>
 /// <param name="repositoryName">Name of the repository.</param>
 /// <Author>Long and Phat</Author>
 /// <returns></returns>
 public MainPage SignOn(string username, string password, string repositoryName = null)
 {
     if (repositoryName != null)
     {
         CmbRepo.SelectItem(repositoryName);
     }
     TxtUsername.SendKeys(username);
     TxtPassword.SendKeys(password);
     BtnLogin.Click();
     return(new MainPage(WebDriver));
 }
Пример #2
0
        public LoginPage LoginInvalid(string username, string password)
        {
            //submit creds
            TxtUsername.Clear();
            TxtUsername.SendKeys(username);
            TxtPassword.Clear();
            TxtPassword.SendKeys(password);
            BtnLogin.Click();

            //homepage return
            return(this);
        }
Пример #3
0
        public HomePage Login(string username, string password)
        {
            //submit creds
            TxtUsername.Clear();
            TxtUsername.SendKeys(username);
            TxtPassword.Clear();
            TxtPassword.SendKeys(password);
            BtnLogin.Click();

            //homepage return
            return(new HomePage());
        }
Пример #4
0
        /// <summary>
        ///   Login a user to the application
        /// </summary>
        /// <param name="email"></param>
        /// <param name="password"></param>
        /// <param name="userProfile"></param>
        /// <param name="currTestContext"></param>
        /// <param name="screenShotDir"></param>
        /// <returns></returns>
        public object loginUser(string email, string password, string userProfile, TestContext currTestContext, string screenShotDir)
        {
            object pageObj = null;

            try
            {
                PageFactory.InitElements(BaseWebDriver, this);

                if (userProfile == userType.Admin)
                {
                    email    = adminUserName;
                    password = adminPassword;
                }

                // set the email address
                TxtFeildEmailAddress.Clear();
                TxtFeildEmailAddress.SendKeys(email);

                // set the password
                TxtFieldPassword.Clear();
                TxtFieldPassword.SendKeys(password);

                //Take screenshot before login
                var fileName = TakeScreenShot(currTestContext, screenShotDir);

                // store filename
                if (fileName != null)
                {
                    ScreenshotFileCollnt.Add(fileName);
                }

                // signs up a new user
                BtnLogin.Click();

                if (userProfile == userType.Admin)
                {
                    pageObj = new AdminPage(BaseWebDriver);
                }
                else
                {
                    pageObj = new ApplicantPage(BaseWebDriver);
                }
            }catch (Exception) { }

            return(pageObj);
        }
Пример #5
0
 public LoginPage ClickLoginExpectingError()
 {
     BtnLogin.Click();
     return(new LoginPage(_driver));
 }
Пример #6
0
 public void Login(string username, string password)
 {
     TxtUsername.SendKeys(username);
     TxtPassword.SendKeys(password);
     BtnLogin.Click();
 }
Пример #7
0
 //Click on login button
 public void ClickOnLoginButton()
 {
     BtnLogin.Click();
 }
 public void Login(string email, string password)
 {
     TxtEmail.SendKeys(email);
     TxtPassword.SendKeys(password);
     BtnLogin.Click();
 }
 public void BtnLogin_click()
 {
     Utils.WaitForObjectBePresent(BtnLogin, wait);
     BtnLogin.Click();
     Utils.WaitForObjectNotBePresent(BtnLogin, wait);
 }