Search in sources :

Example 1 with ConnectedCupDeviceViewPage

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

the class DevicesPage method viewDevice.

/**
 * This method performs the navigation to the Device view of the given device.
 * Here the navigation happens to the Connected cup device.
 * @param deviceName : Name of the device.
 * @return : The corresponding device view page. Null if not visible.
 */
public ConnectedCupDeviceViewPage viewDevice(String deviceName) throws IOException {
    WebElement deviceTable = driver.findElement(By.xpath(uiElementMapper.getElement("iot.devices.table.xpath")));
    List<WebElement> anchors = deviceTable.findElements(By.cssSelector("a"));
    for (WebElement element : anchors) {
        String connectedCupLink = getLink(element, "/device/connectedcup?id=");
        if (connectedCupLink != null) {
            driver.get(connectedCupLink);
            return new ConnectedCupDeviceViewPage(driver, deviceName);
        }
    }
    return null;
}
Also used : ConnectedCupDeviceViewPage(org.wso2.iot.integration.ui.pages.samples.ConnectedCupDeviceViewPage) WebElement(org.openqa.selenium.WebElement)

Aggregations

WebElement (org.openqa.selenium.WebElement)1 ConnectedCupDeviceViewPage (org.wso2.iot.integration.ui.pages.samples.ConnectedCupDeviceViewPage)1