@Override public String actualValue(Driver driver, WebElement element) { return element.getCssValue(propertyName); }
@Override public boolean apply(Driver driver, WebElement element) { String actualValue = element.getCssValue(propertyName); return defaultString(expectedValue).equalsIgnoreCase(defaultString(actualValue)); }
@Override public String getCssProperty(String cssPropertyName) { return getWebElement().getCssValue(cssPropertyName); }
@Test public void testBannerFunctionalityInDiscoveryPage() { String zoneId = "testzone3"; RestTemplate identityClient = IntegrationTestUtils.getClientCredentialsTemplate( IntegrationTestUtils.getClientCredentialsResource(baseUrl, new String[]{"zones.write", "zones.read", "scim.zones"}, "identity", "identitysecret") ); IdentityZoneConfiguration config = new IdentityZoneConfiguration(); config.setIdpDiscoveryEnabled(true); Banner banner = new Banner(); banner.setText("test banner"); banner.setBackgroundColor("#444"); banner.setTextColor("#111"); config.setBranding(new BrandingInformation()); config.getBranding().setBanner(banner); IntegrationTestUtils.createZoneOrUpdateSubdomain(identityClient, baseUrl, zoneId, zoneId, config); String zoneUrl = baseUrl.replace("localhost",zoneId+".localhost"); webDriver.get(zoneUrl); webDriver.manage().deleteAllCookies(); webDriver.navigate().refresh(); assertEquals("test banner", webDriver.findElement(By.cssSelector(".banner-header span")).getText()); assertEquals("rgba(68, 68, 68, 1)", webDriver.findElement(By.cssSelector(".banner-header")).getCssValue("background-color")); assertEquals("rgba(17, 17, 17, 1)", webDriver.findElement(By.cssSelector(".banner-header span")).getCssValue("color")); String base64Val = "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAATBJREFUeNqk008og3Ecx/HNnrJSu63kIC5qKRe7KeUiOSulTHJUTrsr0y5ycFaEgyQXElvt5KDYwU0uO2hSUy4KoR7v7/qsfmjPHvzq1e/XU8/39/3zPFHf9yP/WV7jED24nGRbxDFWUAsToM05zyKFLG60d/wmQBxWzwyOlMU1phELEyCmtPeRQRoVbKOM0VYB6q0QW+3IYQpJFFDEYFCAiMqwNY857Ko3SxjGBTbRXb+xMUamcMbWh148YwJvOHSCdyqTAdxZo72ADGwKT98C9CChcxUPQSVYLz50toae4Fy9WcAISl7AiN/RhS1N5RV5rOLxx5eom90pvGAI/VjHMm6bfspK18a1gXvsqM41XDVL052C1Tim56cYd/rR+mdSrXGluxfm5S8Z/HV9CjAAvQZLXoa5mpgAAAAASUVORK5CYII="; banner.setLogo(base64Val); IntegrationTestUtils.createZoneOrUpdateSubdomain(identityClient, baseUrl, zoneId, zoneId, config); webDriver.get(zoneUrl); assertEquals("data:image/png;base64," + base64Val, webDriver.findElement(By.cssSelector(".banner-header img")).getAttribute("src")); assertEquals(2, webDriver.findElement(By.cssSelector(".banner-header")).findElements(By.xpath(".//*")).size()); }
public boolean isRecipientOptionDisplayed(FeedbackParticipantType recipientType, int questionNumber) { WebElement recipientOption = browser.driver.findElement( By.cssSelector("#recipienttype-" + questionNumber + " option[value='" + recipientType + "']")); return !"none".equals(recipientOption.getCssValue("display")); }
public boolean isAllRecipientOptionsDisplayed(int questionNumber) { List<WebElement> recipientOptions = browser.driver.findElements(By.cssSelector("#recipienttype-" + questionNumber + " option")); for (WebElement recipientOption : recipientOptions) { if ("none".equals(recipientOption.getCssValue("display"))) { return false; } } return true; }
public boolean verifyAllStatsVisibility() { for (WebElement e : browser.driver.findElements(By.className("resultStatistics"))) { if ("none".equals(e.getCssValue("display"))) { return false; } } return true; }
/** * Gets the value of a given CSS property. See {@link WebElement#getCssValue(String)} for more details. * * @param name Name of the property. * @return The current, computed value of the property. */ @Override public String getCssValue(String name) { return wrappedElement.getCssValue(name); }
/** * Gets the value of a given CSS property. See {@link WebElement#getCssValue(String)} for more details. * * @param name Name of the property. * @return The current, computed value of the property. */ @Override public String getCssValue(String name) { return wrappedElement.getCssValue(name); }
@Override public String getCssValue(String propertyName) { if (delegateWebElement != null) { return delegateWebElement.getCssValue(propertyName); } else { return wrappedWebElement.getCssValue(propertyName); } }
@Override public boolean apply(WebElement webElement) { String attrVal = webElement.getCssValue(propName); return attrVal != null && attrVal.equals(expectedValue); }
@Override public String getCssValue(String propertyName) { logger.debug("get css value for property "+propertyName); return element.getCssValue(propertyName); }
try{ WebElement byId = driver.findElement(By.id("by-id")); System.out.println(byId.getTagName()); System.out.println("get the text for web element with id='by-id' "); System.out.println("------------------------------------------------------------"); System.out.println(byId.getText()); System.out.println("------------------------------------------------------------"); System.out.println(byId.getAttribute("id")); System.out.println(byId.getCssValue("font-size")); } }
@Override public String getCssValue(String propertyName) { waitForVaadin(); return wrappedElement.getCssValue(propertyName); }
@Override public ElementFilterBuilder withCss(String name) { Function<WebElement, String> toValue = element -> element.getCssValue(name); return with("cssValue[" + name + "]", toValue); }
@JDIAction(level = DEBUG) public String getCssValue(String s) { return get().getCssValue(s); } @JDIAction(level = DEBUG)
@Override protected String getElementCSSValue(final By locator, String attribute) { WebElement element = getDriver().findElement(locator); return element.getCssValue(attribute); } }
@Override public String getCssValue(String propertyName) throws WidgetException { try { //HUUPS I changed the implementation (FIX abug?) Why not use findElement? return getGUIDriver().getWrappedDriver().findElement(locator).getCssValue(propertyName); } catch (Exception e) { throw new WidgetException("Error while getting CSS value", locator, e); } }
public String getCSSValue(String locator, String propertyName) { LOG.keywordAppender() .appendLocator(locator) .appendArgument("Property Name", propertyName); WebElement el = finder.find(locator); String cssValue = el.getCssValue(propertyName); LOG.keywordAppender().appendArgument("Css Value", cssValue); return cssValue; }
public void verifyVideoEmbedWidth() { Assertion.assertEquals(videoEmbed.findElement(By.tagName("div")).getCssValue("width"), videoWidth + "px" ); Log.log("verifyVideoEmbedWidth", "Width: " + videoWidth, true); }