public PrismForm<T> setDropDownAttributeValue(QName name, String value) { SelenideElement property = findProperty(name); ElementsCollection values = property.$$(By.className("prism-property-value")); if (values.size() > 0) { SelenideElement dropDown = values.first().$(By.tagName("select")); if (dropDown != null){ dropDown.selectOptionContainingText(value); } } return this; }
public PrismForm<T> addAttributeValue(QName name, String value) { SelenideElement property = findProperty(name); ElementsCollection values = property.$$(By.className("prism-property-value")); if (values.size() == 1) { values.first().$(By.className("form-control")).setValue(value); } // todo implement return this; }
public PrismForm<T> setPasswordFieldsValues(QName name, String value) { SelenideElement property = findProperty(name); ElementsCollection values = property.$$(By.className("prism-property-value")); if (values.size() > 0) { ElementsCollection passwordInputs = values.first().$$(By.tagName("input")); if (passwordInputs != null){ passwordInputs.forEach(inputElement -> inputElement.setValue(value)); } } return this; }
public PrismForm<T> addAttributeValue(String name, String value) { SelenideElement property = findProperty(name); $(By.className("prism-properties")).waitUntil(Condition.appears,MidPoint.TIMEOUT_MEDIUM_6_S); ElementsCollection values = property.$$(By.className("prism-property-value")); if (values.size() == 1) { values.first().$(By.className("form-control")).setValue(value); } // todo implement return this; }
public PrismForm<T> changeAttributeValue(String name, String oldValue, String newValue) { SelenideElement property = findProperty(name); $(By.className("prism-properties")).waitUntil(Condition.appears,MidPoint.TIMEOUT_MEDIUM_6_S); ElementsCollection values = property.$$(By.className("prism-property-value")); if (values.size() == 1) { values.first().$(By.className("form-control")).setValue(newValue); } // todo implement return this; }
private void moveThroughPages(int offsetFromActual) { SelenideElement ul = getParentElement().$(By.cssSelector(".pagination.pagination-sm.no-margin.pull-right")); ElementsCollection col = ul.$$x(".//li"); SelenideElement active = col.find(Condition.cssClass("active")); int index = col.indexOf(active); index = index + offsetFromActual; if (index < 2 || index > col.size() - 2) { // it's <<, <, >, >> throw new SchrodingerException("Can't move through paging, page doesn't exist"); } col.get(index).$x(".//a").click(); }