Search in sources :

Example 6 with LoginPage

use of org.wso2.iot.integration.ui.pages.login.LoginPage in project product-iots by wso2.

the class IOTAdminDashboard method logout.

/**
 * Performs the logout action.
 * @return : The IOT login page
 */
public LoginPage logout() throws IOException {
    driver.findElement(By.xpath(uiElementMapper.getElement("iot.user.registered.name"))).click();
    WebElement logout = driver.findElement(By.xpath(uiElementMapper.getElement("iot.user.logout.link.xpath")));
    logout.click();
    return new LoginPage(driver);
}
Also used : WebElement(org.openqa.selenium.WebElement) LoginPage(org.wso2.iot.integration.ui.pages.login.LoginPage)

Example 7 with LoginPage

use of org.wso2.iot.integration.ui.pages.login.LoginPage in project product-iots by wso2.

the class NewUserRegistrationTest method userRegisterTest.

@Test(description = "Verify new User registration")
public void userRegisterTest() throws IOException {
    LoginPage login = new LoginPage(driver);
    NewUserRegisterPage registerTest = login.registerNewUser();
    LoginPage loginPage = registerTest.registerUser(Constants.User.Register.FIRST_NAME, Constants.User.Register.LAST_NAME, Constants.User.Register.EMAIL, Constants.User.Register.USER_NAME, Constants.User.Register.PASSWORD, Constants.User.Register.CONFIRM_PASSWORD);
    IOTHomePage homePage = loginPage.loginAsUser(Constants.User.Register.USER_NAME, Constants.User.Register.PASSWORD);
    Assert.assertTrue(homePage.checkUserName());
}
Also used : NewUserRegisterPage(org.wso2.iot.integration.ui.pages.uesr.NewUserRegisterPage) LoginPage(org.wso2.iot.integration.ui.pages.login.LoginPage) IOTHomePage(org.wso2.iot.integration.ui.pages.home.IOTHomePage) Test(org.testng.annotations.Test)

Example 8 with LoginPage

use of org.wso2.iot.integration.ui.pages.login.LoginPage in project product-iots by wso2.

the class LoginUtils method login.

/**
 * This method is used to login as admin.
 *
 * @param driver            The selenium web driver
 * @param automationContext Test Automation context
 * @param webAppURL         The server url
 */
public static void login(WebDriver driver, AutomationContext automationContext, String webAppURL) throws IOException, XPathExpressionException {
    driver.get(webAppURL + Constants.IOT_LOGIN_PATH);
    LoginPage test = new LoginPage(driver);
    test.loginAsAdmin(automationContext.getSuperTenant().getTenantAdmin().getUserName(), automationContext.getSuperTenant().getTenantAdmin().getPassword());
}
Also used : LoginPage(org.wso2.iot.integration.ui.pages.login.LoginPage)

Aggregations

LoginPage (org.wso2.iot.integration.ui.pages.login.LoginPage)5 IOException (java.io.IOException)3 AuthenticationFailedException (org.wso2.carbon.identity.application.authentication.framework.exception.AuthenticationFailedException)3 WebElement (org.openqa.selenium.WebElement)2 Test (org.testng.annotations.Test)2 UserRealm (org.wso2.carbon.user.api.UserRealm)1 UserStoreException (org.wso2.carbon.user.api.UserStoreException)1 IOTAdminDashboard (org.wso2.iot.integration.ui.pages.home.IOTAdminDashboard)1 IOTHomePage (org.wso2.iot.integration.ui.pages.home.IOTHomePage)1 NewUserRegisterPage (org.wso2.iot.integration.ui.pages.uesr.NewUserRegisterPage)1