Open manucolt92 opened 6 years ago
You can use something like:
actor.should(seeThat(the(TodoList.NEW_TODO_FIELD), isVisible()));
I didn't explain myself very well sorry! I need to see those elements displayed and if those elements are not displayed, wait until they appear and then do some things like complete fields or do some clicks. It's something related to the transaction between pages. Thank you in advance!
actor.should(eventually(seeThat(the(TodoList.NEW_TODO_FIELD), isVisible())));
Or
actor.attemptsTo(
WaitUntil.the(TodoList.NEW_TODO_FIELD, isVisible()),
...
);
Or
actor.attemptsTo(
WaitUntil.the(TodoList.NEW_TODO_FIELD, isVisible()).forNoMoreThan(30).seconds(),
...
);
I prefer the first because it reads pretty much as you said "I need to see those elements displayed" == "the actor should see that the todo list field is visible"
Hi there!! I'm trying to validate some displayed elements in the page before do some things. But I don't know how. Anybody can helps me please? For e.g.
@Step("{0} adds a todo item called #thingToDo") public void performAs(T actor) {
actor.attemptsTo(
[VALIDATIONS HERE BEFORE ACTIONS]
Enter.theValue(thingToDo).into(ToDoList.NEW_TODO_FIELD),
Hit.the(RETURN).keyIn(ToDoList.NEW_TODO_FIELD)
);
}