Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.thoughtworks.selenium.condition
Interface ConditionRunner

All Known Implementing Classes:
  DefaultConditionRunner, JUnit4AndTestNgConditionRunner, JUnitConditionRunner

    public interface ConditionRunner

A ConditionRunner is a class that can execute a `Condition`, which need certain basic pieces that it needs to execute (e.g. an instance of `Selenium`). This is achieved through the `ConditionRunner.Context` interface.

Nested Class Summary
`static interface` | `ConditionRunner.Context` Used by implementations of `waitFor(Condition)` to provide context to the `Condition#isTrue(com.google.testing.selenium.condition.ConditionRunner.Context)` method

Method Summary
`void` | `waitFor(Condition condition)` This method will, every so often, evaluate the given `condition`'s `Condition.isTrue(ConditionRunner.Context)` method, until: it becomes true, in which case it simply returns a certain amount of time is passed, in which case it fails by throwing an failure exception tailored to a given test framework -- e.g.
`void` | `waitFor(java.lang.String narrative, Condition condition)` As above but with an additonal 'should' phrase narrative used in the event of the condition failing to become true

Method Detail

### waitFor

    void waitFor(Condition condition)

  This method will, every so often, evaluate the given `condition`'s `Condition.isTrue(ConditionRunner.Context)` method, until:

  - it becomes true, in which case it simply returns
  - a certain amount of time is passed, in which case it fails by throwing an failure exception tailored to a given test framework -- e.g. `AssertionFailedError` in the case of JUnit
  - it throws an exception, in which case that is wrapped inside a `RuntimeException` and rethrown

  How often if "every so often" and how long is the "certain amount of time" is left to the specific implementations of this interface.

### waitFor

    void waitFor(java.lang.String narrative,
                 Condition condition)

  As above but with an additonal 'should' phrase narrative used in the event of the condition failing to become true

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2009. All Rights Reserved.