-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6383 from grzesiek2010/regressionPart4
Removed the regression test package [Final part]
- Loading branch information
Showing
22 changed files
with
242 additions
and
2,174 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 0 additions & 34 deletions
34
...p/src/androidTest/java/org/odk/collect/android/feature/formentry/ExternalSelectsTest.java
This file was deleted.
Oops, something went wrong.
59 changes: 59 additions & 0 deletions
59
...app/src/androidTest/java/org/odk/collect/android/feature/formentry/ExternalSelectsTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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.") | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
139 changes: 139 additions & 0 deletions
139
...p/src/androidTest/java/org/odk/collect/android/feature/formentry/SearchAppearancesTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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") | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -85,7 +85,7 @@ class FormMetadataSettingsTest { | |
.assertTexts("Chino", "664615", "[email protected]", installIDProvider.installID) | ||
} | ||
|
||
@Test // Issue number NODK-238 TestCase4 TestCase5 | ||
@Test | ||
fun settingServerUsername_usedAsFallbackForMetadataUsername() { | ||
rule.startAtMainMenu() | ||
.copyForm("metadata.xml") | ||
|
Oops, something went wrong.