From 487bf7c66408f6ae87d1dac9c0a313f7a7672e0f Mon Sep 17 00:00:00 2001 From: Callum Stott Date: Fri, 29 Mar 2024 11:12:04 +0000 Subject: [PATCH] Add tryAgainOnFail to flakey action --- .../collect/android/support/pages/FormEndPage.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/collect_app/src/androidTest/java/org/odk/collect/android/support/pages/FormEndPage.java b/collect_app/src/androidTest/java/org/odk/collect/android/support/pages/FormEndPage.java index 588efb852d1..7c1b2b23f9e 100644 --- a/collect_app/src/androidTest/java/org/odk/collect/android/support/pages/FormEndPage.java +++ b/collect_app/src/androidTest/java/org/odk/collect/android/support/pages/FormEndPage.java @@ -25,13 +25,16 @@ public FormEndPage assertOnPage() { } public > D clickSaveAsDraft(D destination) { - clickOnString(org.odk.collect.strings.R.string.save_as_draft); - return destination.assertOnPage(); + tryAgainOnFail(() -> { + clickOnString(org.odk.collect.strings.R.string.save_as_draft); + destination.assertOnPage(); + }); + + return destination; } public MainMenuPage clickSaveAsDraft() { - clickOnString(org.odk.collect.strings.R.string.save_as_draft); - return new MainMenuPage().assertOnPage(); + return clickSaveAsDraft(new MainMenuPage()); } public > D clickFinalize(D destination) {