Skip to content
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

Merged
merged 15 commits into from
Aug 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -200,4 +200,29 @@ public void regularGroupThatWrapsARepeatableGroupShouldBeTreatedAsARegularOne()
.assertPath("Outer")
.assertNotRemovableGroup();
}

@Test
public void when_openHierarchyViewFromLastPage_should_mainGroupViewBeVisible() {
Copy link
Member

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?

Copy link
Member Author

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?

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")
Copy link
Member

Choose a reason for hiding this comment

The 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).

Copy link
Member Author

Choose a reason for hiding this comment

The 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.

Loading