<commit_before>package com.autonomy.abc.topnavbar.login;

import com.autonomy.abc.config.HostedTestBase;
import com.autonomy.abc.config.TestConfig;
import com.autonomy.abc.selenium.users.User;
import org.junit.Ignore;
import org.junit.Test;

/*
 * TODO Possibly make sure a gritter with 'Signed in' comes up, correct colour circle etc. May be difficult to do considering it occurs during tryLogIn()
 */
public class LoginPageHostedITCase extends HostedTestBase {

    public LoginPageHostedITCase(TestConfig config) {
        super(config);
        setInitialUser(User.NULL);
    }

    @Test   @Ignore("No account")
    public void testAPIKeyLogin(){
       testLogin("api_key");
    }

    @Test
    public void testGoogleLogin(){
        testLogin("google");
    }

    @Test
    public void testTwitterLogin(){
        testLogin("twitter");
    }

    @Test   @Ignore("No account")
    public void testFacebookLogin(){
        testLogin("facebook");
    }

    @Test
    public void testYahooLogin(){
        testLogin("yahoo");
    }

    @Test   @Ignore("No account")
    public void testOpenIDLogin(){
        testLogin("open_id");
    }

    @Test
    public void testHPPassportLogin(){
        testLogin("hp_passport");
    }

    private void testLogin(String account) {
        try {
            loginAs(config.getUser(account));
        } catch (Exception e) {
            throw new AssertionError("unable to log in as " + account, e);
        }
    }
}<commit_msg>some login tests<commit_after>package com.autonomy.abc.topnavbar.login;

import com.autonomy.abc.config.HostedTestBase;
import com.autonomy.abc.config.TestConfig;
import com.autonomy.abc.selenium.users.User;
import com.autonomy.abc.selenium.util.Waits;
import org.junit.Ignore;
import org.junit.Test;
import org.openqa.selenium.By;

import static com.autonomy.abc.framework.ABCAssert.verifyThat;
import static org.openqa.selenium.lift.Matchers.displayed;

/*
 * TODO Possibly make sure a gritter with 'Signed in' comes up, correct colour circle etc. May be difficult to do considering it occurs during tryLogIn()
 */
public class LoginPageHostedITCase extends HostedTestBase {

    public LoginPageHostedITCase(TestConfig config) {
        super(config);
        setInitialUser(User.NULL);
    }

    @Test   @Ignore("No account")
    public void testAPIKeyLogin(){
       testLogin("api_key");
    }

    @Test
    public void testGoogleLogin(){
        testLogin("google");
    }

    @Test
    public void testTwitterLogin(){
        testLogin("twitter");
    }

    @Test   @Ignore("No account")
    public void testFacebookLogin(){
        testLogin("facebook");
    }

    @Test
    public void testYahooLogin(){
        testLogin("yahoo");
    }

    @Test   @Ignore("No account")
    public void testOpenIDLogin(){
        testLogin("open_id");
    }

    @Test
    public void testHPPassportLogin(){
        testLogin("hp_passport");
    }

    private void testLogin(String account) {
        try {
            loginAs(config.getUser(account));
        } catch (Exception e) {
            throw new AssertionError("unable to log in as " + account, e);
        }
    }

    @Test
    public void testLogInSearchOptimizerToFind(){
        User user = config.getDefaultUser();
        loginAs(user);

        getDriver().navigate().to(config.getFindUrl());
        verifyThat(getElementFactory().getFindPage(), displayed());
    }

    @Test
    public void testLoginFindToSearchOptimizer() throws InterruptedException {
        getElementFactory().getLoginPage();

        getDriver().navigate().to(config.getFindUrl());
        loginTo(getElementFactory().getFindLoginPage(), getDriver(), config.getDefaultUser());

        getDriver().navigate().to(config.getWebappUrl());
        verifyThat(getElementFactory().getPromotionsPage(), displayed());
    }

    public void testLogOutSearchOptimizerToFind(){
        loginAs(config.getDefaultUser());

        getElementFactory().getTopNavBar().logOut();

        getDriver().navigate().to(config.getFindUrl());
        getElementFactory().getFindLoginPage();

        verifyThat(getDriver().findElement(By.linkText("Google")), displayed());
    }
}
{'fraction_non_alphanumeric': 0.11860353897656624, 'fraction_numerical': 0.0, 'mean_word_length': 3.0611650485436894, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '988437', 'n_tokens_mistral': 1226, 'n_tokens_neox': 1182, 'n_words': 258}