com.sdl.selenium.bootstrap.button.Button Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of Testy Show documentation
Show all versions of Testy Show documentation
Automated Acceptance Testing. Selenium and Selenium WebDriver test framework for web applications.
(optimized for dynamic html, ExtJS, Bootstrap, complex UI, simple web applications/sites)
The newest version!
package com.sdl.selenium.bootstrap.button;
import com.sdl.selenium.web.SearchType;
import com.sdl.selenium.web.WebLocator;
import com.sdl.selenium.web.button.IButton;
/**
* Used for finding element process (to generate xpath address)
* Example:
* {@code
*
* }
* In Java write this:
* {@code
* Button saveButton = new Button().setText("Save");
* saveButton.click();
* }
*/
public class Button extends WebLocator implements IButton {
private String iconCls;
public String getIconCls() {
return iconCls;
}
public T setIconCls(final String iconCls) {
this.iconCls = iconCls;
String key = "icon-cls";
setElPathSuffix(key, applyTemplate(key, iconCls));
return (T) this;
}
public Button() {
setClassName("Button");
setBaseCls("btn");
setTag("button");
setTemplate("icon-cls", "count(.//*[contains(@class, '%s')]) > 0");
}
public Button(WebLocator container) {
this();
setContainer(container);
}
public Button(WebLocator container, String text) {
this(container);
setText(text);
setSearchTextType(SearchType.EQUALS);
}
/**
* {@code
*
*
* }
* Example:
* {@code
* Button disableButton = new Button().setText("DisableBtn");
* disableButton.isEnabled();
* }
*
* @return true if element has attribute disabled or class disabled otherwise false
*/
public boolean isEnabled() {
String cls = getAttributeClass();
return cls != null && !cls.contains("disabled") && getAttribute("disabled") == null;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy