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

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Moved groups_shouldBeVisibleInHierarchyView to FormHierarchyTest
  • Loading branch information
grzesiek2010 committed Jul 26, 2024
commit b6c624cc2fb68c098bf37631fd254ccc8a54a85e
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import org.junit.Test;
import org.junit.rules.RuleChain;
import org.odk.collect.android.R;
import org.odk.collect.android.support.pages.FormEndPage;
import org.odk.collect.android.support.rules.CollectTestRule;
import org.odk.collect.android.support.rules.TestRuleChain;
import org.odk.collect.testshared.RecyclerViewMatcher;
Expand Down Expand Up @@ -227,4 +228,40 @@ public void hierachyView_shouldNotChangeAfterScreenRotation() {
.rotateToPortrait(new FormHierarchyPage("Repeat Group"))
.checkIfElementInHierarchyMatchesToText("Group Name", 0);
}

@Test
public void groups_shouldBeVisibleInHierarchyView() {
rule.startAtMainMenu()
.copyForm("nested-repeats-complex.xml")
.startBlankForm("nested-repeats-complex")
.swipeToNextQuestion("You will now be asked questions about your friends. When you see a dialog, tap \"Add\" until you have added all your friends.")
.swipeToNextQuestionWithRepeatGroup("Friends")
.clickOnAdd(new FormEntryPage("nested-repeats-complex"))
.inputText("La")
.swipeToNextQuestion("You will now be asked questions about La's pets. When you see a dialog, tap \"Add\" until you have added all of La's pets.")
.swipeToNextQuestionWithRepeatGroup("Pets")
.clickOnAdd(new FormEntryPage("nested-repeats-complex"))
.inputText("Le")
.swipeToNextQuestionWithRepeatGroup("Pets")
.clickOnAdd(new FormEntryPage("nested-repeats-complex"))
.inputText("Be")
.swipeToNextQuestionWithRepeatGroup("Pets")
.clickOnDoNotAdd(new AddNewRepeatDialog("Friends"))
.clickOnDoNotAdd(new AddNewRepeatDialog("Enemies"))
.clickOnAdd(new FormEntryPage("nested-repeats-complex"))
.inputText("Bu")
.swipeToNextQuestionWithRepeatGroup("Enemies")
.clickOnDoNotAdd(new FormEndPage("nested-repeats-complex"))
.clickGoToArrow()
.clickOnText("Friends")
.checkListSizeInHierarchy(1)
.clickOnElementInHierarchy(0)
.clickOnText("Pets")
.checkListSizeInHierarchy(2)
.clickGoUpIcon()
.clickGoUpIcon()
.clickGoUpIcon()
.clickOnText("Enemies")
.checkListSizeInHierarchy(1);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
import org.odk.collect.android.storage.StoragePathProvider;
import org.odk.collect.android.storage.StorageSubdirectory;
import org.odk.collect.android.support.ActivityHelpers;
import org.odk.collect.android.support.pages.AddNewRepeatDialog;
import org.odk.collect.android.support.pages.FormEndPage;
import org.odk.collect.android.support.pages.FormEntryPage;
import org.odk.collect.android.support.pages.MainMenuPage;
Expand Down Expand Up @@ -546,43 +545,6 @@ public void missingFileMessage_shouldBeDisplayedIfExternalFileIsMissing() {
.clickFinalize();
}

@Test
public void groups_shouldBeVisibleInHierarchyView() {
//TestCase28
rule.startAtMainMenu()
.copyForm("nested-repeats-complex.xml")
.startBlankForm("nested-repeats-complex")
.swipeToNextQuestion("You will now be asked questions about your friends. When you see a dialog, tap \"Add\" until you have added all your friends.")
.swipeToNextQuestionWithRepeatGroup("Friends")
.clickOnAdd(new FormEntryPage("nested-repeats-complex"))
.inputText("La")
.swipeToNextQuestion("You will now be asked questions about La's pets. When you see a dialog, tap \"Add\" until you have added all of La's pets.")
.swipeToNextQuestionWithRepeatGroup("Pets")
.clickOnAdd(new FormEntryPage("nested-repeats-complex"))
.inputText("Le")
.swipeToNextQuestionWithRepeatGroup("Pets")
.clickOnAdd(new FormEntryPage("nested-repeats-complex"))
.inputText("Be")
.swipeToNextQuestionWithRepeatGroup("Pets")
.clickOnDoNotAdd(new AddNewRepeatDialog("Friends"))
.clickOnDoNotAdd(new AddNewRepeatDialog("Enemies"))
.clickOnAdd(new FormEntryPage("nested-repeats-complex"))
.inputText("Bu")
.swipeToNextQuestionWithRepeatGroup("Enemies")
.clickOnDoNotAdd(new FormEndPage("nested-repeats-complex"))
.clickGoToArrow()
.clickOnText("Friends")
.checkListSizeInHierarchy(1)
.clickOnElementInHierarchy(0)
.clickOnText("Pets")
.checkListSizeInHierarchy(2)
.clickGoUpIcon()
.clickGoUpIcon()
.clickGoUpIcon()
.clickOnText("Enemies")
.checkListSizeInHierarchy(1);
}

private String getQuestionText() {
FormFillingActivity formFillingActivity = (FormFillingActivity) ActivityHelpers.getActivity();
FrameLayout questionContainer = formFillingActivity.findViewById(R.id.text_container);
Expand Down