Skip to content
This repository was archived by the owner on Mar 25, 2025. It is now read-only.

Commit 704ed34

Browse files
committed
Fixed issue in WaitUntil where the API did not accept predicates of parent classes
1 parent 3a94425 commit 704ed34

File tree

1 file changed

+7
-3
lines changed
  • webtester-core/src/main/java/info/novatec/testit/webtester/waiting

1 file changed

+7
-3
lines changed

webtester-core/src/main/java/info/novatec/testit/webtester/waiting/WaitUntil.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,16 +27,20 @@ public WaitUntil(T fragment, long timeout, TimeUnit timeUnit) {
2727
this.timeUnit = timeUnit;
2828
}
2929

30-
public WaitUntil<T> is(Predicate<T> condition) throws TimeoutException {
30+
public WaitUntil<T> has(Predicate<? super T> condition) throws TimeoutException {
31+
return is(condition);
32+
}
33+
34+
public WaitUntil<T> is(Predicate<? super T> condition) throws TimeoutException {
3135
WaitOperations.waitUntil(timeout, timeUnit, fragment, condition);
3236
return this;
3337
}
3438

35-
public WaitUntil<T> isNot(Predicate<T> condition) throws TimeoutException {
39+
public WaitUntil<T> isNot(Predicate<? super T> condition) throws TimeoutException {
3640
return not(condition);
3741
}
3842

39-
public WaitUntil<T> not(Predicate<T> condition) throws TimeoutException {
43+
public WaitUntil<T> not(Predicate<? super T> condition) throws TimeoutException {
4044
WaitOperations.waitUntil(timeout, timeUnit, fragment, Conditions.not(condition));
4145
return this;
4246
}

0 commit comments

Comments
 (0)