package org.fundacionjala.automation.framework.pages.admin.login;

import org.fundacionjala.automation.framework.maps.admin.login.LoginMap;
import org.fundacionjala.automation.framework.pages.admin.home.AdminPage;
import org.fundacionjala.automation.framework.utils.common.BrowserManager;
import org.fundacionjala.automation.framework.utils.common.ExplicitWait;
import org.fundacionjala.automation.framework.utils.common.PropertiesReader;
import org.fundacionjala.automation.framework.utils.common.UIActions;
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 org.openqa.selenium.support.ui.WebDriverWait;

import cucumber.deps.com.thoughtworks.xstream.security.ExplicitTypePermission;

public class LoginPage {

    @FindBy(xpath = LoginMap.USER_NAME_TEXT_FIELD)
    WebElement userNameTextField;
    @FindBy(xpath = LoginMap.PASSWORD_TEXT_FIELD)
    WebElement passwordTextField;
    @FindBy(xpath = LoginMap.SIGN_IN_BUTTON)
    WebElement sigInButton;

    public LoginPage() {
	BrowserManager.setUrl(PropertiesReader.getAdminURL());
	PageFactory.initElements(BrowserManager.getDriver(), this);
    }

    public LoginPage setUserName(String userName) {
	UIActions.waitFor(LoginMap.USER_NAME_TEXT_FIELD);
	UIActions.typeOn(userNameTextField, userName);

	return this;
    }

    public LoginPage setPassword(String password) {
	UIActions.waitFor(LoginMap.PASSWORD_TEXT_FIELD);
	UIActions.typeOn(passwordTextField, password);

	return this;
    }

    public AdminPage clickOnSigInButton() {

	UIActions.clickAt(sigInButton);
	return new AdminPage();
    }
}

@@ -1092,17 +1092,97 @@
 Button;%0A
+    %0A    /**%0A     * Open Admin page and Initialize elements with driver %0A     */
 %0A
-
     publ
@@ -1313,33 +1313,138 @@
 ), this);%0A    %7D%0A
+    %0A    /**%0A     * Set login username%0A     * @param userName%0A     * @return this current object %0A     */
 %0A
-
     public Login
@@ -1592,32 +1592,132 @@
 rn this;%0A    %7D%0A%0A
+    /**%0A     * Set login password%0A     * @param password%0A     * @return this current object%0A     */%0A
     public Login
@@ -1868,24 +1868,94 @@
 his;%0A    %7D%0A%0A
+    /**%0A     * Press Sign In button%0A     * @return AdminPage %0A     */%0A
     public A

Fix LoginPage verifying current page