/**
 * Created with IntelliJ IDEA.
 * User: jhasmanyquiroz
 * Date: 11/11/15
 * Time: 11:22 AM
 * To change this template use File | Settings | File Templates.
 */
package ui.pages;

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

public class LoginPage extends BasePageObject {

    @FindBy(name = "email")
    @CacheLookup
    private WebElement emailInput;

    @FindBy(name = "password")
    @CacheLookup
    private WebElement passwordInput;

    @FindBy(xpath = "//button[contains(@data-js,'submit')]")
    private  WebElement loginButton;

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

    private LoginPage enterEmail(String email) {
        emailInput.clear();
        emailInput.sendKeys(email);
        return this;
    }

    private LoginPage enterPassword(String pass) {
        passwordInput.clear();
        passwordInput.sendKeys(pass);
        return this;
    }

    private HomePage clickLoginButtonSuccessful() {
        loginButton.click();
        return new HomePage();
    }

    private LoginPage clickLoginButtonFailed() {
        loginButton.click();
        return this;
    }

    private void login(String email, String pass) {
        enterEmail(email);
        enterPassword(pass);
    }

    public HomePage loginSuccessful(String email, String password) {
        login(email, password);
        return clickLoginButtonSuccessful();
    }

    public LoginPage loginFailed(String email, String password) {
        login(email, password);
        return clickLoginButtonFailed();
    }

    public void waitUntilPageObjectIsLoaded() {
        wait.until(ExpectedConditions.visibilityOf(loginButton));
    }
}
@@ -755,16 +755,534 @@
 utton;%0A%0A
+    @FindBy(xpath = %22//div%5Bcontains(@class, 'c-logo')%5D%22)%0A    private WebElement logoCoursera;%0A%0A    @FindBy(xpath = %22//div%5Bcontains(@class, 'c-user-modal-mission')%5D%22)%0A    private WebElement missionCoursera;%0A%0A    @FindBy(xpath = %22//a%5Bcontains(@data-click-key, 'account.wall.click.login')%5D%22)%0A    private WebElement accountLogin;%0A%0A    private String nameLogoCoursera = %22Coursera%22;%0A    private String nameMissionCoursera = %22Universal access to the world%E2%80%99s best education.%22;%0A    private String nameAccountLogin = %22Log In%22;%0A%0A
     publ
@@ -2312,32 +2312,425 @@
 ailed();%0A    %7D%0A%0A
+    public boolean isLogoCourseraPresent() %7B%0A        return (logoCoursera.getText().equalsIgnoreCase(nameLogoCoursera));%0A    %7D%0A%0A    public boolean isMissionCourseraPresent() %7B%0A        return (missionCoursera.getText().equalsIgnoreCase(nameMissionCoursera));%0A    %7D%0A%0A    public boolean isAccountLoginPresent() %7B%0A        return (accountLogin.getText().equalsIgnoreCase(nameAccountLogin));%0A    %7D%0A%0A
     public void 
@@ -2815,24 +2815,25 @@
 tyOf(log
-inButton
+oCoursera
 ));%0A    

Add methods for asserts