Search in sources :

Example 1 with ConnectedCupDeviceTypeViewPage

use of org.wso2.iot.integration.ui.pages.samples.ConnectedCupDeviceTypeViewPage in project product-iots by wso2.

the class EnrollDevicePage method gotoConnectedCupDeviceTypeViewPage.

/**
 * Method to perform the navigation to Device type view page of the Connected cup.
 * @return : The corresponding Device type view page. Null, if the element is not visible.
 */
public ConnectedCupDeviceTypeViewPage gotoConnectedCupDeviceTypeViewPage() throws IOException {
    boolean check = UIUtils.isElementPresent(log, driver, By.xpath(uiElementMapper.getElement("iot.sample.connectedcup.xpath")));
    if (check) {
        WebElement deviceDiv = driver.findElement(By.xpath(uiElementMapper.getElement("iot.sample.connectedcup.xpath")));
        WebElement tryBtn = deviceDiv.findElement(By.tagName("button"));
        tryBtn.click();
        return new ConnectedCupDeviceTypeViewPage(driver);
    } else {
        log.error("Element not found!");
        return null;
    }
}
Also used : ConnectedCupDeviceTypeViewPage(org.wso2.iot.integration.ui.pages.samples.ConnectedCupDeviceTypeViewPage) WebElement(org.openqa.selenium.WebElement)

Example 2 with ConnectedCupDeviceTypeViewPage

use of org.wso2.iot.integration.ui.pages.samples.ConnectedCupDeviceTypeViewPage in project product-iots by wso2.

the class SampleEnrollmentTest method setup.

@BeforeClass(alwaysRun = true)
public void setup() throws XPathExpressionException, XMLStreamException, IOException {
    super.init();
    driver = BrowserManager.getWebDriver();
    LoginUtils.login(driver, automationContext, getWebAppURL());
    IOTAdminDashboard adminDashboard = new IOTAdminDashboard(driver);
    EnrollDevicePage enrollDevicePage = adminDashboard.enrollNewDevice();
    connectedCupDeviceTypeViewPage = enrollDevicePage.gotoConnectedCupDeviceTypeViewPage();
}
Also used : EnrollDevicePage(org.wso2.iot.integration.ui.pages.devices.EnrollDevicePage) IOTAdminDashboard(org.wso2.iot.integration.ui.pages.home.IOTAdminDashboard) BeforeClass(org.testng.annotations.BeforeClass)

Aggregations

WebElement (org.openqa.selenium.WebElement)1 BeforeClass (org.testng.annotations.BeforeClass)1 EnrollDevicePage (org.wso2.iot.integration.ui.pages.devices.EnrollDevicePage)1 IOTAdminDashboard (org.wso2.iot.integration.ui.pages.home.IOTAdminDashboard)1 ConnectedCupDeviceTypeViewPage (org.wso2.iot.integration.ui.pages.samples.ConnectedCupDeviceTypeViewPage)1