public void AuthenticateAsGoogleUser()
 {
     Logger.Log("<-");
     var user = new User { Login = "******" };
     LoginToAcsProvider(user);
     Logger.Log("->");
 }
 public void AuthenticateAsYahooUser()
 {
     Logger.Log("<-");
     var user = new User { Login = "******" };
     LoginToAcsProvider(user);
     Logger.Log("->");
 }
 public void AuthenticateAsMicrosoftUser()
 {
     Logger.Log("<-");
     var user = new User { Login = "******" };
     LoginToAcsProvider(user);
     Logger.Log("->");
 }
Example #4
0
 public void AuthenticateAsYahooUser()
 {
     Logger.Log("<-");
     var user = new User { Type = UserType.Yahoo };
     OpenIdentityProviderPage(user);
     LoginUser(user);
     Logger.Log("->");
 }
 public void AuthenticateAsMicrosoftUserToSkyDrive()
 {
     Logger.Log("<-");
     var user = new User { Login = "******" };
     FillUserCredentials(user);
     LoginUser(user);
     Logger.Log("->", LogType.MessageWithoutScreenshot);
 }
        public void AuthenticateAsYahooUser()
        {
            Logger.Log("<-");

            if (!IsElementExists(By.XPath("//*[@name='Yahoo!']")))
            {
                Click(By.XPath("//*[@id='MoreOptions']/a"));
            }
            Click(By.XPath("//*[@name='Yahoo!']"));

            var user = new User { Type = UserType.Yahoo };
            FillUserCredentials(user);
            Logger.Log(user.ToString());
            SetUserInfoAndSubmit(user);
            Logger.Log("->");
        }
Example #7
0
        private void SetUserInfoAndSubmit(User user)
        {
            Logger.Log("<- user type: " + user.Type);

            switch (user.Type)
            {
                case UserType.Google:
                    TypeText(By.Id("Email"), user.Login);
                    TypeText(By.Id("Passwd"), user.Password);
                    Click(By.Id("signIn"));
                    break;
                case UserType.Yahoo:
                    TypeText(By.Id("username"), user.Login);
                    TypeText(By.Id("passwd"), user.Password);
                    Click(By.Id(".save"));
                    break;
                case UserType.Microsoft:
                    ClickElementAndType(By.Id("idDiv_PWD_UsernameExample"), user.Login);
                    ClickElementAndType(By.Id("idDiv_PWD_PasswordExample"), user.Password);
                    Click(By.XPath("//*[@id='idSIButton9']"));
                    break;
            }
            Logger.Log("->");
        }
Example #8
0
 private void OpenIdentityProviderPage(User user)
 {
     Logger.Log("<- user type: " + user.Type);
     switch (user.Type)
     {
         case UserType.Google:
             Click(By.XPath("//*[@name='Google']"));
             break;
         case UserType.Yahoo:
             Click(By.XPath("//*[@name='Yahoo!']"));
             break;
         case UserType.Microsoft:
             Click(By.XPath("//*[@name='Windows Live™ ID']"));
             break;
     }
     Logger.Log("->");
 }
Example #9
0
 private void LoginUser(User user)
 {
     Logger.Log("<-");
     FillUserCredentials(user);
     Logger.Log(user.ToString());
     SetUserInfoAndSubmit(user);
     AcceptSecurityWarning();
     Logger.Log("->");
 }
Example #10
0
        protected User FillUserCredentials(User user)
        {
            var document = new XmlDocument();
            document.Load(GetValidAcountsXmlPath());

            switch (user.Type)
            {
                case UserType.Google:
                    user.Login = document.SelectSingleNode("//Accounts/google/login").InnerText;
                    user.Password = document.SelectSingleNode("//Accounts/google/password").InnerText;
                    break;
                case UserType.Microsoft:
                    user.Login = document.SelectSingleNode("//Accounts/microsoft/login").InnerText;
                    user.Password = document.SelectSingleNode("//Accounts/microsoft/password").InnerText;
                    break;
                case UserType.Yahoo:
                    user.Login = document.SelectSingleNode("//Accounts/yahoo/login").InnerText;
                    user.Password = document.SelectSingleNode("//Accounts/yahoo/password").InnerText;
                    break;
                default:
                    throw new Exception("Can not find user credentials, user: " + user);
            }

            return user;
        }
        private void SetUserInfoAndSubmit(User user)
        {
            Logger.Log("<- user type: " + user.Type);

            switch (user.Type)
            {
                case "google":
                    TypeText(By.Id("Email"), user.Login);
                    TypeText(By.Id("Passwd"), user.Password);
                    Click(By.Id("signIn"));
                    break;
                case "yahoo":
                    TypeText(By.Id("username"), user.Login);
                    TypeText(By.Id("passwd"), user.Password);
                    Click(By.Id(".save"));
                    break;
                case "microsoft":
                    ClickElementAndType(By.Id("idDiv_PWD_UsernameExample"), user.Login);
                    ClickElementAndType(By.Id("idDiv_PWD_PasswordExample"), user.Password);
                    Click(By.Id("idSIButton9"));
                    break;
            }
            Logger.Log("->", LogType.MessageWithoutScreenshot);
        }
 private void OpenIdentityProviderPage(User user)
 {
     Logger.Log("<- user type: " + user.Type);
     switch (user.Type)
     {
         case "google":
             Click(By.CssSelector("[name='Google']"));
             break;
         case "yahoo":
             Click(By.CssSelector("[name='Yahoo!']"));
             break;
         case "microsoft":
             Click(By.CssSelector("[name='Windows Live™ ID']"));
             break;
         default:
             throw new Exception("User type is not defined");
     }
     Logger.Log("->");
 }
 private void LoginUser(User user)
 {
     Logger.Log("<-");
     Logger.Log(user.ToString());
     SetUserInfoAndSubmit(user);
     AcceptSecurityWarning();
     Logger.Log("->", LogType.MessageWithoutScreenshot);
 }
 private void LoginToAcsProvider(User user)
 {
     Logger.Log("<-");
     FillUserCredentials(user);
     OpenIdentityProviderPage(user);
     LoginUser(user);
     Logger.Log("->");
 }
 private void LoginToAcsProvider(string email)
 {
     var user = new User { Login = email };
     LoginToAcsProvider(user);
 }
 private void FillUserCredentials(User user)
 {
     IEnumerable<User> users = GetUsersFromJson();
     if (users != null)
         foreach (User userData in users)
         {
             if (userData.Login == user.Login)
             {
                 user.Password = userData.Password;
                 user.Type = userData.Type;
                 break;
             }
         }
 }