Skip to content

Commit

Permalink
Improved testing form errors
Browse files Browse the repository at this point in the history
  • Loading branch information
grzesiek2010 committed Aug 21, 2024
1 parent 405ccf2 commit efe2c60
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 131 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,34 +28,21 @@ class InvalidFormTest {
}

@Test
fun app_ShouldNotCrash_whenFillingFormsWithErrors() {
rule.startAtMainMenu()
.copyForm("g6Error.xml")
.startBlankFormWithError("g6Error")
.clickOK(FormEntryPage("g6Error"))
.swipeToEndScreen()
.clickFinalize()
.checkIsSnackbarWithMessageDisplayed(R.string.form_saved)

MainMenuPage()
.copyForm("g6Error2.xml")
.startBlankForm("g6Error2")
.swipeToNextQuestionWithError()
.clickOK(FormEntryPage("g6Error2"))
.swipeToEndScreen()
.clickFinalize()
.checkIsSnackbarWithMessageDisplayed(R.string.form_saved)

fun app_ShouldNotCrash_whenFillingFormsWithEmptyGroupFieldList() {
MainMenuPage()
.copyForm("emptyGroupFieldList.xml")
.clickFillBlankForm()
.clickOnEmptyForm("emptyGroupFieldList")
.clickFinalize()
.checkIsSnackbarWithMessageDisplayed(R.string.form_saved)
}

MainMenuPage()
.copyForm("emptyGroupFieldList2.xml")
.startBlankForm("emptyGroupFieldList2")
@Test
fun app_ShouldNotCrash_whenFillingFormsWithRepeatInFieldList() {
rule.startAtMainMenu()
.copyForm("repeat_in_field_list.xml")
.startBlankFormWithError("repeat_in_field_list")
.clickOK(FormEntryPage("repeat_in_field_list"))
.swipeToEndScreen()
.clickFinalize()
.checkIsSnackbarWithMessageDisplayed(R.string.form_saved)
Expand Down
37 changes: 0 additions & 37 deletions test-forms/src/main/resources/forms/emptyGroupFieldList2.xml

This file was deleted.

71 changes: 0 additions & 71 deletions test-forms/src/main/resources/forms/g6Error2.xml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<h:html xmlns="http://www.w3.org/2002/xforms" xmlns:h="http://www.w3.org/1999/xhtml" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:jr="http://openrosa.org/javarosa">
<h:head>
<h:title>g6Error</h:title>
<h:title>repeat_in_field_list</h:title>
<model>
<instance>
<data id="build_g6Error_1517568408">
<data id="repeat_in_field_list">
<meta>
<instanceID/>
</meta>
Expand Down

0 comments on commit efe2c60

Please sign in to comment.