<commit_before>/**
 * Created with IntelliJ IDEA.
 * User: jhasmanyquiroz
 * Date: 11/11/15
 * Time: 3:08 PM
 * To change this template use File | Settings | File Templates.
 */
package ui.pages;

import framework.BrowserManager;
import org.openqa.selenium.By;
import org.openqa.selenium.WebElement;
import ui.BasePageObject;

public class MainPage extends BasePageObject {
    private BrowserManager browser;
    private WebElement element;

    public MainPage() {
        super();
        browser = BrowserManager.getInstance();
    }

    public void clickLogInButton() {
        element = browser.getDriver().findElement(By.linkText("Log In"));
        element.click();
    }

    public void waitUntilPageObjectIsLoaded() {
        //To change body of implemented methods use File | Settings | File Templates.
    }
}<commit_msg>Implement the Page Factory Pattern and methods for login<commit_after>/**
 * Created with IntelliJ IDEA.
 * User: jhasmanyquiroz
 * Date: 11/11/15
 * Time: 3:08 PM
 * To change this template use File | Settings | File Templates.
 */
package ui.pages;

import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.FindBy;
import org.openqa.selenium.support.PageFactory;
import org.openqa.selenium.support.ui.ExpectedConditions;
import ui.BasePageObject;

public class MainPage extends BasePageObject {
    @FindBy(linkText = "Log In")
    private WebElement loginButton;

    @FindBy(xpath = "(//input[@value=''])[2]")
    private  WebElement searchInput;

    @FindBy(css = "i.cif-search.search-icon")
    private WebElement searchButton;

    public MainPage() {
        PageFactory.initElements(driver, this);
        waitUntilPageObjectIsLoaded();
    }

    public LoginPage clickLogInButton() {
        loginButton.click();
        return new LoginPage();
    }

    public MainPage setSearchCourseInput(String searchCourse) {
        searchInput.clear();
        searchInput.sendKeys(searchCourse);
        return this;
    }

    public CoursesPage clickSearchButton() {
        return new CoursesPage();
    }

    public void waitUntilPageObjectIsLoaded() {
        wait.until(ExpectedConditions.visibilityOf(loginButton));
    }
}
{'fraction_non_alphanumeric': 0.10191956124314443, 'fraction_numerical': 0.008683729433272395, 'mean_word_length': 3.413306451612903, '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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5091444', 'n_tokens_mistral': 660, 'n_tokens_neox': 624, 'n_words': 160}