-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Removed the regression test package part3 #6295
Changes from all commits
2f2e3dd
284235f
90cd30a
052443e
39a17f2
827e058
ff2fe11
4db739e
d272072
eaaa8d0
59eca45
f5fdaa8
4f1f396
021f1a0
0f39c19
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -200,4 +200,29 @@ public void regularGroupThatWrapsARepeatableGroupShouldBeTreatedAsARegularOne() | |
.assertPath("Outer") | ||
.assertNotRemovableGroup(); | ||
} | ||
|
||
@Test | ||
public void when_openHierarchyViewFromLastPage_should_mainGroupViewBeVisible() { | ||
rule.startAtMainMenu() | ||
.copyForm("repeat_group_form.xml") | ||
.startBlankFormWithRepeatGroup("Repeat Group", "Grp1") | ||
.clickOnDoNotAdd(new FormEntryPage("Repeat Group")) | ||
.clickGoToArrow() | ||
.clickJumpEndButton() | ||
.clickGoToArrow() | ||
.checkIfElementInHierarchyMatchesToText("Group Name", 0); | ||
} | ||
|
||
@Test | ||
public void hierachyView_shouldNotChangeAfterScreenRotation() { | ||
rule.startAtMainMenu() | ||
.copyForm("repeat_group_form.xml") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Again does this need to be a repeat form? It feels like the test just needs any form where it can navigate somewhere in the hierarchy and just rotate once (rather than multiple times). There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. When it comes to rotating multiple times I agree but I guess a form with repeats was used on purpose. I think we might have wanted to test that after recreating the activity we are on the same level in the hierarchy which is not possible with simple forms. |
||
.startBlankFormWithRepeatGroup("Repeat Group", "Grp1") | ||
.clickOnDoNotAdd(new FormEntryPage("Repeat Group")) | ||
.clickGoToArrow() | ||
.clickGoUpIcon() | ||
.checkIfElementInHierarchyMatchesToText("Group Name", 0) | ||
.rotateToLandscape(new FormHierarchyPage("Repeat Group")) | ||
.checkIfElementInHierarchyMatchesToText("Group Name", 0); | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
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.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.chain | ||
import org.odk.collect.strings.R | ||
|
||
@RunWith(AndroidJUnit4::class) | ||
class InvalidFormTest { | ||
private var rule = CollectTestRule() | ||
|
||
@get:Rule | ||
var copyFormChain: RuleChain = chain().around(rule) | ||
|
||
@Test | ||
fun brokenForm_shouldNotBeVisibleOnFormList() { | ||
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") | ||
} | ||
|
||
@Test | ||
fun app_ShouldNotCrash_whenFillingFormsWithEmptyGroupFieldList() { | ||
MainMenuPage() | ||
.copyForm("emptyGroupFieldList.xml") | ||
.clickFillBlankForm() | ||
.clickOnEmptyForm("emptyGroupFieldList") | ||
.clickFinalize() | ||
.checkIsSnackbarWithMessageDisplayed(R.string.form_saved) | ||
} | ||
|
||
@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) | ||
} | ||
} |
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does it matter that it's a repeat form?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think so but I'm not sure. Again @dbemke do you know anything about this test? It's TestCase30 NODK-244?