@Test public void shouldMatchConditionWhenAttributeEqualsValue() { when(mockElement.getAttribute("class")).thenReturn("active"); AttributeEqualsCondition condition = new AttributeEqualsCondition("class", "active"); assertThat(condition.apply(mockElement), equalTo(true)); }
@Override public boolean apply(final WebElement element) { try { String attributeValue = element.getAttribute(attribute); return attributeValue != null && attributeValue.equals(value); } catch (NullPointerException | WebDriverException e) { return false; } }
AttributeEqualsCondition extends Condition<WebElement> { @Override public boolean apply(final WebElement element) { try { String attributeValue = element.getAttribute(attribute); return attributeValue != null && attributeValue.equals(value); } catch (NullPointerException | WebDriverException e) { return false; } } }
AttributeEqualsCondition extends Condition<WebElement> { @Override public boolean apply(final WebElement element) { try { String attributeValue = element.getAttribute(attribute); return attributeValue != null && attributeValue.equals(value); } catch (NullPointerException | WebDriverException e) { return false; } } AttributeEqualsCondition(final String attribute, final String value); }
AttributeEqualsCondition extends Condition<WebElement> { @Override public boolean apply(final WebElement element) { try { String attributeValue = element.getAttribute(attribute); return attributeValue != null && attributeValue.equals(value); } catch (NullPointerException | WebDriverException e) { return false; } } AttributeEqualsCondition(final String attribute, final String value); @Override boolean apply(final WebElement element); @Override boolean equals(final Object o); @Override int hashCode(); @Override String toString(); }
AttributeEqualsCondition extends Condition<WebElement> { @Override public boolean apply(final WebElement element) { try { String attributeValue = element.getAttribute(attribute); return attributeValue != null && attributeValue.equals(value); } catch (NullPointerException | WebDriverException e) { return false; } } AttributeEqualsCondition(final String attribute, final String value); @Override boolean apply(final WebElement element); @Override boolean equals(final Object o); @Override int hashCode(); @Override String toString();  }