All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.sdl.selenium.conditions.Condition Maven / Gradle / Ivy

Go to download

Automated Acceptance Testing. Selenium and Selenium WebDriver test framework for web applications. (optimized for dynamic html, ExtJS, Bootstrap, complex UI, simple web applications/sites)

There is a newer version: 20.08.432.0_b2d2a09
Show newest version
package com.sdl.selenium.conditions;

public abstract class Condition implements Comparable, ICondition {

    private String message;
    private String resultMessage;

    private int priority = 5;

    @Override
    public int compareTo(Condition condition) {
        return getPriority() - condition.getPriority();
    }

    public boolean isTimeout() {
        return false;
    }

    @Override
    public boolean isFail() {
        return !isSuccess();
    }

    public Condition() {

    }

    public Condition(String message) {
        this.message = message;
    }

    public Condition(String message, int priority) {
        this(message);
        this.priority = priority;
    }

    @Override
    public String toString() {
        String msg = getClass().getSimpleName();
        if(msg == null || "".equals(msg)) {
            msg = "Condition@" +  getMessage();
        } else {
            msg += "@";
        }
        return msg;
    }

    @Override
    public boolean equals(String message) {
        return message != null && message.equals(getMessage());
    }

    @Override
    public String getMessage() {
        return message;
    }

    @Override
    public int getPriority() {
        return priority;
    }

    @Override
    public void setPriority(int priority) {
        this.priority = priority;
    }

    @Override
    public String getResultMessage() {
        return resultMessage;
    }

    protected void setResultMessage(final String resultMessage) {
        this.resultMessage = resultMessage;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy