Skip to content

Commit

Permalink
Improved the new test
Browse files Browse the repository at this point in the history
  • Loading branch information
grzesiek2010 committed Apr 20, 2024
1 parent b92e638 commit bc38868
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -431,8 +431,10 @@ public void changeInValueUsedToDetermineIfAQuestionIsRequired_ShouldUpdateTheRel
.assertQuestion("Target17")
.answerQuestion(0, "blah")
.assertQuestion("Target17", true)
.swipeToNextQuestionWithConstraintViolation(org.odk.collect.strings.R.string.required_answer_error)
.answerQuestion(0, "")
.assertQuestion("Target17");
.assertQuestion("Target17")
.assertTextDoesNotExist(org.odk.collect.strings.R.string.required_answer_error);
}

// Scroll down until the desired group name is visible. This is needed to make the tests work
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,13 @@ public ErrorDialog swipeToNextQuestionWithError() {
return new ErrorDialog().assertOnPage();
}

public FormEntryPage swipeToNextQuestionWithConstraintViolation(int constraintText) {
flingLeft();
assertText(constraintText);

return this;
}

public FormEntryPage swipeToNextQuestionWithConstraintViolation(String constraintText) {
flingLeft();
assertText(constraintText);
Expand Down

0 comments on commit bc38868

Please sign in to comment.