From efe2c60b9cefd2bcf1b270c827ce44b7a987f4f5 Mon Sep 17 00:00:00 2001 From: Grzegorz Orczykowski Date: Wed, 21 Aug 2024 23:08:46 +0200 Subject: [PATCH] Improved testing form errors --- .../feature/formentry/InvalidFormTest.kt | 29 +++----- .../resources/forms/emptyGroupFieldList2.xml | 37 ---------- .../src/main/resources/forms/g6Error2.xml | 71 ------------------- .../{g6Error.xml => repeat_in_field_list.xml} | 4 +- 4 files changed, 10 insertions(+), 131 deletions(-) delete mode 100644 test-forms/src/main/resources/forms/emptyGroupFieldList2.xml delete mode 100644 test-forms/src/main/resources/forms/g6Error2.xml rename test-forms/src/main/resources/forms/{g6Error.xml => repeat_in_field_list.xml} (92%) diff --git a/collect_app/src/androidTest/java/org/odk/collect/android/feature/formentry/InvalidFormTest.kt b/collect_app/src/androidTest/java/org/odk/collect/android/feature/formentry/InvalidFormTest.kt index ebbef978b29..b5af28b38be 100644 --- a/collect_app/src/androidTest/java/org/odk/collect/android/feature/formentry/InvalidFormTest.kt +++ b/collect_app/src/androidTest/java/org/odk/collect/android/feature/formentry/InvalidFormTest.kt @@ -28,34 +28,21 @@ class InvalidFormTest { } @Test - fun app_ShouldNotCrash_whenFillingFormsWithErrors() { - rule.startAtMainMenu() - .copyForm("g6Error.xml") - .startBlankFormWithError("g6Error") - .clickOK(FormEntryPage("g6Error")) - .swipeToEndScreen() - .clickFinalize() - .checkIsSnackbarWithMessageDisplayed(R.string.form_saved) - - MainMenuPage() - .copyForm("g6Error2.xml") - .startBlankForm("g6Error2") - .swipeToNextQuestionWithError() - .clickOK(FormEntryPage("g6Error2")) - .swipeToEndScreen() - .clickFinalize() - .checkIsSnackbarWithMessageDisplayed(R.string.form_saved) - + fun app_ShouldNotCrash_whenFillingFormsWithEmptyGroupFieldList() { MainMenuPage() .copyForm("emptyGroupFieldList.xml") .clickFillBlankForm() .clickOnEmptyForm("emptyGroupFieldList") .clickFinalize() .checkIsSnackbarWithMessageDisplayed(R.string.form_saved) + } - MainMenuPage() - .copyForm("emptyGroupFieldList2.xml") - .startBlankForm("emptyGroupFieldList2") + @Test + fun app_ShouldNotCrash_whenFillingFormsWithRepeatInFieldList() { + rule.startAtMainMenu() + .copyForm("repeat_in_field_list.xml") + .startBlankFormWithError("repeat_in_field_list") + .clickOK(FormEntryPage("repeat_in_field_list")) .swipeToEndScreen() .clickFinalize() .checkIsSnackbarWithMessageDisplayed(R.string.form_saved) diff --git a/test-forms/src/main/resources/forms/emptyGroupFieldList2.xml b/test-forms/src/main/resources/forms/emptyGroupFieldList2.xml deleted file mode 100644 index 98abe781e80..00000000000 --- a/test-forms/src/main/resources/forms/emptyGroupFieldList2.xml +++ /dev/null @@ -1,37 +0,0 @@ - - - emptyGroupFieldList2 - - - - - - - - - - - - - - - g - - - text0 - - - - - - - - - - - diff --git a/test-forms/src/main/resources/forms/g6Error2.xml b/test-forms/src/main/resources/forms/g6Error2.xml deleted file mode 100644 index 87fd3b68ce1..00000000000 --- a/test-forms/src/main/resources/forms/g6Error2.xml +++ /dev/null @@ -1,71 +0,0 @@ - - - g6Error2 - - - - - - - - - - - - - - - - - - - - g1 - - - text1 - - - text0 - - - g2 - - - text2 - - - text3 - - - - - - - - - - - - - - diff --git a/test-forms/src/main/resources/forms/g6Error.xml b/test-forms/src/main/resources/forms/repeat_in_field_list.xml similarity index 92% rename from test-forms/src/main/resources/forms/g6Error.xml rename to test-forms/src/main/resources/forms/repeat_in_field_list.xml index 4efa283aacf..35934071372 100644 --- a/test-forms/src/main/resources/forms/g6Error.xml +++ b/test-forms/src/main/resources/forms/repeat_in_field_list.xml @@ -1,9 +1,9 @@ - g6Error + repeat_in_field_list - +