com.sdl.selenium.conditions.ElementRemovedSuccessCondition 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.conditions;
import com.google.common.base.Strings;
import com.sdl.selenium.web.WebLocator;
import java.time.Duration;
// TODO is possible that ElementRemovedSuccessCondition is executed because some error messages have been arrived
// think about some solutions to fix this.
public class ElementRemovedSuccessCondition extends SuccessCondition implements RenderCondition {
private WebLocator component;
private ElementRemovedSuccessCondition(String message) {
super(message);
}
private ElementRemovedSuccessCondition(String message, String className) {
super(message, className);
}
public ElementRemovedSuccessCondition(WebLocator component) {
this(component.toString());
this.component = component;
}
public ElementRemovedSuccessCondition(WebLocator component, String className) {
this(component.toString(), className);
this.component = component;
}
public ElementRemovedSuccessCondition(WebLocator component, int priority) {
this(component);
setPriority(priority);
}
public ElementRemovedSuccessCondition(WebLocator component, int priority, String className) {
this(component, className);
setPriority(priority);
}
public boolean execute() {
return !component.waitToRender(Duration.ZERO, false);
}
@Override
public WebLocator getComponent() {
return component;
}
/**
* @return component.getText()
*/
@Override
public String getResultMessage() {
return component.getText();
}
public String toString() {
String msg = getClassName();
if (Strings.isNullOrEmpty(msg)) {
msg = "ElementRemovedSuccessCondition@" + getMessage();
} else {
msg += ":ElementRemovedSuccessCondition@" + getMessage();
}
return msg;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy