Open Jacobvu84 opened 4 years ago
serenity core
package net.serenitybdd.screenplay.questions;
import net.serenitybdd.screenplay.Question;
import java.util.Collection;
import java.util.Comparator;
import java.util.List;
public class AggregateQuestions {
public static <T> Question<Integer> theTotalNumberOf(Question<? extends Collection<T>> listQuestion) {
return new CountQuestion(listQuestion);
}
................
Your implement
public class WebElementArrayQuestion implements Question<List<WebElementState>> {
private final Target target;
public WebElementArrayQuestion(Target target) {
this.target = target;
}
@Override
public List<WebElementState> answeredBy(Actor actor) {
return new ArrayList<>(target.resolveAllFor(actor));
}
public static Question<List<WebElementState>> row(Target target) {
return new WebElementArrayQuestion(target);
}
}
Example:
Trong ví dụ trên, kiểm tra trong trong màn hình chat có 2 dòng tin nhắn.