/**
* This class holds static factory methods for custom conditions.
* All return types must be of type Condition, and the implementating
* class hidden by declaring then non-public.
* Methods from this class should be statically imported in tests that need them.
* Method names should be chosen to fit into a fluent interface, and
* start with the word <code>until</code>.
* @author Stephen Gade Esven, IBM Danmark A/S, esven@dk.ibm.com
*/
public final class Conditions {
/**
* Return a Condition Builder for {@link JProgressBar}
* @param progressBar the {@link JProgressBar}
* @return a {@link ProgressBarConditionBuilder}
*/
public static ProgressBarConditionBuilder until(JProgressBar progressBar) {
return new ProgressBarConditionBuilder(progressBar);
}
/**
* Condition builder for JProgressBar.
* Holds methods for creating JProgressBar related conditions.
* @author Jacob Qvortrup, IBM Denmark A/S, jfq@dk.ibm.com
*/
public static class ProgressBarConditionBuilder {
/**
* This is the progress bar attribute
*/
private JProgressBar progressBar;
/**
* Constructs an instance for the progress bar
* @param progressBar the JProgressBar
*/
public ProgressBarConditionBuilder(JProgressBar progressBar) {
this.progressBar = progressBar;
}
/**
* <p>Return a condition that is fulfilled when the progress bar is in
* determinate state. A progress bar that is <code>indeterminate</code>
* is one that shows the user that an operation of unknown length is
* running. The progress bar becomes <code>determinate</code> when the
* operation is complete.</p>
*
* @return a {@link ProgressBarDeterminateConditionBuilder}
*/
public Condition isDeterminate() {
return new ProgressBarDeterminateConditionBuilder(progressBar);
}
}
}
Hi Jacob,
I'm working on this issue now and I have a question: can you please share some more details about "you want the gui test to wait for a determinate progress bar to complete or a indeterminate progress bar to become determinate"?
How would you like to fixture to behave in this case?
Thanks,
-Alex