From f9f0e667cf9d13d9b5d4f9d968d1b54a62a0d152 Mon Sep 17 00:00:00 2001 From: Grzegorz Orczykowski Date: Thu, 29 Aug 2024 15:35:41 +0200 Subject: [PATCH 01/22] Moved sortByDialog_ShouldBeTranslatedAndDisplayProperIcons to a separate class --- .../formmanagement/BlankFormListTest.kt | 68 +++++++++++++++++++ .../android/regression/FillBlankFormTest.java | 61 ----------------- 2 files changed, 68 insertions(+), 61 deletions(-) create mode 100644 collect_app/src/androidTest/java/org/odk/collect/android/feature/formmanagement/BlankFormListTest.kt diff --git a/collect_app/src/androidTest/java/org/odk/collect/android/feature/formmanagement/BlankFormListTest.kt b/collect_app/src/androidTest/java/org/odk/collect/android/feature/formmanagement/BlankFormListTest.kt new file mode 100644 index 00000000000..d13d88ed4e8 --- /dev/null +++ b/collect_app/src/androidTest/java/org/odk/collect/android/feature/formmanagement/BlankFormListTest.kt @@ -0,0 +1,68 @@ +package org.odk.collect.android.feature.formmanagement + +import androidx.test.espresso.Espresso.onView +import androidx.test.espresso.assertion.ViewAssertions.matches +import androidx.test.espresso.matcher.ViewMatchers.withText +import androidx.test.ext.junit.runners.AndroidJUnit4 +import org.junit.Rule +import org.junit.Test +import org.junit.rules.RuleChain +import org.junit.runner.RunWith +import org.odk.collect.android.R +import org.odk.collect.android.support.rules.CollectTestRule +import org.odk.collect.android.support.rules.TestRuleChain +import org.odk.collect.androidtest.DrawableMatcher.withImageDrawable +import org.odk.collect.testshared.RecyclerViewMatcher.Companion.withRecyclerView + +@RunWith(AndroidJUnit4::class) +class BlankFormListTest { + private val rule = CollectTestRule() + + @get:Rule + val chain: RuleChain = TestRuleChain.chain().around(rule) + + @Test + fun sortByDialog_ShouldBeTranslatedAndDisplayProperIcons() { + rule.startAtMainMenu() + .openProjectSettingsDialog() + .clickSettings() + .clickOnUserInterface() + .clickOnLanguage() + .clickOnSelectedLanguage("Deutsch") + .clickFillBlankForm() + .clickOnSortByButton() + .assertText("Sortieren nach") + + onView( + withRecyclerView(R.id.recyclerView).atPositionOnView(0, R.id.title) + ).check(matches(withText("Name, A-Z"))) + + onView( + withRecyclerView(R.id.recyclerView).atPositionOnView(0, R.id.icon) + ).check(matches(withImageDrawable(R.drawable.ic_sort_by_alpha))) + + onView( + withRecyclerView(R.id.recyclerView).atPositionOnView(1, R.id.title) + ).check(matches(withText("Name, Z-A"))) + + onView( + withRecyclerView(R.id.recyclerView).atPositionOnView(1, R.id.icon) + ).check(matches(withImageDrawable(R.drawable.ic_sort_by_alpha))) + + onView( + withRecyclerView(R.id.recyclerView).atPositionOnView(2, R.id.title) + ).check(matches(withText("Datum, neuestes zuerst"))) + + onView( + withRecyclerView(R.id.recyclerView).atPositionOnView(2, R.id.icon) + ).check(matches(withImageDrawable(R.drawable.ic_access_time))) + + onView( + withRecyclerView(R.id.recyclerView).atPositionOnView(3, R.id.title) + ).check(matches(withText("Datum, ältestes zuerst"))) + + onView( + withRecyclerView(R.id.recyclerView).atPositionOnView(3, R.id.icon) + ).check(matches(withImageDrawable(R.drawable.ic_access_time))) + } +} diff --git a/collect_app/src/androidTest/java/org/odk/collect/android/regression/FillBlankFormTest.java b/collect_app/src/androidTest/java/org/odk/collect/android/regression/FillBlankFormTest.java index de6ceb77cd8..53f1d47fdfa 100644 --- a/collect_app/src/androidTest/java/org/odk/collect/android/regression/FillBlankFormTest.java +++ b/collect_app/src/androidTest/java/org/odk/collect/android/regression/FillBlankFormTest.java @@ -1,12 +1,6 @@ package org.odk.collect.android.regression; -import static androidx.test.espresso.Espresso.onView; -import static androidx.test.espresso.Espresso.pressBack; -import static androidx.test.espresso.assertion.ViewAssertions.matches; -import static androidx.test.espresso.matcher.ViewMatchers.withText; import static junit.framework.TestCase.assertNotSame; -import static org.odk.collect.androidtest.DrawableMatcher.withImageDrawable; -import static org.odk.collect.testshared.RecyclerViewMatcher.withRecyclerView; import static java.util.Collections.singletonList; import android.widget.FrameLayout; @@ -59,61 +53,6 @@ public void answers_ShouldBeSuggestedInComplianceWithSelectedLetters() { .assertText("Abrotanum alpestre"); } - @Test - public void sortByDialog_ShouldBeTranslatedAndDisplayProperIcons() { - //TestCase37 - rule.startAtMainMenu() - .openProjectSettingsDialog() - .clickSettings() - .clickOnUserInterface() - .clickOnLanguage() - .clickOnSelectedLanguage("Deutsch") - .clickFillBlankForm() - .clickOnSortByButton() - .assertText("Sortieren nach"); - - onView(withRecyclerView(R.id.recyclerView) - .atPositionOnView(0, R.id.title)) - .check(matches(withText("Name, A-Z"))); - - onView(withRecyclerView(R.id.recyclerView) - .atPositionOnView(0, R.id.icon)) - .check(matches(withImageDrawable(R.drawable.ic_sort_by_alpha))); - - onView(withRecyclerView(R.id.recyclerView) - .atPositionOnView(1, R.id.title)) - .check(matches(withText("Name, Z-A"))); - onView(withRecyclerView(R.id.recyclerView) - .atPositionOnView(1, R.id.icon)) - .check(matches(withImageDrawable(R.drawable.ic_sort_by_alpha))); - - onView(withRecyclerView(R.id.recyclerView) - .atPositionOnView(2, R.id.title)) - .check(matches(withText("Datum, neuestes zuerst"))); - - onView(withRecyclerView(R.id.recyclerView) - .atPositionOnView(2, R.id.icon)) - .check(matches(withImageDrawable(R.drawable.ic_access_time))); - - onView(withRecyclerView(R.id.recyclerView) - .atPositionOnView(3, R.id.title)) - .check(matches(withText("Datum, ältestes zuerst"))); - - onView(withRecyclerView(R.id.recyclerView) - .atPositionOnView(3, R.id.icon)) - .check(matches(withImageDrawable(R.drawable.ic_access_time))); - - pressBack(); - pressBack(); - - new MainMenuPage() - .openProjectSettingsDialog() - .clickSettings() - .clickOnUserInterface() - .clickOnLanguage() - .clickOnSelectedLanguage("English"); - } - @Test public void searchExpression_ShouldDisplayWhenItContainsOtherAppearanceName() { //TestCase26 From d39df1936bfee5770f1951a83cbd9fd8da4c6908 Mon Sep 17 00:00:00 2001 From: Grzegorz Orczykowski Date: Thu, 29 Aug 2024 15:37:11 +0200 Subject: [PATCH 02/22] Moved question_ShouldBeVisibleOnTheTopOfHierarchy to FormHierarchyTest --- .../feature/formentry/FormHierarchyTest.java | 13 +++++++++++++ .../android/regression/FillBlankFormTest.java | 14 -------------- 2 files changed, 13 insertions(+), 14 deletions(-) diff --git a/collect_app/src/androidTest/java/org/odk/collect/android/feature/formentry/FormHierarchyTest.java b/collect_app/src/androidTest/java/org/odk/collect/android/feature/formentry/FormHierarchyTest.java index 91f9cb8c9c4..73d7cf8f1cb 100644 --- a/collect_app/src/androidTest/java/org/odk/collect/android/feature/formentry/FormHierarchyTest.java +++ b/collect_app/src/androidTest/java/org/odk/collect/android/feature/formentry/FormHierarchyTest.java @@ -225,4 +225,17 @@ public void hierachyView_shouldNotChangeAfterScreenRotation() { .rotateToLandscape(new FormHierarchyPage("Repeat Group")) .checkIfElementInHierarchyMatchesToText("Group Name", 0); } + + @Test + public void theListOfQuestionsShouldBeScrolledToTheLastDisplayedQuestionAfterOpeningTheHierarchy() { + rule.startAtMainMenu() + .copyForm("manyQ.xml") + .startBlankForm("manyQ") + .swipeToNextQuestion("t2") + .swipeToNextQuestion("n1") + .clickGoToArrow() + .assertText("n1") + .assertTextDoesNotExist("t1") + .assertTextDoesNotExist("t2"); + } } diff --git a/collect_app/src/androidTest/java/org/odk/collect/android/regression/FillBlankFormTest.java b/collect_app/src/androidTest/java/org/odk/collect/android/regression/FillBlankFormTest.java index 53f1d47fdfa..dc390e74e83 100644 --- a/collect_app/src/androidTest/java/org/odk/collect/android/regression/FillBlankFormTest.java +++ b/collect_app/src/androidTest/java/org/odk/collect/android/regression/FillBlankFormTest.java @@ -218,20 +218,6 @@ public void values_ShouldBeRandom() { assertNotSame(firstQuestionAnswers.get(1), firstQuestionAnswers.get(2)); } - @Test - public void question_ShouldBeVisibleOnTheTopOfHierarchy() { - //TestCase23 - rule.startAtMainMenu() - .copyForm("manyQ.xml") - .startBlankForm("manyQ") - .swipeToNextQuestion("t2") - .swipeToNextQuestion("n1") - .clickGoToArrow() - .assertText("n1") - .assertTextDoesNotExist("t1") - .assertTextDoesNotExist("t2"); - } - @Test public void noDataLost_ShouldRememberAnswersForMultiSelectWidget() { //TestCase44 From ecc8aa98f907547f93a5371103f40c3a60169c5b Mon Sep 17 00:00:00 2001 From: Grzegorz Orczykowski Date: Thu, 29 Aug 2024 15:37:58 +0200 Subject: [PATCH 03/22] Removed redundant noDataLost_ShouldRememberAnswersForMultiSelectWidget --- .../android/regression/FillBlankFormTest.java | 23 ---- .../forms/test_multiselect_cleared.xml | 115 ------------------ 2 files changed, 138 deletions(-) delete mode 100644 test-forms/src/main/resources/forms/test_multiselect_cleared.xml diff --git a/collect_app/src/androidTest/java/org/odk/collect/android/regression/FillBlankFormTest.java b/collect_app/src/androidTest/java/org/odk/collect/android/regression/FillBlankFormTest.java index dc390e74e83..13d3ecbd3f6 100644 --- a/collect_app/src/androidTest/java/org/odk/collect/android/regression/FillBlankFormTest.java +++ b/collect_app/src/androidTest/java/org/odk/collect/android/regression/FillBlankFormTest.java @@ -218,29 +218,6 @@ public void values_ShouldBeRandom() { assertNotSame(firstQuestionAnswers.get(1), firstQuestionAnswers.get(2)); } - @Test - public void noDataLost_ShouldRememberAnswersForMultiSelectWidget() { - //TestCase44 - rule.startAtMainMenu() - .copyForm("test_multiselect_cleared.xml") - .startBlankForm("test_multiselect_cleared") - .clickOnText("a") - .clickOnText("c") - .swipeToNextQuestion("If you go back, the answers are deleted if you selected more than 1 option.") - .swipeToNextQuestion("choice2", true) - .clickOnText("b") - .clickOnText("d") - .swipeToEndScreen() - .swipeToPreviousQuestion("choice2", true) - .swipeToPreviousQuestion("If you go back, the answers are deleted if you selected more than 1 option.") - .swipeToPreviousQuestion("choice1", true) - .clickGoToArrow() - .assertText("a, c") - .assertText("b, d") - .clickJumpEndButton() - .clickGoToArrow(); - } - @Test public void typeMismatchErrorMessage_shouldBeDisplayed() { //TestCase48 diff --git a/test-forms/src/main/resources/forms/test_multiselect_cleared.xml b/test-forms/src/main/resources/forms/test_multiselect_cleared.xml deleted file mode 100644 index 8372cefec6b..00000000000 --- a/test-forms/src/main/resources/forms/test_multiselect_cleared.xml +++ /dev/null @@ -1,115 +0,0 @@ - - - - test_multiselect_cleared - - - - - a - - - b - - - f - - - d - - - c - - - e - - - - - - - - - - - - - - - - - - - - - - - static_instance-group_choices-0 - a - 1 - - - static_instance-group_choices-1 - b - 2 - - - static_instance-group_choices-2 - c - 1 - - - static_instance-group_choices-3 - d - 2 - - - static_instance-group_choices-4 - e - 1 - - - static_instance-group_choices-5 - f - - - - - - - - - - - - - - - - - - - - - - - From aad0ab0ad42a8cd7235b7f127d802a7c2b2134f5 Mon Sep 17 00:00:00 2001 From: Grzegorz Orczykowski Date: Thu, 29 Aug 2024 15:41:30 +0200 Subject: [PATCH 04/22] Moved missingFileMessage_shouldBeDisplayedIfExternalFileIsMissing to FormMediaTest --- .../feature/formentry/FormMediaTest.kt | 48 ++++++++++++++++--- .../android/regression/FillBlankFormTest.java | 36 -------------- 2 files changed, 42 insertions(+), 42 deletions(-) diff --git a/collect_app/src/androidTest/java/org/odk/collect/android/feature/formentry/FormMediaTest.kt b/collect_app/src/androidTest/java/org/odk/collect/android/feature/formentry/FormMediaTest.kt index 8efc9a98dcb..43916dcc7d3 100644 --- a/collect_app/src/androidTest/java/org/odk/collect/android/feature/formentry/FormMediaTest.kt +++ b/collect_app/src/androidTest/java/org/odk/collect/android/feature/formentry/FormMediaTest.kt @@ -5,26 +5,62 @@ import org.junit.Rule import org.junit.Test import org.junit.rules.RuleChain import org.junit.runner.RunWith -import org.odk.collect.android.support.rules.FormEntryActivityTestRule +import org.odk.collect.android.storage.StoragePathProvider +import org.odk.collect.android.storage.StorageSubdirectory +import org.odk.collect.android.support.rules.CollectTestRule import org.odk.collect.android.support.rules.TestRuleChain.chain @RunWith(AndroidJUnit4::class) class FormMediaTest { - private val rule = FormEntryActivityTestRule() + private val rule = CollectTestRule() @get:Rule - val ruleChain: RuleChain = chain() - .around(rule) + val ruleChain: RuleChain = chain().around(rule) @Test fun loadingFormWithZippedMedia_unzipsIntoMediaDirectory() { - rule.setUpProjectAndCopyForm("external_select_10.xml", listOf("external_data_10.zip")) - .fillNewForm("external_select_10.xml", "external select 10") + rule.startAtMainMenu() + .copyForm("external_select_10.xml", listOf("external_data_10.zip")) + .startBlankForm("external select 10") .clickOnText("a") .swipeToNextQuestion("Second") .assertText("aa") .assertText("ab") .assertText("ac") } + + @Test + fun missingFileMessage_shouldBeDisplayedIfExternalFileIsMissing() { + val formsDirPath = StoragePathProvider().getOdkDirPath(StorageSubdirectory.FORMS) + + //TestCase55 + rule.startAtMainMenu() + .copyForm("search_and_select.xml") + .startBlankForm("search_and_select") + .assertText("File: $formsDirPath/search_and_select-media/nombre.csv is missing.") + .assertText("File: $formsDirPath/search_and_select-media/nombre2.csv is missing.") + .swipeToEndScreen() + .clickFinalize() + + .copyForm("select_one_external.xml") + .startBlankForm("cascading select test") + .clickOnText("Texas") + .swipeToNextQuestion("county") + .assertText("File: $formsDirPath/select_one_external-media/itemsets.csv is missing.") + .swipeToNextQuestion("city") + .assertText("File: $formsDirPath/select_one_external-media/itemsets.csv is missing.") + .swipeToEndScreen() + .clickFinalize() + + .copyForm("fieldlist-updates_nocsv.xml") + .startBlankForm("fieldlist-updates") + .clickGoToArrow() + .clickGoUpIcon() + .clickOnElementInHierarchy(14) + .clickOnQuestion("Source15") + .assertText("File: $formsDirPath/fieldlist-updates_nocsv-media/fruits.csv is missing.") + .swipeToEndScreen() + .clickFinalize() + } } diff --git a/collect_app/src/androidTest/java/org/odk/collect/android/regression/FillBlankFormTest.java b/collect_app/src/androidTest/java/org/odk/collect/android/regression/FillBlankFormTest.java index 13d3ecbd3f6..b2544164ef3 100644 --- a/collect_app/src/androidTest/java/org/odk/collect/android/regression/FillBlankFormTest.java +++ b/collect_app/src/androidTest/java/org/odk/collect/android/regression/FillBlankFormTest.java @@ -14,8 +14,6 @@ import org.junit.runner.RunWith; import org.odk.collect.android.R; import org.odk.collect.android.activities.FormFillingActivity; -import org.odk.collect.android.storage.StoragePathProvider; -import org.odk.collect.android.storage.StorageSubdirectory; import org.odk.collect.android.support.ActivityHelpers; import org.odk.collect.android.support.pages.FormEndPage; import org.odk.collect.android.support.pages.FormEntryPage; @@ -300,40 +298,6 @@ public void when_chooseAnswer_should_beVisibleInNextQuestion() { .swipeToNextQuestion("7.2 What is the size of the mesh for the Seinenet ?", true); } - @Test - public void missingFileMessage_shouldBeDisplayedIfExternalFileIsMissing() { - String formsDirPath = new StoragePathProvider().getOdkDirPath(StorageSubdirectory.FORMS); - - //TestCase55 - rule.startAtMainMenu() - .copyForm("search_and_select.xml") - .startBlankForm("search_and_select") - .assertText("File: " + formsDirPath + "/search_and_select-media/nombre.csv is missing.") - .assertText("File: " + formsDirPath + "/search_and_select-media/nombre2.csv is missing.") - .swipeToEndScreen() - .clickFinalize() - - .copyForm("select_one_external.xml") - .startBlankForm("cascading select test") - .clickOnText("Texas") - .swipeToNextQuestion("county") - .assertText("File: " + formsDirPath + "/select_one_external-media/itemsets.csv is missing.") - .swipeToNextQuestion("city") - .assertText("File: " + formsDirPath + "/select_one_external-media/itemsets.csv is missing.") - .swipeToEndScreen() - .clickFinalize() - - .copyForm("fieldlist-updates_nocsv.xml") - .startBlankForm("fieldlist-updates") - .clickGoToArrow() - .clickGoUpIcon() - .clickOnElementInHierarchy(14) - .clickOnQuestion("Source15") - .assertText("File: " + formsDirPath + "/fieldlist-updates_nocsv-media/fruits.csv is missing.") - .swipeToEndScreen() - .clickFinalize(); - } - private String getQuestionText() { FormFillingActivity formFillingActivity = (FormFillingActivity) ActivityHelpers.getActivity(); FrameLayout questionContainer = formFillingActivity.findViewById(R.id.text_container); From a892f8fecceb261eace6553fb61556f1c6ffd61e Mon Sep 17 00:00:00 2001 From: Grzegorz Orczykowski Date: Thu, 29 Aug 2024 15:42:40 +0200 Subject: [PATCH 05/22] Removed redundant predicateWarning_ShouldBeAbleToFillTheForm --- .../android/regression/FillBlankFormTest.java | 18 ------------------ .../main/resources/forms/predicate-warning.xml | 1 - 2 files changed, 19 deletions(-) delete mode 100644 test-forms/src/main/resources/forms/predicate-warning.xml diff --git a/collect_app/src/androidTest/java/org/odk/collect/android/regression/FillBlankFormTest.java b/collect_app/src/androidTest/java/org/odk/collect/android/regression/FillBlankFormTest.java index b2544164ef3..0d0d2f7e18b 100644 --- a/collect_app/src/androidTest/java/org/odk/collect/android/regression/FillBlankFormTest.java +++ b/collect_app/src/androidTest/java/org/odk/collect/android/regression/FillBlankFormTest.java @@ -81,24 +81,6 @@ public void searchExpression_ShouldDisplayWhenItContainsOtherAppearanceName() { .checkIsSnackbarWithMessageDisplayed(org.odk.collect.strings.R.string.form_saved); } - @Test - public void predicateWarning_ShouldBeAbleToFillTheForm() { - //TestCase24 - rule.startAtMainMenu() - .copyForm("predicate-warning.xml") - .startBlankForm("predicate-warning") - .clickOnText("Apple") - .swipeToNextQuestion("Variety (absolute reference)") - .clickOnText("Gala") - .swipeToNextQuestion("Variety (relative reference)") - .swipeToNextQuestion("Varieties (absolute reference)") - .clickOnText("Gala") - .clickOnText("Granny Smith") - .swipeToNextQuestion("Varieties (relative reference)") - .swipeToEndScreen() - .clickFinalize(); - } - @Test public void searchAppearance_ShouldDisplayWhenSearchAppearanceIsSpecified() { //TestCase25 diff --git a/test-forms/src/main/resources/forms/predicate-warning.xml b/test-forms/src/main/resources/forms/predicate-warning.xml deleted file mode 100644 index 1624bbeded3..00000000000 --- a/test-forms/src/main/resources/forms/predicate-warning.xml +++ /dev/null @@ -1 +0,0 @@ -predicate-warningBoothAppleBlueberryGalaCollinsGranny SmithCherimoyaBehlBlueraystatic_instance-variety-0granny_smithapplestatic_instance-variety-1galaapplestatic_instance-variety-2bluerayblueberrystatic_instance-variety-3collinsblueberrystatic_instance-variety-4behlcherimoyastatic_instance-variety-5boothcherimoyastatic_instance-fruit-0applestatic_instance-fruit-1blueberrystatic_instance-fruit-2cherimoyaappleblueberrycherimoya \ No newline at end of file From 2e3e5de9fe1c5e386fb6f64385eb84fff1167e58 Mon Sep 17 00:00:00 2001 From: Grzegorz Orczykowski Date: Thu, 29 Aug 2024 15:43:32 +0200 Subject: [PATCH 06/22] Removed redundant when_chooseAnswer_should_beVisibleInNextQuestion --- .../android/regression/FillBlankFormTest.java | 14 -- .../src/main/resources/forms/CalcTest.xml | 153 ------------------ 2 files changed, 167 deletions(-) delete mode 100644 test-forms/src/main/resources/forms/CalcTest.xml diff --git a/collect_app/src/androidTest/java/org/odk/collect/android/regression/FillBlankFormTest.java b/collect_app/src/androidTest/java/org/odk/collect/android/regression/FillBlankFormTest.java index 0d0d2f7e18b..f7e35727cf9 100644 --- a/collect_app/src/androidTest/java/org/odk/collect/android/regression/FillBlankFormTest.java +++ b/collect_app/src/androidTest/java/org/odk/collect/android/regression/FillBlankFormTest.java @@ -266,20 +266,6 @@ public void questions_shouldHavePrefilledValue() { .clickFinalize(); } - @Test - public void when_chooseAnswer_should_beVisibleInNextQuestion() { - //TestCase52 - rule.startAtMainMenu() - .copyForm("CalcTest.xml") - .startBlankFormWithRepeatGroup("CalcTest", "Fishing gear type") - .clickOnAdd(new FormEntryPage("CalcTest")) - .clickOnText("Gillnet") - .swipeToNextQuestion("7.2 What is the size of the mesh for the Gillnet ?", true) - .swipeToPreviousQuestion("7.1 Select the type of fishing equipment used today to catch the fish present", true) - .clickOnText("Seinenet") - .swipeToNextQuestion("7.2 What is the size of the mesh for the Seinenet ?", true); - } - private String getQuestionText() { FormFillingActivity formFillingActivity = (FormFillingActivity) ActivityHelpers.getActivity(); FrameLayout questionContainer = formFillingActivity.findViewById(R.id.text_container); diff --git a/test-forms/src/main/resources/forms/CalcTest.xml b/test-forms/src/main/resources/forms/CalcTest.xml deleted file mode 100644 index 09128cea486..00000000000 --- a/test-forms/src/main/resources/forms/CalcTest.xml +++ /dev/null @@ -1,153 +0,0 @@ - - - - CalcTest - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1 - - - - 2 - - - - - - - 1 - - - - 2 - - - - 3 - - - - 4 - - - - 5 - - - - 6 - - - - 7 - - - - 8 - - - - 9 - - - - 10 - - - - 11 - - - - 12 - - - - 13 - - - - 14 - - - - 15 - - - - 16 - - - - 17 - - - - - - - - - - - - - - - From 9b9ae80fa6a346f0a30f09367ea2dddb301a404f Mon Sep 17 00:00:00 2001 From: Grzegorz Orczykowski Date: Fri, 23 Feb 2024 17:57:52 +0100 Subject: [PATCH 07/22] Moved typeMismatchErrorMessage_shouldBeDisplayedWhenItOccurs to a separate class --- .../CatchFormCalculationExceptionsTest.kt | 29 ++ .../android/regression/FillBlankFormTest.java | 275 ------------------ 2 files changed, 29 insertions(+), 275 deletions(-) create mode 100644 collect_app/src/androidTest/java/org/odk/collect/android/feature/formentry/CatchFormCalculationExceptionsTest.kt delete mode 100644 collect_app/src/androidTest/java/org/odk/collect/android/regression/FillBlankFormTest.java diff --git a/collect_app/src/androidTest/java/org/odk/collect/android/feature/formentry/CatchFormCalculationExceptionsTest.kt b/collect_app/src/androidTest/java/org/odk/collect/android/feature/formentry/CatchFormCalculationExceptionsTest.kt new file mode 100644 index 00000000000..dfd803bf78c --- /dev/null +++ b/collect_app/src/androidTest/java/org/odk/collect/android/feature/formentry/CatchFormCalculationExceptionsTest.kt @@ -0,0 +1,29 @@ +package org.odk.collect.android.feature.formentry + +import androidx.test.ext.junit.runners.AndroidJUnit4 +import org.junit.Rule +import org.junit.Test +import org.junit.rules.RuleChain +import org.junit.runner.RunWith +import org.odk.collect.android.support.rules.CollectTestRule +import org.odk.collect.android.support.rules.TestRuleChain + +@RunWith(AndroidJUnit4::class) +class CatchFormCalculationExceptionsTest { + + private val rule = CollectTestRule() + + @get:Rule + val ruleChain: RuleChain = TestRuleChain.chain().around(rule) + + @Test + fun typeMismatchErrorMessage_shouldBeDisplayedWhenItOccurs() { + rule.startAtMainMenu() + .copyForm("validate.xml") + .startBlankForm("validate") + .longPressOnQuestion("year") + .removeResponse() + .swipeToNextQuestionWithError() + .checkIsTextDisplayedOnDialog("The value \"-01-01\" can't be converted to a date.") + } +} diff --git a/collect_app/src/androidTest/java/org/odk/collect/android/regression/FillBlankFormTest.java b/collect_app/src/androidTest/java/org/odk/collect/android/regression/FillBlankFormTest.java deleted file mode 100644 index f7e35727cf9..00000000000 --- a/collect_app/src/androidTest/java/org/odk/collect/android/regression/FillBlankFormTest.java +++ /dev/null @@ -1,275 +0,0 @@ -package org.odk.collect.android.regression; - -import static junit.framework.TestCase.assertNotSame; -import static java.util.Collections.singletonList; - -import android.widget.FrameLayout; -import android.widget.TextView; - -import androidx.test.ext.junit.runners.AndroidJUnit4; - -import org.junit.Rule; -import org.junit.Test; -import org.junit.rules.RuleChain; -import org.junit.runner.RunWith; -import org.odk.collect.android.R; -import org.odk.collect.android.activities.FormFillingActivity; -import org.odk.collect.android.support.ActivityHelpers; -import org.odk.collect.android.support.pages.FormEndPage; -import org.odk.collect.android.support.pages.FormEntryPage; -import org.odk.collect.android.support.pages.MainMenuPage; -import org.odk.collect.android.support.rules.CollectTestRule; -import org.odk.collect.android.support.rules.TestRuleChain; - -import java.util.ArrayList; -import java.util.List; - -//Issue NODK-244 -@RunWith(AndroidJUnit4.class) -public class FillBlankFormTest { - - public CollectTestRule rule = new CollectTestRule(); - - @Rule - public RuleChain copyFormChain = TestRuleChain.chain() - .around(rule); - - @Test - public void answers_ShouldBeSuggestedInComplianceWithSelectedLetters() { - //TestCase41 - rule.startAtMainMenu() - .copyForm("formulaire_adherent.xml", singletonList("espece.csv")) - .startBlankFormWithRepeatGroup("formulaire_adherent", "Ajouté une observation") - .clickOnAdd(new FormEntryPage("formulaire_adherent")) - .clickOnText("Plante") - .inputText("Abi") - .swipeToNextQuestion("Nom latin de l'espece", true) - .assertText("Abies") - .swipeToPreviousQuestion("Nom latin de l'espece - au moins 3 lettres", true) - .inputText("Abr") - .swipeToNextQuestion("Nom latin de l'espece", true) - .assertText("Abrotanum alpestre"); - } - - @Test - public void searchExpression_ShouldDisplayWhenItContainsOtherAppearanceName() { - //TestCase26 - // This form doesn't define an instanceID and also doesn't request encryption so this case - // would catch regressions for https://github.com/getodk/collect/issues/3340 - rule.startAtMainMenu() - .copyForm("CSVerrorForm.xml", singletonList("TrapLists.csv")) - .startBlankForm("CSV error Form") - .clickOnText("Greg Pommen") - .swipeToNextQuestion("* Select trap program:") - .clickOnText("Mountain pine beetle") - .swipeToNextQuestion("Pick Trap Name:") - .assertText("2018-COE-MPB-001 @ Wellington") - .swipeToPreviousQuestion("* Select trap program:") - .clickOnText("Invasive alien species") - .swipeToNextQuestion("Pick Trap Name:") - .assertText("2018-COE-IAS-e-001 @ Coronation") - .swipeToPreviousQuestion("* Select trap program:") - .clickOnText("Longhorn beetles") - .swipeToNextQuestion("Pick Trap Name:") - .assertText("2018-COE-LGH-M-001 @ Acheson") - .clickOnText("2018-COE-LGH-L-004 @ Acheson") - .swipeToNextQuestion("* Were there specimens in the trap:") - .clickOnText("No") - .swipeToNextQuestion("Any other notes?") - .swipeToEndScreen() - .clickFinalize() - .checkIsSnackbarWithMessageDisplayed(org.odk.collect.strings.R.string.form_saved); - } - - @Test - public void searchAppearance_ShouldDisplayWhenSearchAppearanceIsSpecified() { - //TestCase25 - rule.startAtMainMenu() - .copyForm("different-search-appearances.xml", singletonList("fruits.csv")) - .startBlankForm("different-search-appearances") - .clickOnText("Mango") - .swipeToNextQuestion("The fruit mango pulled from csv") - .assertText("The fruit mango pulled from csv") - .swipeToNextQuestion("Static select with no appearance") - .clickOnText("Wolf") - .swipeToNextQuestion("Static select with search appearance") - .inputText("w") - .closeSoftKeyboard() - .assertText("Wolf") - .assertText("Warthog") - .clickOnText("Wolf") - .swipeToNextQuestion("Static select with autocomplete appearance") - .inputText("r") - .closeSoftKeyboard() - .assertText("Warthog") - .assertText("Raccoon") - .assertText("Rabbit") - .closeSoftKeyboard() - .clickOnText("Rabbit") - .swipeToNextQuestion("Select from a CSV using search() appearance/function and search appearance") - .inputText("r") - .closeSoftKeyboard() - .assertText("Oranges") - .assertText("Strawberries") - .clickOnText("Oranges") - .swipeToNextQuestion("Select from a CSV using search() appearance/function and autocomplete appearance") - .inputText("n") - .closeSoftKeyboard() - .assertText("Mango") - .assertText("Oranges") - .clickOnText("Mango") - .swipeToNextQuestion("Select from a CSV using search() appearance/function") - .clickOnText("Mango") - .clickOnText("Strawberries") - .swipeToNextQuestion("Static select with no appearance") - .clickOnText("Raccoon") - .clickOnText("Rabbit") - .swipeToNextQuestion("Static select with search appearance") - .inputText("w") - .closeSoftKeyboard() - .assertText("Wolf") - .assertText("Warthog") - .clickOnText("Wolf") - .clickOnText("Warthog") - .swipeToNextQuestion("Static select with autocomplete appearance") - .inputText("r") - .closeSoftKeyboard() - .assertText("Warthog") - .assertText("Raccoon") - .assertText("Rabbit") - .clickOnText("Raccoon") - .clickOnText("Rabbit") - .swipeToNextQuestion("Select from a CSV using search() appearance/function and search appearance") - .inputText("m") - .closeSoftKeyboard() - .assertText("Mango") - .clickOnText("Mango") - .swipeToNextQuestion("Select from a CSV using search() appearance/function and autocomplete appearance") - .inputText("n") - .closeSoftKeyboard() - .closeSoftKeyboard() - .assertText("Mango") - .assertText("Oranges") - .clickOnText("Mango") - .clickOnText("Oranges") - .swipeToEndScreen() - .clickFinalize() - .checkIsSnackbarWithMessageDisplayed(org.odk.collect.strings.R.string.form_saved); - } - - @Test - public void values_ShouldBeRandom() { - rule.startAtMainMenu() - .copyForm("random.xml") - .copyForm("randomTest_broken.xml"); - - //TestCase22 - List firstQuestionAnswers = new ArrayList<>(); - List secondQuestionAnswers = new ArrayList<>(); - - for (int i = 1; i <= 3; i++) { - FormEntryPage formEntryPage = new MainMenuPage().startBlankForm("random"); - firstQuestionAnswers.add(getQuestionText()); - formEntryPage.swipeToNextQuestion("Your random once value:"); - secondQuestionAnswers.add(getQuestionText()); - formEntryPage.swipeToEndScreen().clickFinalize(); - } - - assertNotSame(firstQuestionAnswers.get(0), firstQuestionAnswers.get(1)); - assertNotSame(firstQuestionAnswers.get(0), firstQuestionAnswers.get(2)); - assertNotSame(firstQuestionAnswers.get(1), firstQuestionAnswers.get(2)); - - assertNotSame(secondQuestionAnswers.get(0), secondQuestionAnswers.get(1)); - assertNotSame(secondQuestionAnswers.get(0), secondQuestionAnswers.get(2)); - assertNotSame(secondQuestionAnswers.get(1), secondQuestionAnswers.get(2)); - - firstQuestionAnswers.clear(); - - for (int i = 1; i <= 3; i++) { - FormEntryPage formEntryPage = new MainMenuPage().startBlankForm("random test"); - formEntryPage.inputText("3"); - formEntryPage.swipeToNextQuestion("Your random number was"); - firstQuestionAnswers.add(getQuestionText()); - formEntryPage.swipeToEndScreen().clickFinalize(); - } - - assertNotSame(firstQuestionAnswers.get(0), firstQuestionAnswers.get(1)); - assertNotSame(firstQuestionAnswers.get(0), firstQuestionAnswers.get(2)); - assertNotSame(firstQuestionAnswers.get(1), firstQuestionAnswers.get(2)); - } - - @Test - public void typeMismatchErrorMessage_shouldBeDisplayed() { - //TestCase48 - rule.startAtMainMenu() - .copyForm("validate.xml") - .startBlankForm("validate") - .longPressOnQuestion("year") - .removeResponse() - .swipeToNextQuestionWithError(false) - .checkIsTextDisplayedOnDialog("The value \"-01-01\" can't be converted to a date."); - } - - @Test - public void answers_shouldBeAutoFilled() { - //TestCase50 - rule.startAtMainMenu() - .copyForm("event-odk-new-repeat.xml") - .startBlankForm("Event: odk-new-repeat") - .inputText("3") - .swipeToNextQuestionWithRepeatGroup("null") - .clickOnAdd(new FormEntryPage("Event: odk-new-repeat")) - .assertText("1") - .swipeToNextQuestion("B value") - .assertText("5") - .swipeToNextQuestionWithRepeatGroup("null") - .clickOnAdd(new FormEntryPage("Event: odk-new-repeat")) - .assertText("2") - .swipeToNextQuestion("B value") - .assertText("5") - .swipeToNextQuestionWithRepeatGroup("null") - .clickOnAdd(new FormEntryPage("Event: odk-new-repeat")) - .assertText("3") - .swipeToNextQuestion("B value") - .assertText("5") - .swipeToNextQuestionWithRepeatGroup("null") - .clickOnAdd(new FormEntryPage("Event: odk-new-repeat")) - .assertText("4") - .swipeToNextQuestion("B value") - .assertText("5") - .swipeToNextQuestionWithRepeatGroup("null") - .clickOnDoNotAdd(new FormEntryPage("Event: odk-new-repeat")) - .inputText("2") - .swipeToNextQuestion("A value") - .assertText("1") - .swipeToNextQuestion("A value") - .assertText("2") - .swipeToNextQuestion("C value") - .swipeToNextQuestion("C value") - .swipeToNextQuestionWithRepeatGroup("null") - .clickOnDoNotAdd(new FormEndPage("Event: odk-new-repeat")) - .clickFinalize(); - } - - @Test - public void questions_shouldHavePrefilledValue() { - //TestCase51 - rule.startAtMainMenu() - .copyForm("multiple-events.xml") - .startBlankForm("Space-separated event list") - .assertText("cheese") - .swipeToNextQuestion("First load group") - .assertText("more cheese") - .swipeToNextQuestion("My value") - .assertText("5") - .swipeToEndScreen() - .clickFinalize(); - } - - private String getQuestionText() { - FormFillingActivity formFillingActivity = (FormFillingActivity) ActivityHelpers.getActivity(); - FrameLayout questionContainer = formFillingActivity.findViewById(R.id.text_container); - TextView questionView = (TextView) questionContainer.getChildAt(0); - return questionView.getText().toString(); - } -} From 379db294a6da99b3f9c66aa5287f6d862d986d73 Mon Sep 17 00:00:00 2001 From: Grzegorz Orczykowski Date: Thu, 29 Aug 2024 15:45:18 +0200 Subject: [PATCH 08/22] Removed redundant questions_shouldHavePrefilledValue --- .../main/resources/forms/multiple-events.xml | 42 ------------------- 1 file changed, 42 deletions(-) delete mode 100644 test-forms/src/main/resources/forms/multiple-events.xml diff --git a/test-forms/src/main/resources/forms/multiple-events.xml b/test-forms/src/main/resources/forms/multiple-events.xml deleted file mode 100644 index 9fb8e0c4244..00000000000 --- a/test-forms/src/main/resources/forms/multiple-events.xml +++ /dev/null @@ -1,42 +0,0 @@ - - - Space-separated event list - - - - - - - - - - 5 - - - - - - - - - - - - - - cheese - - - - - - more cheese - - - - - - - - - From 9244e28f1ed8e4b9e9033314b1aca4c0837903be Mon Sep 17 00:00:00 2001 From: Grzegorz Orczykowski Date: Thu, 29 Aug 2024 15:46:34 +0200 Subject: [PATCH 09/22] Removed redundant answers_shouldBeAutoFilled --- .../resources/forms/event-odk-new-repeat.xml | 85 ------------------- 1 file changed, 85 deletions(-) delete mode 100644 test-forms/src/main/resources/forms/event-odk-new-repeat.xml diff --git a/test-forms/src/main/resources/forms/event-odk-new-repeat.xml b/test-forms/src/main/resources/forms/event-odk-new-repeat.xml deleted file mode 100644 index a32ceac09e0..00000000000 --- a/test-forms/src/main/resources/forms/event-odk-new-repeat.xml +++ /dev/null @@ -1,85 +0,0 @@ - - - Event: odk-new-repeat - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 2 - - - - - - From 3597098a35bb43a85153f845aedccd699c4651c2 Mon Sep 17 00:00:00 2001 From: Grzegorz Orczykowski Date: Fri, 23 Feb 2024 18:15:13 +0100 Subject: [PATCH 10/22] Moved values_ShouldBeRandom to a separate class --- .../feature/formentry/FormCalculationsTest.kt | 69 +++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 collect_app/src/androidTest/java/org/odk/collect/android/feature/formentry/FormCalculationsTest.kt diff --git a/collect_app/src/androidTest/java/org/odk/collect/android/feature/formentry/FormCalculationsTest.kt b/collect_app/src/androidTest/java/org/odk/collect/android/feature/formentry/FormCalculationsTest.kt new file mode 100644 index 00000000000..b0122154846 --- /dev/null +++ b/collect_app/src/androidTest/java/org/odk/collect/android/feature/formentry/FormCalculationsTest.kt @@ -0,0 +1,69 @@ +package org.odk.collect.android.feature.formentry + +import android.widget.FrameLayout +import android.widget.TextView +import androidx.test.ext.junit.runners.AndroidJUnit4 +import junit.framework.TestCase.assertNotSame +import org.junit.Rule +import org.junit.Test +import org.junit.rules.RuleChain +import org.junit.runner.RunWith +import org.odk.collect.android.activities.FormFillingActivity +import org.odk.collect.android.support.ActivityHelpers +import org.odk.collect.android.support.pages.MainMenuPage +import org.odk.collect.android.support.rules.CollectTestRule +import org.odk.collect.android.support.rules.TestRuleChain + +@RunWith(AndroidJUnit4::class) +class FormCalculationsTest { + private val rule = CollectTestRule() + + @get:Rule + val ruleChain: RuleChain = TestRuleChain.chain() + .around(rule) + + @Test + fun randomFunction_ShouldWorkCorrectly() { + rule.startAtMainMenu() + .copyForm("random.xml") + .copyForm("randomTest_broken.xml") + + val firstQuestionAnswers: MutableList = ArrayList() + val secondQuestionAnswers: MutableList = ArrayList() + for (i in 1..3) { + val formEntryPage = MainMenuPage().startBlankForm("random") + firstQuestionAnswers.add(getQuestionText()) + formEntryPage.swipeToNextQuestion("Your random once value:") + secondQuestionAnswers.add(getQuestionText()) + formEntryPage.swipeToEndScreen().clickFinalize() + } + + assertNotSame(firstQuestionAnswers[0], firstQuestionAnswers[1]) + assertNotSame(firstQuestionAnswers[0], firstQuestionAnswers[2]) + assertNotSame(firstQuestionAnswers[1], firstQuestionAnswers[2]) + assertNotSame(secondQuestionAnswers[0], secondQuestionAnswers[1]) + assertNotSame(secondQuestionAnswers[0], secondQuestionAnswers[2]) + assertNotSame(secondQuestionAnswers[1], secondQuestionAnswers[2]) + + firstQuestionAnswers.clear() + + for (i in 1..3) { + val formEntryPage = MainMenuPage().startBlankForm("random test") + formEntryPage.inputText("3") + formEntryPage.swipeToNextQuestion("Your random number was") + firstQuestionAnswers.add(getQuestionText()) + formEntryPage.swipeToEndScreen().clickFinalize() + } + + assertNotSame(firstQuestionAnswers[0], firstQuestionAnswers[1]) + assertNotSame(firstQuestionAnswers[0], firstQuestionAnswers[2]) + assertNotSame(firstQuestionAnswers[1], firstQuestionAnswers[2]) + } + + private fun getQuestionText(): String { + val formFillingActivity = ActivityHelpers.getActivity() as FormFillingActivity + val questionContainer = formFillingActivity.findViewById(R.id.text_container) + val questionView = questionContainer.getChildAt(0) as TextView + return questionView.text.toString() + } +} From fe647b07d30b910da15c88bee43ff9ba4169896f Mon Sep 17 00:00:00 2001 From: Grzegorz Orczykowski Date: Fri, 23 Feb 2024 18:16:55 +0100 Subject: [PATCH 11/22] Moved searchAppearance_ShouldDisplayWhenSearchAppearanceIsSpecified to a separate class --- .../feature/formentry/FormAppearancesTest.kt | 93 +++++++++++++++++++ .../feature/formentry/FormCalculationsTest.kt | 7 +- 2 files changed, 96 insertions(+), 4 deletions(-) create mode 100644 collect_app/src/androidTest/java/org/odk/collect/android/feature/formentry/FormAppearancesTest.kt diff --git a/collect_app/src/androidTest/java/org/odk/collect/android/feature/formentry/FormAppearancesTest.kt b/collect_app/src/androidTest/java/org/odk/collect/android/feature/formentry/FormAppearancesTest.kt new file mode 100644 index 00000000000..6d62a2c16ee --- /dev/null +++ b/collect_app/src/androidTest/java/org/odk/collect/android/feature/formentry/FormAppearancesTest.kt @@ -0,0 +1,93 @@ +package org.odk.collect.android.feature.formentry + +import androidx.test.ext.junit.runners.AndroidJUnit4 +import org.junit.Rule +import org.junit.Test +import org.junit.rules.RuleChain +import org.junit.runner.RunWith +import org.odk.collect.android.support.rules.CollectTestRule +import org.odk.collect.android.support.rules.TestRuleChain +import org.odk.collect.strings.R + +@RunWith(AndroidJUnit4::class) +class FormAppearancesTest { + private val rule = CollectTestRule() + + @get:Rule + val ruleChain: RuleChain = TestRuleChain.chain().around(rule) + + @Test + fun searchAppearance_ShouldDisplayWhenSearchAppearanceIsSpecified() { + rule.startAtMainMenu() + .copyForm("different-search-appearances.xml", listOf("fruits.csv")) + .startBlankForm("different-search-appearances") + .clickOnText("Mango") + .swipeToNextQuestion("The fruit mango pulled from csv") + .assertText("The fruit mango pulled from csv") + .swipeToNextQuestion("Static select with no appearance") + .clickOnText("Wolf") + .swipeToNextQuestion("Static select with search appearance") + .inputText("w") + .closeSoftKeyboard() + .assertText("Wolf") + .assertText("Warthog") + .clickOnText("Wolf") + .swipeToNextQuestion("Static select with autocomplete appearance") + .inputText("r") + .closeSoftKeyboard() + .assertText("Warthog") + .assertText("Raccoon") + .assertText("Rabbit") + .closeSoftKeyboard() + .clickOnText("Rabbit") + .swipeToNextQuestion("Select from a CSV using search() appearance/function and search appearance") + .inputText("r") + .closeSoftKeyboard() + .assertText("Oranges") + .assertText("Strawberries") + .clickOnText("Oranges") + .swipeToNextQuestion("Select from a CSV using search() appearance/function and autocomplete appearance") + .inputText("n") + .closeSoftKeyboard() + .assertText("Mango") + .assertText("Oranges") + .clickOnText("Mango") + .swipeToNextQuestion("Select from a CSV using search() appearance/function") + .clickOnText("Mango") + .clickOnText("Strawberries") + .swipeToNextQuestion("Static select with no appearance") + .clickOnText("Raccoon") + .clickOnText("Rabbit") + .swipeToNextQuestion("Static select with search appearance") + .inputText("w") + .closeSoftKeyboard() + .assertText("Wolf") + .assertText("Warthog") + .clickOnText("Wolf") + .clickOnText("Warthog") + .swipeToNextQuestion("Static select with autocomplete appearance") + .inputText("r") + .closeSoftKeyboard() + .assertText("Warthog") + .assertText("Raccoon") + .assertText("Rabbit") + .clickOnText("Raccoon") + .clickOnText("Rabbit") + .swipeToNextQuestion("Select from a CSV using search() appearance/function and search appearance") + .inputText("m") + .closeSoftKeyboard() + .assertText("Mango") + .clickOnText("Mango") + .swipeToNextQuestion("Select from a CSV using search() appearance/function and autocomplete appearance") + .inputText("n") + .closeSoftKeyboard() + .closeSoftKeyboard() + .assertText("Mango") + .assertText("Oranges") + .clickOnText("Mango") + .clickOnText("Oranges") + .swipeToEndScreen() + .clickFinalize() + .checkIsSnackbarWithMessageDisplayed(R.string.form_saved) + } +} diff --git a/collect_app/src/androidTest/java/org/odk/collect/android/feature/formentry/FormCalculationsTest.kt b/collect_app/src/androidTest/java/org/odk/collect/android/feature/formentry/FormCalculationsTest.kt index b0122154846..4210f78b1db 100644 --- a/collect_app/src/androidTest/java/org/odk/collect/android/feature/formentry/FormCalculationsTest.kt +++ b/collect_app/src/androidTest/java/org/odk/collect/android/feature/formentry/FormCalculationsTest.kt @@ -19,14 +19,13 @@ class FormCalculationsTest { private val rule = CollectTestRule() @get:Rule - val ruleChain: RuleChain = TestRuleChain.chain() - .around(rule) + val ruleChain: RuleChain = TestRuleChain.chain().around(rule) @Test fun randomFunction_ShouldWorkCorrectly() { rule.startAtMainMenu() - .copyForm("random.xml") - .copyForm("randomTest_broken.xml") + .copyForm("random.xml") + .copyForm("randomTest_broken.xml") val firstQuestionAnswers: MutableList = ArrayList() val secondQuestionAnswers: MutableList = ArrayList() From 9fb95a09adb0979a3dbef9df2ab1f1c777a41748 Mon Sep 17 00:00:00 2001 From: Grzegorz Orczykowski Date: Thu, 29 Aug 2024 15:49:00 +0200 Subject: [PATCH 12/22] Removed redundant answers_ShouldBeSuggestedInComplianceWithSelectedLetters --- .../resources/forms/formulaire_adherent.xml | 192 ------------- .../src/main/resources/media/espece.csv | 268 ------------------ 2 files changed, 460 deletions(-) delete mode 100644 test-forms/src/main/resources/forms/formulaire_adherent.xml delete mode 100644 test-forms/src/main/resources/media/espece.csv diff --git a/test-forms/src/main/resources/forms/formulaire_adherent.xml b/test-forms/src/main/resources/forms/formulaire_adherent.xml deleted file mode 100644 index 3dbfacb6f0a..00000000000 --- a/test-forms/src/main/resources/forms/formulaire_adherent.xml +++ /dev/null @@ -1,192 +0,0 @@ - - - - formulaire_adherent - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Plantae - - - - Animalia - - - - Fungi - - - - - - - - - - cd_nom - - - - - necessite une connexion internet - - - - - - - - juvenile - - - - adulte - - - - indetermine - - - - - - - male - - - - femelle - - - - indetermine - - - - - - - - - - - oui - - - - non - - - - - - - - - - optionel - - - - optionel - - - - - - - - - - - - carte - - - - gps - - - - - - - - - - - - votre adresse mail cen lr - - - - - diff --git a/test-forms/src/main/resources/media/espece.csv b/test-forms/src/main/resources/media/espece.csv deleted file mode 100644 index cbb438f8f28..00000000000 --- a/test-forms/src/main/resources/media/espece.csv +++ /dev/null @@ -1,268 +0,0 @@ -"cd_nom","lb_nom_key","lb_nom_cd_key","regne" -"188659","Aaptos","Aaptos{188659}","Animalia" -"70971","Aaptos aaptos","Aaptos aaptos{70971}","Animalia" -"549734","Aaptos adriatica","Aaptos adriatica{549734}","Animalia" -"70972","Aaptos papillata","Aaptos papillata{70972}","Animalia" -"359644","Aaptos papillatus","Aaptos papillatus{359644}","Animalia" -"606842","Aaronsohnia","Aaronsohnia{606842}","Plantae" -"201833","Abacarus","Abacarus{201833}","Animalia" -"221232","Abacarus hystrix","Abacarus hystrix{221232}","Animalia" -"188660","Abacetus","Abacetus{188660}","Animalia" -"9069","Abacetus salzmanni","Abacetus salzmanni{9069}","Animalia" -"414864","Abacobia carbonella","Abacobia carbonella{414864}","Animalia" -"584762","Abacola holothuriae","Abacola holothuriae{584762}","Animalia" -"202360","Abacoproeces","Abacoproeces{202360}","Animalia" -"233451","Abacoproeces saltuum","Abacoproeces saltuum{233451}","Animalia" -"79313","Abacosa dumetorum","Abacosa dumetorum{79313}","Plantae" -"79314","Abacosa onobrychioides","Abacosa onobrychioides{79314}","Plantae" -"68550","Abadèche boulotte","Abadèche boulotte{68550}","Animalia" -"79315","Abama ossifraga","Abama ossifraga{79315}","Plantae" -"354978","Abarenicola","Abarenicola{354978}","Animalia" -"371817","Abarenicola claparedei","Abarenicola claparedei{371817}","Animalia" -"531330","Abarenicola claparedi","Abarenicola claparedi{531330}","Animalia" -"566620","Abarenicola claparedii","Abarenicola claparedii{566620}","Animalia" -"79316","Abasicarpon patulum","Abasicarpon patulum{79316}","Plantae" -"200975","Abasola","Abasola{200975}","Animalia" -"337053","Abasola sarea","Abasola sarea{337053}","Animalia" -"392181","Abastus macquarti","Abastus macquarti{392181}","Animalia" -"816","Abasula sarea","Abasula sarea{816}","Animalia" -"188661","Abax","Abax{188661}","Animalia" -"222609","Abax carinatus","Abax carinatus{222609}","Animalia" -"251022","Abax carinatus carinatus","Abax carinatus carinatus{251022}","Animalia" -"395789","Abax carpathicus","Abax carpathicus{395789}","Animalia" -"395772","Abax ellipticus","Abax ellipticus{395772}","Animalia" -"395773","Abax lippizanus","Abax lippizanus{395773}","Animalia" -"395785","Abax magnicollis","Abax magnicollis{395785}","Animalia" -"395784","Abax montserratensis","Abax montserratensis{395784}","Animalia" -"395674","Abaxodes dejeanii","Abaxodes dejeanii{395674}","Animalia" -"9157","Abax ovalis","Abax ovalis{9157}","Animalia" -"222607","Abax parallelepipedus","Abax parallelepipedus{222607}","Animalia" -"251018","Abax parallelepipedus contractus","Abax parallelepipedus contractus{251018}","Animalia" -"251019","Abax parallelepipedus parallelepipedus","Abax parallelepipedus parallelepipedus{251019}","Animalia" -"9158","Abax parallelus","Abax parallelus{9158}","Animalia" -"251020","Abax parallelus parallelus","Abax parallelus parallelus{251020}","Animalia" -"395779","Abax podolicus","Abax podolicus{395779}","Animalia" -"222608","Abax pyrenaeus","Abax pyrenaeus{222608}","Animalia" -"251021","Abax pyrenaeus pyrenaeus","Abax pyrenaeus pyrenaeus{251021}","Animalia" -"395783","Abax sexualis","Abax sexualis{395783}","Animalia" -"396811","Abbotia georgiana","Abbotia georgiana{396811}","Animalia" -"79317","Abbotia palustris","Abbotia palustris{79317}","Plantae" -"396814","Abbotia paykulliana","Abbotia paykulliana{396814}","Animalia" -"79318","Abbotia pumila","Abbotia pumila{79318}","Plantae" -"188662","Abdera","Abdera{188662}","Animalia" -"223972","Abdera affinis","Abdera affinis{223972}","Animalia" -"223969","Abdera bifasciata","Abdera bifasciata{223969}","Animalia" -"397289","Abdera bifasciata","Abdera bifasciata{397289}","Animalia" -"12064","Abdera biflexuosa","Abdera biflexuosa{12064}","Animalia" -"223973","Abdera flexuosa","Abdera flexuosa{223973}","Animalia" -"397294","Abdera picea","Abdera picea{397294}","Animalia" -"223970","Abdera quadrifasciata","Abdera quadrifasciata{223970}","Animalia" -"397296","Abdera scutellaris","Abdera scutellaris{397296}","Animalia" -"397297","Abdera suturalis","Abdera suturalis{397297}","Animalia" -"397292","Abdera undata","Abdera undata{397292}","Animalia" -"239523","Abeille domestique, Abeille européenne","Abeille domestique, Abeille européenne{239523}","Animalia" -"205435","Abemus","Abemus{205435}","Animalia" -"243189","Abemus chloropterus","Abemus chloropterus{243189}","Animalia" -"443431","Aberranta","Aberranta{443431}","Animalia" -"443454","Aberranta banyulensis","Aberranta banyulensis{443454}","Animalia" -"443430","Aberrantidae","Aberrantidae{443430}","Animalia" -"437684","Abgrallaspis","Abgrallaspis{437684}","Animalia" -"188663","Abia","Abia{188663}","Animalia" -"231777","Abia aenea","Abia aenea{231777}","Animalia" -"231778","Abia aurulenta","Abia aurulenta{231778}","Animalia" -"401286","Abia bifida","Abia bifida{401286}","Animalia" -"401287","Abia bigens","Abia bigens{401287}","Animalia" -"52419","Abia candens","Abia candens{52419}","Animalia" -"231779","Abia fasciata","Abia fasciata{231779}","Animalia" -"231780","Abia fulgens","Abia fulgens{231780}","Animalia" -"231781","Abia lonicerae","Abia lonicerae{231781}","Animalia" -"231782","Abia mutica","Abia mutica{231782}","Animalia" -"401288","Abia plana","Abia plana{401288}","Animalia" -"52420","Abia sericea","Abia sericea{52420}","Animalia" -"188664","Abida","Abida{188664}","Animalia" -"162995","Abida bigerrensis","Abida bigerrensis{162995}","Animalia" -"162992","Abida cylindrica","Abida cylindrica{162992}","Animalia" -"162994","Abida escudiei","Abida escudiei{162994}","Animalia" -"200240","Abida gittenbergeri","Abida gittenbergeri{200240}","Animalia" -"412818","Abida monsjovica","Abida monsjovica{412818}","Animalia" -"162993","Abida partioti","Abida partioti{162993}","Animalia" -"162996","Abida polyodon","Abida polyodon{162996}","Animalia" -"199831","Abida pyrenaearia","Abida pyrenaearia{199831}","Animalia" -"162989","Abida pyrenaearia pyrenaearia","Abida pyrenaearia pyrenaearia{162989}","Animalia" -"199830","Abida secale","Abida secale{199830}","Animalia" -"162987","Abida secale affinis","Abida secale affinis{162987}","Animalia" -"162984","Abida secale secale","Abida secale secale{162984}","Animalia" -"412822","Abida vidali","Abida vidali{412822}","Animalia" -"188665","Abies","Abies{188665}","Plantae" -"79319","Abies alba","Abies alba{79319}","Plantae" -"130692","Abies alba subsp. alba","Abies alba subsp. alba{130692}","Plantae" -"79321","Abies alpestris","Abies alpestris{79321}","Plantae" -"79326","Abies cinerea","Abies cinerea{79326}","Plantae" -"79330","Abies excelsa","Abies excelsa{79330}","Plantae" -"79338","Abies larix","Abies larix{79338}","Plantae" -"79340","Abies medioxima","Abies medioxima{79340}","Plantae" -"79347","Abies pectinata","Abies pectinata{79347}","Plantae" -"79348","Abies picea","Abies picea{79348}","Plantae" -"79351","Abies taxifolia","Abies taxifolia{79351}","Plantae" -"717045","Abies x borisii-regis","Abies x borisii-regis{717045}","Plantae" -"187208","Abietaceae","Abietaceae{187208}","Plantae" -"188666","Abietinaria","Abietinaria{188666}","Animalia" -"7259","Abietinaria abietina","Abietinaria abietina{7259}","Animalia" -"553874","Abietinaria costata","Abietinaria costata{553874}","Animalia" -"359645","Abietinaria filicula","Abietinaria filicula{359645}","Animalia" -"433851","Abietinella","Abietinella{433851}","Plantae" -"5422","Abietinella abietina","Abietinella abietina{5422}","Plantae" -"434642","Abietinella abietina var. abietina","Abietinella abietina var. abietina{434642}","Plantae" -"79355","Abiga cistifolia","Abiga cistifolia{79355}","Plantae" -"549735","Abila freyerii","Abila freyerii{549735}","Animalia" -"188667","Ablabesmyia","Ablabesmyia{188667}","Animalia" -"414712","Ablabesmyia bipunctella","Ablabesmyia bipunctella{414712}","Animalia" -"414720","Ablabesmyia connectens","Ablabesmyia connectens{414720}","Animalia" -"414713","Ablabesmyia debeauchampi","Ablabesmyia debeauchampi{414713}","Animalia" -"414681","Ablabesmyia hieroglyphica","Ablabesmyia hieroglyphica{414681}","Animalia" -"245134","Ablabesmyia longistyla","Ablabesmyia longistyla{245134}","Animalia" -"20011","Ablabesmyia monilis","Ablabesmyia monilis{20011}","Animalia" -"414721","Ablabesmyia pecteniphora","Ablabesmyia pecteniphora{414721}","Animalia" -"20012","Ablabesmyia phatta","Ablabesmyia phatta{20012}","Animalia" -"414716","Ablabesmyia sexannulata","Ablabesmyia sexannulata{414716}","Animalia" -"414678","Ablabesmyia verbekei","Ablabesmyia verbekei{414678}","Animalia" -"188668","Ablattaria","Ablattaria{188668}","Animalia" -"403095","Ablattaria costulata","Ablattaria costulata{403095}","Animalia" -"403096","Ablattaria distinguenda","Ablattaria distinguenda{403096}","Animalia" -"10362","Ablattaria laevigata","Ablattaria laevigata{10362}","Animalia" -"403098","Ablattaria meridionalis","Ablattaria meridionalis{403098}","Animalia" -"403100","Ablattaria punctata","Ablattaria punctata{403100}","Animalia" -"208654","Ablaxia","Ablaxia{208654}","Animalia" -"218810","Ablaxia parviclava","Ablaxia parviclava{218810}","Animalia" -"208199","Ablerus","Ablerus{208199}","Animalia" -"217956","Ablerus atomon","Ablerus atomon{217956}","Animalia" -"389798","Ablerus brittanicus","Ablerus brittanicus{389798}","Animalia" -"217957","Ablerus celsus","Ablerus celsus{217957}","Animalia" -"217958","Ablerus clisiocampae","Ablerus clisiocampae{217958}","Animalia" -"217959","Ablerus marchali","Ablerus marchali{217959}","Animalia" -"217960","Ablerus matritensis","Ablerus matritensis{217960}","Animalia" -"217962","Ablerus pinifoliae","Ablerus pinifoliae{217962}","Animalia" -"217963","Ablerus pulcherrimus","Ablerus pulcherrimus{217963}","Animalia" -"67111","Ablette","Ablette{67111}","Animalia" -"352735","Abludomelita","Abludomelita{352735}","Animalia" -"366464","Abludomelita aculeata","Abludomelita aculeata{366464}","Animalia" -"366465","Abludomelita gladiosa","Abludomelita gladiosa{366465}","Animalia" -"366466","Abludomelita obtusata","Abludomelita obtusata{366466}","Animalia" -"188671","Abortiporus","Abortiporus{188671}","Fungi" -"41255","Abortiporus biennis","Abortiporus biennis{41255}","Fungi" -"509654","Abortiporus borealis","Abortiporus borealis{509654}","Fungi" -"41259","Abortiporus fractipes","Abortiporus fractipes{41259}","Fungi" -"520289","Abortiporus wynnei","Abortiporus wynnei{520289}","Fungi" -"575868","Abothrium hermaphroductus","Abothrium hermaphroductus{575868}","Animalia" -"575869","Abothrium infundibuliformis","Abothrium infundibuliformis{575869}","Animalia" -"575870","Abothrium longissimum","Abothrium longissimum{575870}","Animalia" -"188672","Abra","Abra{188672}","Animalia" -"552344","Abra abra","Abra abra{552344}","Animalia" -"64610","Abra alba","Abra alba{64610}","Animalia" -"205666","Abrachyglossum","Abrachyglossum{205666}","Animalia" -"389274","Abrachyglossum andrei","Abrachyglossum andrei{389274}","Animalia" -"216735","Abrachyglossum capitatum","Abrachyglossum capitatum{216735}","Animalia" -"204914","Abraeus","Abraeus{204914}","Animalia" -"396750","Abraeus brevissimus","Abraeus brevissimus{396750}","Animalia" -"223562","Abraeus granulum","Abraeus granulum{223562}","Animalia" -"396748","Abraeus parvululus","Abraeus parvululus{396748}","Animalia" -"223563","Abraeus parvulus","Abraeus parvulus{223563}","Animalia" -"223564","Abraeus perpusillus","Abraeus perpusillus{223564}","Animalia" -"396747","Abraeus punctatissimus","Abraeus punctatissimus{396747}","Animalia" -"223565","Abraeus roubali","Abraeus roubali{223565}","Animalia" -"396767","Abraeus seminulum","Abraeus seminulum{396767}","Animalia" -"545694","Abra fragilis","Abra fragilis{545694}","Animalia" -"545555","Abra intermedia","Abra intermedia{545555}","Animalia" -"555199","Abralia pfefferi","Abralia pfefferi{555199}","Animalia" -"358627","Abraliopsis","Abraliopsis{358627}","Animalia" -"542420","Abraliopsis morisii","Abraliopsis morisii{542420}","Animalia" -"381423","Abraliopsis pfefferi","Abraliopsis pfefferi{381423}","Animalia" -"679188","Abra longicallis","Abra longicallis{679188}","Animalia" -"576953","Abra longicallis var. americana","Abra longicallis var. americana{576953}","Animalia" -"460571","Abra longicallus","Abra longicallus{460571}","Animalia" -"359649","Abra longicallus","Abra longicallus{359649}","Animalia" -"546460","Abra longicallus americana","Abra longicallus americana{546460}","Animalia" -"571175","Abra milaschevichi","Abra milaschevichi{571175}","Animalia" -"188673","Abramis","Abramis{188673}","Animalia" -"561660","Abramis alburnus","Abramis alburnus{561660}","Animalia" -"561661","Abramis argyreus","Abramis argyreus{561661}","Animalia" -"561662","Abramis bipunctatus","Abramis bipunctatus{561662}","Animalia" -"423074","Abramis bjoerkna","Abramis bjoerkna{423074}","Animalia" -"579723","Abramis björkna","Abramis björkna{579723}","Animalia" -"561663","Abramis blicca","Abramis blicca{561663}","Animalia" -"67074","Abramis brama","Abramis brama{67074}","Animalia" -"564954","Abramis brama bergi","Abramis brama bergi{564954}","Animalia" -"564955","Abramis brama danubii","Abramis brama danubii{564955}","Animalia" -"564956","Abramis brama orientalis","Abramis brama orientalis{564956}","Animalia" -"564957","Abramis brama sinegorensis","Abramis brama sinegorensis{564957}","Animalia" -"561664","Abramis erythropterus","Abramis erythropterus{561664}","Animalia" -"561666","Abramis gehini","Abramis gehini{561666}","Animalia" -"561667","Abramis media","Abramis media{561667}","Animalia" -"561668","Abramis melaenus","Abramis melaenus{561668}","Animalia" -"561669","Abramis microlepidotus","Abramis microlepidotus{561669}","Animalia" -"561670","Abramis micropteryx","Abramis micropteryx{561670}","Animalia" -"561673","Abramis vetula","Abramis vetula{561673}","Animalia" -"561674","Abramis vulgaris","Abramis vulgaris{561674}","Animalia" -"64613","Abra nitida","Abra nitida{64613}","Animalia" -"64614","Abra ovata","Abra ovata{64614}","Animalia" -"64611","Abra prismatica","Abra prismatica{64611}","Animalia" -"571177","Abra segmentina","Abra segmentina{571177}","Animalia" -"359650","Abra segmentum","Abra segmentum{359650}","Animalia" -"64612","Abra tenuis","Abra tenuis{64612}","Animalia" -"210517","Abraxas","Abraxas{210517}","Animalia" -"784044","Abraxas adustata","Abraxas adustata{784044}","Animalia" -"248830","Abraxas grossulariata","Abraxas grossulariata{248830}","Animalia" -"248832","Abraxas pantaria","Abraxas pantaria{248832}","Animalia" -"248831","Abraxas sylvata","Abraxas sylvata{248831}","Animalia" -"774727","Abraxas ulmata","Abraxas ulmata{774727}","Animalia" -"188674","Abrochtha","Abrochtha{188674}","Animalia" -"78182","Abrochtha intermedia","Abrochtha intermedia{78182}","Animalia" -"201622","Abrolophus","Abrolophus{201622}","Animalia" -"220944","Abrolophus miniatus","Abrolophus miniatus{220944}","Animalia" -"220945","Abrolophus rubipes","Abrolophus rubipes{220945}","Animalia" -"249394","Abromiade brune (L')","Abromiade brune (L'){249394}","Animalia" -"249404","Abromiade dauphinoise (L')","Abromiade dauphinoise (L'){249404}","Animalia" -"249391","Abromiade de la Molinie (L')","Abromiade de la Molinie (L'){249391}","Animalia" -"345744","Abromiade des steppes (L')","Abromiade des steppes (L'){345744}","Animalia" -"249401","Abromiade du Millet (L')","Abromiade du Millet (L'){249401}","Animalia" -"249392","Abromiade latéritique (L')","Abromiade latéritique (L'){249392}","Animalia" -"249395","Abromiade lustrée (L')","Abromiade lustrée (L'){249395}","Animalia" -"249388","Abromiade ochracée (L')","Abromiade ochracée (L'){249388}","Animalia" -"249397","Abromiade platinée (L')","Abromiade platinée (L'){249397}","Animalia" -"249396","Abromiade rubrirène (L')","Abromiade rubrirène (L'){249396}","Animalia" -"249393","Abromiade ténébreuse (L')","Abromiade ténébreuse (L'){249393}","Animalia" -"520867","Abromias furva","Abromias furva{520867}","Animalia" -"520868","Abromias lateritia","Abromias lateritia{520868}","Animalia" -"520869","Abromias lithoxylaea","Abromias lithoxylaea{520869}","Animalia" -"720186","Abromias maillardi","Abromias maillardi{720186}","Animalia" -"520899","Abromias maillardi maillardi","Abromias maillardi maillardi{520899}","Animalia" -"720183","Abromias monoglypha","Abromias monoglypha{720183}","Animalia" -"520870","Abromias monoglypha monoglypha","Abromias monoglypha monoglypha{520870}","Animalia" -"520871","Abromias oblonga","Abromias oblonga{520871}","Animalia" -"520872","Abromias platinea","Abromias platinea{520872}","Animalia" -"520873","Abromias platinea platinea","Abromias platinea platinea{520873}","Animalia" -"520874","Abromias rubrirena","Abromias rubrirena{520874}","Animalia" -"520875","Abromias rubrirena rubrirena","Abromias rubrirena rubrirena{520875}","Animalia" -"720185","Abromias sublustris","Abromias sublustris{720185}","Animalia" -"520876","Abromias syriaca","Abromias syriaca{520876}","Animalia" -"520877","Abromias zeta","Abromias zeta{520877}","Animalia" -"520878","Abromias zeta zeta","Abromias zeta zeta{520878}","Animalia" -"203824","Abromus","Abromus{203824}","Animalia" -"222074","Abromus brucki","Abromus brucki{222074}","Animalia" -"211184","Abrostola","Abrostola{211184}","Animalia" -"249159","Abrostola agnorista","Abrostola agnorista{249159}","Animalia" -"249157","Abrostola asclepiadis","Abrostola asclepiadis{249157}","Animalia" -"249156","Abrostola tripartita","Abrostola tripartita{249156}","Animalia" -"249158","Abrostola triplasia","Abrostola triplasia{249158}","Animalia" -"79356","Abrotanum alpestre","Abrotanum alpestre{79356}","Plantae" -"79357","Abrotanum ambiguum","Abrotanum ambiguum{79357}","Plantae" -"79358","Abrotanum brachylobum","Abrotanum brachylobum{79358}","Plantae" -"79359","Abrotanum congestum","Abrotanum congestum{79359}","Plantae" -"79360","Abrotanum pauciflorum","Abrotanum pauciflorum{79360}","Plantae" -"79361","Abrotanum pedunculare","Abrotanum pedunculare{79361}","Plantae" -"79362","Abrotanum platylobum","Abrotanum platylobum{79362}","Plantae" -"79363","Abrotanum pulverulentum","Abrotanum pulverulentum{79363}","Plantae" -"79364","Abrotanum rhodanicum","Abrotanum rhodanicum{79364}","Plantae" -"79365","Abrotanum virgatum","Abrotanum virgatum{79365}","Plantae" -"79366","Abrotanum viridulum","Abrotanum viridulum{79366}","Plantae" -"247871","Agdistis meridionalis","Agdistis meridionalis{247871}","Animalia" From 7980fbb00abe751306787e781ba9e3b4bd45d0f5 Mon Sep 17 00:00:00 2001 From: Grzegorz Orczykowski Date: Thu, 29 Aug 2024 15:50:35 +0200 Subject: [PATCH 13/22] Removed FillBlankFormTest with its last test --- .../src/main/resources/forms/CSVerrorForm.xml | 178 ------------------ .../src/main/resources/media/TrapLists.csv | 35 ---- 2 files changed, 213 deletions(-) delete mode 100644 test-forms/src/main/resources/forms/CSVerrorForm.xml delete mode 100644 test-forms/src/main/resources/media/TrapLists.csv diff --git a/test-forms/src/main/resources/forms/CSVerrorForm.xml b/test-forms/src/main/resources/forms/CSVerrorForm.xml deleted file mode 100644 index 797d703ea9c..00000000000 --- a/test-forms/src/main/resources/forms/CSVerrorForm.xml +++ /dev/null @@ -1,178 +0,0 @@ - - - - - CSV error Form - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - MPB - IAS - LGH - Other - - - - - - - - - - - - - - - - - - TrapValue - - - - - - - - - - Yes - No - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - (You have counted specimens total.) - - - - - \ No newline at end of file diff --git a/test-forms/src/main/resources/media/TrapLists.csv b/test-forms/src/main/resources/media/TrapLists.csv deleted file mode 100644 index 5592c97fa96..00000000000 --- a/test-forms/src/main/resources/media/TrapLists.csv +++ /dev/null @@ -1,35 +0,0 @@ -"index_key","TrapProgram","TrapLabel","TrapValue" -"LGH001","LGH","2018-COE-LGH-M-001 @ Acheson","2018-COE-LGH-M-001" -"LGH002","LGH","2018-COE-LGH-M-002 @ Acheson","2018-COE-LGH-M-002" -"LGH003","LGH","2018-COE-LGH-L-003 @ Acheson","2018-COE-LGH-L-003" -"LGH004","LGH","2018-COE-LGH-L-004 @ Acheson","2018-COE-LGH-L-004" -"LGH005","LGH","2018-COE-LGH-M-011 @ Poundmaker","2018-COE-LGH-M-011" -"LGH006","LGH","2018-COE-LGH-M-012 @ Poundmaker","2018-COE-LGH-M-012" -"LGH007","LGH","2018-COE-LGH-L-009 @ Poundmaker","2018-COE-LGH-L-009" -"LGH008","LGH","2018-COE-LGH-L-0010 @ Poundmaker","2018-COE-LGH-L-0010" -"LGH009","LGH","2018-COE-LGH-M-005 @ Plypow","2018-COE-LGH-M-005" -"LGH010","LGH","2018-COE-LGH-M-007 @ Plypow","2018-COE-LGH-M-007" -"LGH011","LGH","2018-COE-LGH-L-006 @ Plypow","2018-COE-LGH-L-006" -"LGH012","LGH","2018-COE-LGH-L-008 @ Plypow","2018-COE-LGH-L-008" -"LGH013","LGH","Other","Other" -"IAS001","IAS","2018-COE-IAS-e-001 @ Coronation","2018-COE-IAS-e-001" -"IAS002","IAS","2018-COE-IAS-a-002 @ Coronation","2018-COE-IAS-a-002" -"IAS003","IAS","2018-COE-IAS-i-003 @ Coronation","2018-COE-IAS-i-003" -"IAS004","IAS","2018-COE-IAS-a-007 @ ERDP","2018-COE-IAS-a-007" -"IAS005","IAS","2018-COE-IAS-e-008 @ ERDP","2018-COE-IAS-e-008" -"IAS006","IAS","2018-COE-IAS-i-009 @ ERDP","2018-COE-IAS-i-009" -"IAS007","IAS","2018-COE-IAS-i-004 @ OMC","2018-COE-IAS-i-004" -"IAS008","IAS","2018-COE-IAS-a-005 @ OMC","2018-COE-IAS-a-005" -"IAS009","IAS","2018-COE-IAS-e-006 @ OMC","2018-COE-IAS-e-006" -"IAS010","IAS","Other","Other" -"MDB001","MPB","2018-COE-MPB-001 @ Wellington","2018-COE-MPB-001" -"MDB002","MPB","2018-COE-MPB-002 @ Wellington","2018-COE-MPB-002" -"MDB003","MPB","2018-COE-MPB-003 @ Wellington","2018-COE-MPB-003" -"MDB004","MPB","2018-COE-MPB-004 @ Borden","2018-COE-MPB-004" -"MDB005","MPB","2018-COE-MPB-005 @ Borden","2018-COE-MPB-005" -"MDB006","MPB","2018-COE-MPB-006 @ Borden","2018-COE-MPB-006" -"MDB007","MPB","2018-COE-MPB-007 @ RVR","2018-COE-MPB-007" -"MDB008","MPB","2018-COE-MPB-008 @ RVR","2018-COE-MPB-008" -"MDB009","MPB","2018-COE-MPB-009 @ RVR","2018-COE-MPB-009" -"MDB010","MPB","Other","Other" -"Oth001","Other",, From bd9828270c1495c0c49896582b8ceb0f11b8011f Mon Sep 17 00:00:00 2001 From: Grzegorz Orczykowski Date: Fri, 23 Feb 2024 18:32:25 +0100 Subject: [PATCH 14/22] Added missing import --- .../collect/android/feature/formentry/FormCalculationsTest.kt | 1 + 1 file changed, 1 insertion(+) diff --git a/collect_app/src/androidTest/java/org/odk/collect/android/feature/formentry/FormCalculationsTest.kt b/collect_app/src/androidTest/java/org/odk/collect/android/feature/formentry/FormCalculationsTest.kt index 4210f78b1db..c1dd296eb6e 100644 --- a/collect_app/src/androidTest/java/org/odk/collect/android/feature/formentry/FormCalculationsTest.kt +++ b/collect_app/src/androidTest/java/org/odk/collect/android/feature/formentry/FormCalculationsTest.kt @@ -8,6 +8,7 @@ import org.junit.Rule import org.junit.Test import org.junit.rules.RuleChain import org.junit.runner.RunWith +import org.odk.collect.android.R import org.odk.collect.android.activities.FormFillingActivity import org.odk.collect.android.support.ActivityHelpers import org.odk.collect.android.support.pages.MainMenuPage From 52295806a585c73e2378a1533d8025bdecb38d6f Mon Sep 17 00:00:00 2001 From: Grzegorz Orczykowski Date: Thu, 29 Aug 2024 15:53:55 +0200 Subject: [PATCH 15/22] Removed redundant comments --- .../collect/android/feature/formentry/EncryptedFormTest.java | 1 - .../feature/formentry/ExternalSecondaryInstanceTest.java | 1 - .../org/odk/collect/android/feature/formentry/FormMediaTest.kt | 1 - .../odk/collect/android/feature/formentry/FormNavigationTest.kt | 2 +- .../android/feature/settings/FormMetadataSettingsTest.kt | 2 +- 5 files changed, 2 insertions(+), 5 deletions(-) diff --git a/collect_app/src/androidTest/java/org/odk/collect/android/feature/formentry/EncryptedFormTest.java b/collect_app/src/androidTest/java/org/odk/collect/android/feature/formentry/EncryptedFormTest.java index 9b7c7c79661..d97de83ed46 100644 --- a/collect_app/src/androidTest/java/org/odk/collect/android/feature/formentry/EncryptedFormTest.java +++ b/collect_app/src/androidTest/java/org/odk/collect/android/feature/formentry/EncryptedFormTest.java @@ -75,7 +75,6 @@ public void instanceOfEncryptedForm_cantBeViewedAfterSending() { .assertOnPage(); } - //TestCase47 @Test public void instanceOfEncryptedFormWithoutInstanceID_failsFinalizationWithMessage() { rule.startAtMainMenu() diff --git a/collect_app/src/androidTest/java/org/odk/collect/android/feature/formentry/ExternalSecondaryInstanceTest.java b/collect_app/src/androidTest/java/org/odk/collect/android/feature/formentry/ExternalSecondaryInstanceTest.java index 24179a410f7..a3ef65e55c1 100644 --- a/collect_app/src/androidTest/java/org/odk/collect/android/feature/formentry/ExternalSecondaryInstanceTest.java +++ b/collect_app/src/androidTest/java/org/odk/collect/android/feature/formentry/ExternalSecondaryInstanceTest.java @@ -20,7 +20,6 @@ * @see External secondary instances */ -// Issue number NODK-377 @RunWith(AndroidJUnit4.class) public class ExternalSecondaryInstanceTest { diff --git a/collect_app/src/androidTest/java/org/odk/collect/android/feature/formentry/FormMediaTest.kt b/collect_app/src/androidTest/java/org/odk/collect/android/feature/formentry/FormMediaTest.kt index 43916dcc7d3..e112e80caac 100644 --- a/collect_app/src/androidTest/java/org/odk/collect/android/feature/formentry/FormMediaTest.kt +++ b/collect_app/src/androidTest/java/org/odk/collect/android/feature/formentry/FormMediaTest.kt @@ -34,7 +34,6 @@ class FormMediaTest { fun missingFileMessage_shouldBeDisplayedIfExternalFileIsMissing() { val formsDirPath = StoragePathProvider().getOdkDirPath(StorageSubdirectory.FORMS) - //TestCase55 rule.startAtMainMenu() .copyForm("search_and_select.xml") .startBlankForm("search_and_select") diff --git a/collect_app/src/androidTest/java/org/odk/collect/android/feature/formentry/FormNavigationTest.kt b/collect_app/src/androidTest/java/org/odk/collect/android/feature/formentry/FormNavigationTest.kt index a159189c6da..f8cd5b39257 100644 --- a/collect_app/src/androidTest/java/org/odk/collect/android/feature/formentry/FormNavigationTest.kt +++ b/collect_app/src/androidTest/java/org/odk/collect/android/feature/formentry/FormNavigationTest.kt @@ -32,7 +32,7 @@ class FormNavigationTest { var copyFormChain: RuleChain = TestRuleChain.chain() .around(rule) - @Test // TestCase14 + @Test fun showsAndHidesButtonsCorrectlyOnEachScreen() { rule.startAtMainMenu() .copyForm("two-question.xml") diff --git a/collect_app/src/androidTest/java/org/odk/collect/android/feature/settings/FormMetadataSettingsTest.kt b/collect_app/src/androidTest/java/org/odk/collect/android/feature/settings/FormMetadataSettingsTest.kt index aa7cf13b089..dca52feccaf 100644 --- a/collect_app/src/androidTest/java/org/odk/collect/android/feature/settings/FormMetadataSettingsTest.kt +++ b/collect_app/src/androidTest/java/org/odk/collect/android/feature/settings/FormMetadataSettingsTest.kt @@ -85,7 +85,7 @@ class FormMetadataSettingsTest { .assertTexts("Chino", "664615", "chino@whitepony.com", installIDProvider.installID) } - @Test // Issue number NODK-238 TestCase4 TestCase5 + @Test fun settingServerUsername_usedAsFallbackForMetadataUsername() { rule.startAtMainMenu() .copyForm("metadata.xml") From 2bc6b3a1164056f6cd58efe520c72e4f23d6bfe7 Mon Sep 17 00:00:00 2001 From: Grzegorz Orczykowski Date: Wed, 6 Nov 2024 14:58:00 +0100 Subject: [PATCH 16/22] Removed redundant BlankFormListTest --- .../formmanagement/BlankFormListTest.kt | 68 ------------------- 1 file changed, 68 deletions(-) delete mode 100644 collect_app/src/androidTest/java/org/odk/collect/android/feature/formmanagement/BlankFormListTest.kt diff --git a/collect_app/src/androidTest/java/org/odk/collect/android/feature/formmanagement/BlankFormListTest.kt b/collect_app/src/androidTest/java/org/odk/collect/android/feature/formmanagement/BlankFormListTest.kt deleted file mode 100644 index d13d88ed4e8..00000000000 --- a/collect_app/src/androidTest/java/org/odk/collect/android/feature/formmanagement/BlankFormListTest.kt +++ /dev/null @@ -1,68 +0,0 @@ -package org.odk.collect.android.feature.formmanagement - -import androidx.test.espresso.Espresso.onView -import androidx.test.espresso.assertion.ViewAssertions.matches -import androidx.test.espresso.matcher.ViewMatchers.withText -import androidx.test.ext.junit.runners.AndroidJUnit4 -import org.junit.Rule -import org.junit.Test -import org.junit.rules.RuleChain -import org.junit.runner.RunWith -import org.odk.collect.android.R -import org.odk.collect.android.support.rules.CollectTestRule -import org.odk.collect.android.support.rules.TestRuleChain -import org.odk.collect.androidtest.DrawableMatcher.withImageDrawable -import org.odk.collect.testshared.RecyclerViewMatcher.Companion.withRecyclerView - -@RunWith(AndroidJUnit4::class) -class BlankFormListTest { - private val rule = CollectTestRule() - - @get:Rule - val chain: RuleChain = TestRuleChain.chain().around(rule) - - @Test - fun sortByDialog_ShouldBeTranslatedAndDisplayProperIcons() { - rule.startAtMainMenu() - .openProjectSettingsDialog() - .clickSettings() - .clickOnUserInterface() - .clickOnLanguage() - .clickOnSelectedLanguage("Deutsch") - .clickFillBlankForm() - .clickOnSortByButton() - .assertText("Sortieren nach") - - onView( - withRecyclerView(R.id.recyclerView).atPositionOnView(0, R.id.title) - ).check(matches(withText("Name, A-Z"))) - - onView( - withRecyclerView(R.id.recyclerView).atPositionOnView(0, R.id.icon) - ).check(matches(withImageDrawable(R.drawable.ic_sort_by_alpha))) - - onView( - withRecyclerView(R.id.recyclerView).atPositionOnView(1, R.id.title) - ).check(matches(withText("Name, Z-A"))) - - onView( - withRecyclerView(R.id.recyclerView).atPositionOnView(1, R.id.icon) - ).check(matches(withImageDrawable(R.drawable.ic_sort_by_alpha))) - - onView( - withRecyclerView(R.id.recyclerView).atPositionOnView(2, R.id.title) - ).check(matches(withText("Datum, neuestes zuerst"))) - - onView( - withRecyclerView(R.id.recyclerView).atPositionOnView(2, R.id.icon) - ).check(matches(withImageDrawable(R.drawable.ic_access_time))) - - onView( - withRecyclerView(R.id.recyclerView).atPositionOnView(3, R.id.title) - ).check(matches(withText("Datum, ältestes zuerst"))) - - onView( - withRecyclerView(R.id.recyclerView).atPositionOnView(3, R.id.icon) - ).check(matches(withImageDrawable(R.drawable.ic_access_time))) - } -} From 12bb50ddaa7868c8820613ff801f7274f0478412 Mon Sep 17 00:00:00 2001 From: Grzegorz Orczykowski Date: Wed, 6 Nov 2024 14:59:37 +0100 Subject: [PATCH 17/22] Moved typeMismatchErrorMessage_shouldBeDisplayedWhenItOccurs to CatchFormDesignExceptionsTest --- .../CatchFormCalculationExceptionsTest.kt | 29 ------------------- .../CatchFormDesignExceptionsTest.kt | 11 +++++++ 2 files changed, 11 insertions(+), 29 deletions(-) delete mode 100644 collect_app/src/androidTest/java/org/odk/collect/android/feature/formentry/CatchFormCalculationExceptionsTest.kt diff --git a/collect_app/src/androidTest/java/org/odk/collect/android/feature/formentry/CatchFormCalculationExceptionsTest.kt b/collect_app/src/androidTest/java/org/odk/collect/android/feature/formentry/CatchFormCalculationExceptionsTest.kt deleted file mode 100644 index dfd803bf78c..00000000000 --- a/collect_app/src/androidTest/java/org/odk/collect/android/feature/formentry/CatchFormCalculationExceptionsTest.kt +++ /dev/null @@ -1,29 +0,0 @@ -package org.odk.collect.android.feature.formentry - -import androidx.test.ext.junit.runners.AndroidJUnit4 -import org.junit.Rule -import org.junit.Test -import org.junit.rules.RuleChain -import org.junit.runner.RunWith -import org.odk.collect.android.support.rules.CollectTestRule -import org.odk.collect.android.support.rules.TestRuleChain - -@RunWith(AndroidJUnit4::class) -class CatchFormCalculationExceptionsTest { - - private val rule = CollectTestRule() - - @get:Rule - val ruleChain: RuleChain = TestRuleChain.chain().around(rule) - - @Test - fun typeMismatchErrorMessage_shouldBeDisplayedWhenItOccurs() { - rule.startAtMainMenu() - .copyForm("validate.xml") - .startBlankForm("validate") - .longPressOnQuestion("year") - .removeResponse() - .swipeToNextQuestionWithError() - .checkIsTextDisplayedOnDialog("The value \"-01-01\" can't be converted to a date.") - } -} diff --git a/collect_app/src/androidTest/java/org/odk/collect/android/feature/formentry/CatchFormDesignExceptionsTest.kt b/collect_app/src/androidTest/java/org/odk/collect/android/feature/formentry/CatchFormDesignExceptionsTest.kt index 98dace41147..2f895726a0c 100644 --- a/collect_app/src/androidTest/java/org/odk/collect/android/feature/formentry/CatchFormDesignExceptionsTest.kt +++ b/collect_app/src/androidTest/java/org/odk/collect/android/feature/formentry/CatchFormDesignExceptionsTest.kt @@ -56,4 +56,15 @@ class CatchFormDesignExceptionsTest { .rotateToLandscape(FormEntryPage("g6Error")) .assertTextDoesNotExist(org.odk.collect.strings.R.string.error_occured) } + + @Test + fun typeMismatchErrorMessage_shouldBeDisplayedWhenItOccurs() { + rule.startAtMainMenu() + .copyForm("validate.xml") + .startBlankForm("validate") + .longPressOnQuestion("year") + .removeResponse() + .swipeToNextQuestionWithError() + .checkIsTextDisplayedOnDialog("The value \"-01-01\" can't be converted to a date.") + } } From 4d4aecbf383d4b75f7eb5d659f993fdfa878bccc Mon Sep 17 00:00:00 2001 From: Grzegorz Orczykowski Date: Wed, 6 Nov 2024 15:18:49 +0100 Subject: [PATCH 18/22] Moved tests from FormMediaTest to ExternalSelectsTest --- .../formentry/ExternalSelectsTest.java | 27 + .../feature/formentry/FormMediaTest.kt | 35 - .../forms/fieldlist-updates_nocsv.xml | 608 ------------------ 3 files changed, 27 insertions(+), 643 deletions(-) delete mode 100644 test-forms/src/main/resources/forms/fieldlist-updates_nocsv.xml diff --git a/collect_app/src/androidTest/java/org/odk/collect/android/feature/formentry/ExternalSelectsTest.java b/collect_app/src/androidTest/java/org/odk/collect/android/feature/formentry/ExternalSelectsTest.java index 61fb14cfd42..903de64ec2b 100644 --- a/collect_app/src/androidTest/java/org/odk/collect/android/feature/formentry/ExternalSelectsTest.java +++ b/collect_app/src/androidTest/java/org/odk/collect/android/feature/formentry/ExternalSelectsTest.java @@ -3,6 +3,8 @@ import org.junit.Rule; import org.junit.Test; import org.junit.rules.RuleChain; +import org.odk.collect.android.storage.StoragePathProvider; +import org.odk.collect.android.storage.StorageSubdirectory; import org.odk.collect.android.support.rules.CollectTestRule; import org.odk.collect.android.support.rules.TestRuleChain; @@ -31,4 +33,29 @@ public void displaysAllChoicesFromItemsetsCSV() { .assertText("King") .assertText("Cameron"); } + + @Test + public void missingFileMessage_shouldBeDisplayedIfExternalFileWithChoicesIsMissing() { + String formsDirPath = new StoragePathProvider().getOdkDirPath(StorageSubdirectory.FORMS); + + rule.startAtMainMenu() + .copyForm("select_one_external.xml") + .startBlankForm("cascading select test") + .clickOnText("Texas") + .swipeToNextQuestion("county") + .assertText("File: $formsDirPath/select_one_external-media/itemsets.csv is missing.") + .swipeToNextQuestion("city") + .assertText("File: $formsDirPath/select_one_external-media/itemsets.csv is missing."); + } + + @Test + public void missingFileMessage_shouldBeDisplayedIfExternalFileWithChoicesUsedBySearchFunctionIsMissing() { + String formsDirPath = new StoragePathProvider().getOdkDirPath(StorageSubdirectory.FORMS); + + rule.startAtMainMenu() + .copyForm("search_and_select.xml") + .startBlankForm("search_and_select") + .assertText("File: $formsDirPath/search_and_select-media/nombre.csv is missing.") + .assertText("File: $formsDirPath/search_and_select-media/nombre2.csv is missing."); + } } diff --git a/collect_app/src/androidTest/java/org/odk/collect/android/feature/formentry/FormMediaTest.kt b/collect_app/src/androidTest/java/org/odk/collect/android/feature/formentry/FormMediaTest.kt index e112e80caac..53b18398eb6 100644 --- a/collect_app/src/androidTest/java/org/odk/collect/android/feature/formentry/FormMediaTest.kt +++ b/collect_app/src/androidTest/java/org/odk/collect/android/feature/formentry/FormMediaTest.kt @@ -5,8 +5,6 @@ import org.junit.Rule import org.junit.Test import org.junit.rules.RuleChain import org.junit.runner.RunWith -import org.odk.collect.android.storage.StoragePathProvider -import org.odk.collect.android.storage.StorageSubdirectory import org.odk.collect.android.support.rules.CollectTestRule import org.odk.collect.android.support.rules.TestRuleChain.chain @@ -29,37 +27,4 @@ class FormMediaTest { .assertText("ab") .assertText("ac") } - - @Test - fun missingFileMessage_shouldBeDisplayedIfExternalFileIsMissing() { - val formsDirPath = StoragePathProvider().getOdkDirPath(StorageSubdirectory.FORMS) - - rule.startAtMainMenu() - .copyForm("search_and_select.xml") - .startBlankForm("search_and_select") - .assertText("File: $formsDirPath/search_and_select-media/nombre.csv is missing.") - .assertText("File: $formsDirPath/search_and_select-media/nombre2.csv is missing.") - .swipeToEndScreen() - .clickFinalize() - - .copyForm("select_one_external.xml") - .startBlankForm("cascading select test") - .clickOnText("Texas") - .swipeToNextQuestion("county") - .assertText("File: $formsDirPath/select_one_external-media/itemsets.csv is missing.") - .swipeToNextQuestion("city") - .assertText("File: $formsDirPath/select_one_external-media/itemsets.csv is missing.") - .swipeToEndScreen() - .clickFinalize() - - .copyForm("fieldlist-updates_nocsv.xml") - .startBlankForm("fieldlist-updates") - .clickGoToArrow() - .clickGoUpIcon() - .clickOnElementInHierarchy(14) - .clickOnQuestion("Source15") - .assertText("File: $formsDirPath/fieldlist-updates_nocsv-media/fruits.csv is missing.") - .swipeToEndScreen() - .clickFinalize() - } } diff --git a/test-forms/src/main/resources/forms/fieldlist-updates_nocsv.xml b/test-forms/src/main/resources/forms/fieldlist-updates_nocsv.xml deleted file mode 100644 index 0f311db677a..00000000000 --- a/test-forms/src/main/resources/forms/fieldlist-updates_nocsv.xml +++ /dev/null @@ -1,608 +0,0 @@ - - - - fieldlist-updates - - - - - - - - A - - - B - - - C - - - A1 - - - A2 - - - A3 - - - B1 - - - B2 - - - B3 - - - C1 - - - C2 - - - C3 - - - C4 - - - A1A - - - A1B - - - B1A - - - B1B - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - static_instance-level1-0 - a - - - static_instance-level1-1 - b - - - static_instance-level1-2 - c - - - - - - - static_instance-level2-0 - a - a1 - - - static_instance-level2-1 - a - a2 - - - static_instance-level2-2 - a - a3 - - - static_instance-level2-3 - b - b1 - - - static_instance-level2-4 - b - b2 - - - static_instance-level2-5 - b - b3 - - - static_instance-level2-6 - c - c1 - - - static_instance-level2-7 - c - c2 - - - static_instance-level2-8 - c - c3 - - - static_instance-level2-9 - c - c4 - - - - - - - static_instance-level3-0 - a1a - a1 - - - static_instance-level3-1 - a1b - a1 - - - static_instance-level3-2 - b1a - b1 - - - static_instance-level3-3 - b1b - b1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Please don't use your calculator, ! - - - - - - - - - - - - - - - - - - a - - - - b - - - - c - - - - - - - - - - - - - - - - - - - - - - a - - - - b - - - - c - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - name_key - - - - - - - - From 232dadcc1ca8167851ffaf1edb83d4fd88ed6011 Mon Sep 17 00:00:00 2001 From: Grzegorz Orczykowski Date: Wed, 6 Nov 2024 15:25:08 +0100 Subject: [PATCH 19/22] Converted ExternalSelectsTest to kotlin --- .../formentry/ExternalSelectsTest.java | 61 ------------------- .../feature/formentry/ExternalSelectsTest.kt | 59 ++++++++++++++++++ 2 files changed, 59 insertions(+), 61 deletions(-) delete mode 100644 collect_app/src/androidTest/java/org/odk/collect/android/feature/formentry/ExternalSelectsTest.java create mode 100644 collect_app/src/androidTest/java/org/odk/collect/android/feature/formentry/ExternalSelectsTest.kt diff --git a/collect_app/src/androidTest/java/org/odk/collect/android/feature/formentry/ExternalSelectsTest.java b/collect_app/src/androidTest/java/org/odk/collect/android/feature/formentry/ExternalSelectsTest.java deleted file mode 100644 index 903de64ec2b..00000000000 --- a/collect_app/src/androidTest/java/org/odk/collect/android/feature/formentry/ExternalSelectsTest.java +++ /dev/null @@ -1,61 +0,0 @@ -package org.odk.collect.android.feature.formentry; - -import org.junit.Rule; -import org.junit.Test; -import org.junit.rules.RuleChain; -import org.odk.collect.android.storage.StoragePathProvider; -import org.odk.collect.android.storage.StorageSubdirectory; -import org.odk.collect.android.support.rules.CollectTestRule; -import org.odk.collect.android.support.rules.TestRuleChain; - -import java.util.Collections; - -/** - * This tests the "External selects" feature of XLSForms. This will often be referred to as "fast - * external itemsets". - * - * @see External selects - */ -public class ExternalSelectsTest { - public CollectTestRule rule = new CollectTestRule(); - - @Rule - public RuleChain copyFormChain = TestRuleChain.chain() - .around(rule); - - @Test - public void displaysAllChoicesFromItemsetsCSV() { - rule.startAtMainMenu() - .copyForm("selectOneExternal.xml", Collections.singletonList("selectOneExternal-media/itemsets.csv")) - .startBlankForm("selectOneExternal") - .clickOnText("Texas") - .swipeToNextQuestion("county") - .assertText("King") - .assertText("Cameron"); - } - - @Test - public void missingFileMessage_shouldBeDisplayedIfExternalFileWithChoicesIsMissing() { - String formsDirPath = new StoragePathProvider().getOdkDirPath(StorageSubdirectory.FORMS); - - rule.startAtMainMenu() - .copyForm("select_one_external.xml") - .startBlankForm("cascading select test") - .clickOnText("Texas") - .swipeToNextQuestion("county") - .assertText("File: $formsDirPath/select_one_external-media/itemsets.csv is missing.") - .swipeToNextQuestion("city") - .assertText("File: $formsDirPath/select_one_external-media/itemsets.csv is missing."); - } - - @Test - public void missingFileMessage_shouldBeDisplayedIfExternalFileWithChoicesUsedBySearchFunctionIsMissing() { - String formsDirPath = new StoragePathProvider().getOdkDirPath(StorageSubdirectory.FORMS); - - rule.startAtMainMenu() - .copyForm("search_and_select.xml") - .startBlankForm("search_and_select") - .assertText("File: $formsDirPath/search_and_select-media/nombre.csv is missing.") - .assertText("File: $formsDirPath/search_and_select-media/nombre2.csv is missing."); - } -} diff --git a/collect_app/src/androidTest/java/org/odk/collect/android/feature/formentry/ExternalSelectsTest.kt b/collect_app/src/androidTest/java/org/odk/collect/android/feature/formentry/ExternalSelectsTest.kt new file mode 100644 index 00000000000..35ab9601b82 --- /dev/null +++ b/collect_app/src/androidTest/java/org/odk/collect/android/feature/formentry/ExternalSelectsTest.kt @@ -0,0 +1,59 @@ +package org.odk.collect.android.feature.formentry + +import org.junit.Rule +import org.junit.Test +import org.junit.rules.RuleChain +import org.odk.collect.android.storage.StoragePathProvider +import org.odk.collect.android.storage.StorageSubdirectory +import org.odk.collect.android.support.rules.CollectTestRule +import org.odk.collect.android.support.rules.TestRuleChain.chain + +/** + * This tests the "External selects" feature of XLSForms. This will often be referred to as "fast + * external itemsets". + * + * @see [External selects](https://xlsform.org/en/.external-selects) + */ +class ExternalSelectsTest { + private var rule: CollectTestRule = CollectTestRule() + + @get:Rule + val copyFormChain: RuleChain = chain() + .around(rule) + + @Test + fun displaysAllChoicesFromItemsetsCSV() { + rule.startAtMainMenu() + .copyForm("selectOneExternal.xml", listOf("selectOneExternal-media/itemsets.csv")) + .startBlankForm("selectOneExternal") + .clickOnText("Texas") + .swipeToNextQuestion("county") + .assertText("King") + .assertText("Cameron") + } + + @Test + fun missingFileMessage_shouldBeDisplayedIfExternalFileWithChoicesIsMissing() { + val formsDirPath = StoragePathProvider().getOdkDirPath(StorageSubdirectory.FORMS) + + rule.startAtMainMenu() + .copyForm("select_one_external.xml") + .startBlankForm("cascading select test") + .clickOnText("Texas") + .swipeToNextQuestion("county") + .assertText("File: $formsDirPath/select_one_external-media/itemsets.csv is missing.") + .swipeToNextQuestion("city") + .assertText("File: $formsDirPath/select_one_external-media/itemsets.csv is missing.") + } + + @Test + fun missingFileMessage_shouldBeDisplayedIfExternalFileWithChoicesUsedBySearchFunctionIsMissing() { + val formsDirPath = StoragePathProvider().getOdkDirPath(StorageSubdirectory.FORMS) + + rule.startAtMainMenu() + .copyForm("search_and_select.xml") + .startBlankForm("search_and_select") + .assertText("File: $formsDirPath/search_and_select-media/nombre.csv is missing.") + .assertText("File: $formsDirPath/search_and_select-media/nombre2.csv is missing.") + } +} From cc5c8403b40638a5826729fdfd67c9a1063c11ea Mon Sep 17 00:00:00 2001 From: Grzegorz Orczykowski Date: Wed, 6 Nov 2024 15:27:18 +0100 Subject: [PATCH 20/22] Removed redundant FormCalculationsTest --- .../feature/formentry/FormCalculationsTest.kt | 69 ------------------- 1 file changed, 69 deletions(-) delete mode 100644 collect_app/src/androidTest/java/org/odk/collect/android/feature/formentry/FormCalculationsTest.kt diff --git a/collect_app/src/androidTest/java/org/odk/collect/android/feature/formentry/FormCalculationsTest.kt b/collect_app/src/androidTest/java/org/odk/collect/android/feature/formentry/FormCalculationsTest.kt deleted file mode 100644 index c1dd296eb6e..00000000000 --- a/collect_app/src/androidTest/java/org/odk/collect/android/feature/formentry/FormCalculationsTest.kt +++ /dev/null @@ -1,69 +0,0 @@ -package org.odk.collect.android.feature.formentry - -import android.widget.FrameLayout -import android.widget.TextView -import androidx.test.ext.junit.runners.AndroidJUnit4 -import junit.framework.TestCase.assertNotSame -import org.junit.Rule -import org.junit.Test -import org.junit.rules.RuleChain -import org.junit.runner.RunWith -import org.odk.collect.android.R -import org.odk.collect.android.activities.FormFillingActivity -import org.odk.collect.android.support.ActivityHelpers -import org.odk.collect.android.support.pages.MainMenuPage -import org.odk.collect.android.support.rules.CollectTestRule -import org.odk.collect.android.support.rules.TestRuleChain - -@RunWith(AndroidJUnit4::class) -class FormCalculationsTest { - private val rule = CollectTestRule() - - @get:Rule - val ruleChain: RuleChain = TestRuleChain.chain().around(rule) - - @Test - fun randomFunction_ShouldWorkCorrectly() { - rule.startAtMainMenu() - .copyForm("random.xml") - .copyForm("randomTest_broken.xml") - - val firstQuestionAnswers: MutableList = ArrayList() - val secondQuestionAnswers: MutableList = ArrayList() - for (i in 1..3) { - val formEntryPage = MainMenuPage().startBlankForm("random") - firstQuestionAnswers.add(getQuestionText()) - formEntryPage.swipeToNextQuestion("Your random once value:") - secondQuestionAnswers.add(getQuestionText()) - formEntryPage.swipeToEndScreen().clickFinalize() - } - - assertNotSame(firstQuestionAnswers[0], firstQuestionAnswers[1]) - assertNotSame(firstQuestionAnswers[0], firstQuestionAnswers[2]) - assertNotSame(firstQuestionAnswers[1], firstQuestionAnswers[2]) - assertNotSame(secondQuestionAnswers[0], secondQuestionAnswers[1]) - assertNotSame(secondQuestionAnswers[0], secondQuestionAnswers[2]) - assertNotSame(secondQuestionAnswers[1], secondQuestionAnswers[2]) - - firstQuestionAnswers.clear() - - for (i in 1..3) { - val formEntryPage = MainMenuPage().startBlankForm("random test") - formEntryPage.inputText("3") - formEntryPage.swipeToNextQuestion("Your random number was") - firstQuestionAnswers.add(getQuestionText()) - formEntryPage.swipeToEndScreen().clickFinalize() - } - - assertNotSame(firstQuestionAnswers[0], firstQuestionAnswers[1]) - assertNotSame(firstQuestionAnswers[0], firstQuestionAnswers[2]) - assertNotSame(firstQuestionAnswers[1], firstQuestionAnswers[2]) - } - - private fun getQuestionText(): String { - val formFillingActivity = ActivityHelpers.getActivity() as FormFillingActivity - val questionContainer = formFillingActivity.findViewById(R.id.text_container) - val questionView = questionContainer.getChildAt(0) as TextView - return questionView.text.toString() - } -} From e484e2ebb5613c2a2d61a9d7faa436ab46cb09f8 Mon Sep 17 00:00:00 2001 From: Grzegorz Orczykowski Date: Fri, 8 Nov 2024 18:23:52 +0100 Subject: [PATCH 21/22] Split the test into smaller ones --- .../feature/formentry/FormAppearancesTest.kt | 93 ------------ .../formentry/SearchAppearancesTest.kt | 139 ++++++++++++++++++ .../forms/different-search-appearances.xml | 24 +-- 3 files changed, 151 insertions(+), 105 deletions(-) delete mode 100644 collect_app/src/androidTest/java/org/odk/collect/android/feature/formentry/FormAppearancesTest.kt create mode 100644 collect_app/src/androidTest/java/org/odk/collect/android/feature/formentry/SearchAppearancesTest.kt diff --git a/collect_app/src/androidTest/java/org/odk/collect/android/feature/formentry/FormAppearancesTest.kt b/collect_app/src/androidTest/java/org/odk/collect/android/feature/formentry/FormAppearancesTest.kt deleted file mode 100644 index 6d62a2c16ee..00000000000 --- a/collect_app/src/androidTest/java/org/odk/collect/android/feature/formentry/FormAppearancesTest.kt +++ /dev/null @@ -1,93 +0,0 @@ -package org.odk.collect.android.feature.formentry - -import androidx.test.ext.junit.runners.AndroidJUnit4 -import org.junit.Rule -import org.junit.Test -import org.junit.rules.RuleChain -import org.junit.runner.RunWith -import org.odk.collect.android.support.rules.CollectTestRule -import org.odk.collect.android.support.rules.TestRuleChain -import org.odk.collect.strings.R - -@RunWith(AndroidJUnit4::class) -class FormAppearancesTest { - private val rule = CollectTestRule() - - @get:Rule - val ruleChain: RuleChain = TestRuleChain.chain().around(rule) - - @Test - fun searchAppearance_ShouldDisplayWhenSearchAppearanceIsSpecified() { - rule.startAtMainMenu() - .copyForm("different-search-appearances.xml", listOf("fruits.csv")) - .startBlankForm("different-search-appearances") - .clickOnText("Mango") - .swipeToNextQuestion("The fruit mango pulled from csv") - .assertText("The fruit mango pulled from csv") - .swipeToNextQuestion("Static select with no appearance") - .clickOnText("Wolf") - .swipeToNextQuestion("Static select with search appearance") - .inputText("w") - .closeSoftKeyboard() - .assertText("Wolf") - .assertText("Warthog") - .clickOnText("Wolf") - .swipeToNextQuestion("Static select with autocomplete appearance") - .inputText("r") - .closeSoftKeyboard() - .assertText("Warthog") - .assertText("Raccoon") - .assertText("Rabbit") - .closeSoftKeyboard() - .clickOnText("Rabbit") - .swipeToNextQuestion("Select from a CSV using search() appearance/function and search appearance") - .inputText("r") - .closeSoftKeyboard() - .assertText("Oranges") - .assertText("Strawberries") - .clickOnText("Oranges") - .swipeToNextQuestion("Select from a CSV using search() appearance/function and autocomplete appearance") - .inputText("n") - .closeSoftKeyboard() - .assertText("Mango") - .assertText("Oranges") - .clickOnText("Mango") - .swipeToNextQuestion("Select from a CSV using search() appearance/function") - .clickOnText("Mango") - .clickOnText("Strawberries") - .swipeToNextQuestion("Static select with no appearance") - .clickOnText("Raccoon") - .clickOnText("Rabbit") - .swipeToNextQuestion("Static select with search appearance") - .inputText("w") - .closeSoftKeyboard() - .assertText("Wolf") - .assertText("Warthog") - .clickOnText("Wolf") - .clickOnText("Warthog") - .swipeToNextQuestion("Static select with autocomplete appearance") - .inputText("r") - .closeSoftKeyboard() - .assertText("Warthog") - .assertText("Raccoon") - .assertText("Rabbit") - .clickOnText("Raccoon") - .clickOnText("Rabbit") - .swipeToNextQuestion("Select from a CSV using search() appearance/function and search appearance") - .inputText("m") - .closeSoftKeyboard() - .assertText("Mango") - .clickOnText("Mango") - .swipeToNextQuestion("Select from a CSV using search() appearance/function and autocomplete appearance") - .inputText("n") - .closeSoftKeyboard() - .closeSoftKeyboard() - .assertText("Mango") - .assertText("Oranges") - .clickOnText("Mango") - .clickOnText("Oranges") - .swipeToEndScreen() - .clickFinalize() - .checkIsSnackbarWithMessageDisplayed(R.string.form_saved) - } -} diff --git a/collect_app/src/androidTest/java/org/odk/collect/android/feature/formentry/SearchAppearancesTest.kt b/collect_app/src/androidTest/java/org/odk/collect/android/feature/formentry/SearchAppearancesTest.kt new file mode 100644 index 00000000000..90210175614 --- /dev/null +++ b/collect_app/src/androidTest/java/org/odk/collect/android/feature/formentry/SearchAppearancesTest.kt @@ -0,0 +1,139 @@ +package org.odk.collect.android.feature.formentry + +import androidx.test.ext.junit.runners.AndroidJUnit4 +import org.junit.Rule +import org.junit.Test +import org.junit.rules.RuleChain +import org.junit.runner.RunWith +import org.odk.collect.android.support.rules.CollectTestRule +import org.odk.collect.android.support.rules.TestRuleChain + +@RunWith(AndroidJUnit4::class) +class SearchAppearancesTest { + private val rule = CollectTestRule() + + @get:Rule + val ruleChain: RuleChain = TestRuleChain.chain().around(rule) + + @Test + fun searchFunctionFetchesChoicesForSelectOneFromCSVFile() { + rule.startAtMainMenu() + .copyForm("different-search-appearances.xml", listOf("fruits.csv")) + .startBlankForm("different-search-appearances") + .assertTexts("Mango", "Oranges", "Strawberries") + } + + @Test + fun searchAppearanceEnablesFilteringChoicesForSelectOne() { + rule.startAtMainMenu() + .copyForm("different-search-appearances.xml", listOf("fruits.csv")) + .startBlankForm("different-search-appearances") + .clickGoToArrow() + .clickOnQuestion("Static select one with search appearance") + .inputText("w") + .closeSoftKeyboard() + .assertTexts("Wolf", "Warthog") + .assertTextsDoNotExist("Racoon", "Rabbit") + } + + @Test + fun autocompleteAppearanceEnablesFilteringChoicesForSelectOne() { + rule.startAtMainMenu() + .copyForm("different-search-appearances.xml", listOf("fruits.csv")) + .startBlankForm("different-search-appearances") + .clickGoToArrow() + .clickOnQuestion("Static select one with autocomplete appearance") + .inputText("r") + .closeSoftKeyboard() + .assertTexts("Warthog", "Raccoon", "Rabbit") + .assertTextDoesNotExist("Wolf") + } + + @Test + fun searchFunctionCanBeCombinedWithSearchAppearanceForSelectOne() { + rule.startAtMainMenu() + .copyForm("different-search-appearances.xml", listOf("fruits.csv")) + .startBlankForm("different-search-appearances") + .clickGoToArrow() + .clickOnQuestion("Select one from a CSV using search() appearance/function and search appearance") + .inputText("r") + .closeSoftKeyboard() + .assertTexts("Oranges", "Strawberries") + .assertTextDoesNotExist("Mango") + } + + @Test + fun searchFunctionCanBeCombinedWithAutocompleteAppearanceForSelectOne() { + rule.startAtMainMenu() + .copyForm("different-search-appearances.xml", listOf("fruits.csv")) + .startBlankForm("different-search-appearances") + .clickGoToArrow() + .clickOnQuestion("Select one from a CSV using search() appearance/function and autocomplete appearance") + .inputText("n") + .closeSoftKeyboard() + .assertTexts("Mango", "Oranges") + .assertTextDoesNotExist("Strawberries") + } + + @Test + fun searchFunctionFetchesChoicesForSelectMultipleFromCSVFile() { + rule.startAtMainMenu() + .copyForm("different-search-appearances.xml", listOf("fruits.csv")) + .startBlankForm("different-search-appearances") + .clickGoToArrow() + .clickOnQuestion("Select multiple from a CSV using search() appearance/function") + .assertTexts("Mango", "Oranges", "Strawberries") + } + + @Test + fun searchAppearanceEnablesFilteringChoicesForSelectMultiple() { + rule.startAtMainMenu() + .copyForm("different-search-appearances.xml", listOf("fruits.csv")) + .startBlankForm("different-search-appearances") + .clickGoToArrow() + .clickOnQuestion("Static select multiple with search appearance") + .inputText("w") + .closeSoftKeyboard() + .assertTexts("Wolf", "Warthog") + .assertTextsDoNotExist("Racoon", "Rabbit") + } + + @Test + fun autocompleteAppearanceEnablesFilteringChoicesForSelectMultiple() { + rule.startAtMainMenu() + .copyForm("different-search-appearances.xml", listOf("fruits.csv")) + .startBlankForm("different-search-appearances") + .clickGoToArrow() + .clickOnQuestion("Static select multiple with autocomplete appearance") + .inputText("r") + .closeSoftKeyboard() + .assertTexts("Warthog", "Raccoon", "Rabbit") + .assertTextDoesNotExist("Wolf") + } + + @Test + fun searchFunctionCanBeCombinedWithSearchAppearanceForSelectMultiple() { + rule.startAtMainMenu() + .copyForm("different-search-appearances.xml", listOf("fruits.csv")) + .startBlankForm("different-search-appearances") + .clickGoToArrow() + .clickOnQuestion("Select multiple from a CSV using search() appearance/function and search appearance") + .inputText("r") + .closeSoftKeyboard() + .assertTexts("Oranges", "Strawberries") + .assertTextDoesNotExist("Mango") + } + + @Test + fun searchFunctionCanBeCombinedWithAutocompleteAppearanceForSelectMultiple() { + rule.startAtMainMenu() + .copyForm("different-search-appearances.xml", listOf("fruits.csv")) + .startBlankForm("different-search-appearances") + .clickGoToArrow() + .clickOnQuestion("Select multiple from a CSV using search() appearance/function and autocomplete appearance") + .inputText("n") + .closeSoftKeyboard() + .assertTexts("Mango", "Oranges") + .assertTextDoesNotExist("Strawberries") + } +} diff --git a/test-forms/src/main/resources/forms/different-search-appearances.xml b/test-forms/src/main/resources/forms/different-search-appearances.xml index c74fbdc5933..6d76fb37a8b 100644 --- a/test-forms/src/main/resources/forms/different-search-appearances.xml +++ b/test-forms/src/main/resources/forms/different-search-appearances.xml @@ -41,7 +41,7 @@ - + name_key @@ -53,7 +53,7 @@ - + wolf @@ -72,7 +72,7 @@ - + wolf @@ -91,7 +91,7 @@ - + wolf @@ -110,28 +110,28 @@ - + name_key - + name_key