-
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 #6428 from grzesiek2010/formparser
Allow forms with parse errors to be downloaded, show errors at form open time
- Loading branch information
Showing
28 changed files
with
638 additions
and
775 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,12 +19,16 @@ class InvalidFormTest { | |
var copyFormChain: RuleChain = chain().around(rule) | ||
|
||
@Test | ||
fun brokenForm_shouldNotBeVisibleOnFormList() { | ||
fun brokenForm_isVisibleOnFormList_butThrowsAnErrorAfterOpeningIt() { | ||
rule.startAtMainMenu() | ||
.copyForm("invalid-form.xml") | ||
.clickFillBlankForm() | ||
.checkIsSnackbarErrorVisible("org.javarosa.xform.parse.XFormParseException: Cycle detected in form's relevant and calculation logic!") | ||
.assertTextDoesNotExist("invalid-form") | ||
.startBlankFormWithError("invalid-form", true) | ||
.assertTextInDialog("An unknown error has occurred. Please ask your project leadership to email [email protected] with information about this form.\n" + | ||
"\n" + | ||
"Cycle detected in form's relevant and calculation logic!\n" + | ||
"The following nodes are likely involved in the loop:\n" + | ||
"/asasas/q2") | ||
.clickOKOnDialog(MainMenuPage()) | ||
} | ||
|
||
@Test | ||
|
@@ -41,7 +45,7 @@ class InvalidFormTest { | |
fun app_ShouldNotCrash_whenFillingFormsWithRepeatInFieldList() { | ||
rule.startAtMainMenu() | ||
.copyForm("repeat_in_field_list.xml") | ||
.startBlankFormWithError("repeat_in_field_list") | ||
.startBlankFormWithError("repeat_in_field_list", false) | ||
.clickOK(FormEntryPage("repeat_in_field_list")) | ||
.swipeToEndScreen() | ||
.clickFinalize() | ||
|
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
11 changes: 0 additions & 11 deletions
11
collect_app/src/androidTest/java/org/odk/collect/android/support/pages/ErrorDialog.java
This file was deleted.
Oops, something went wrong.
15 changes: 15 additions & 0 deletions
15
collect_app/src/androidTest/java/org/odk/collect/android/support/pages/ErrorDialog.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,15 @@ | ||
package org.odk.collect.android.support.pages | ||
|
||
import org.odk.collect.strings.R | ||
|
||
class ErrorDialog : OkDialog() { | ||
fun assertOnPage(isFatal: Boolean): ErrorDialog { | ||
assertOnPage() | ||
if (isFatal) { | ||
assertText(R.string.form_cannot_be_used) | ||
} else { | ||
assertText(R.string.error_occured) | ||
} | ||
return this | ||
} | ||
} |
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
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
24 changes: 0 additions & 24 deletions
24
collect_app/src/main/java/org/odk/collect/android/formmanagement/FormMetadataParser.java
This file was deleted.
Oops, something went wrong.
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
Oops, something went wrong.