Skip to content

Commit

Permalink
Added named args to TopicPracticeFragmentTest (#2988)
Browse files Browse the repository at this point in the history
  • Loading branch information
Karanjot Singh authored Mar 23, 2021
1 parent 1f1e641 commit a69ce89
Showing 1 changed file with 46 additions and 46 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,9 @@ class TopicPracticeFragmentTest {
clickPracticeTab()
onView(
atPositionOnView(
R.id.topic_practice_skill_list,
0,
R.id.master_skills_text_view
recyclerViewId = R.id.topic_practice_skill_list,
position = 0,
targetViewId = R.id.master_skills_text_view
)
).check(
matches(
Expand All @@ -134,16 +134,16 @@ class TopicPracticeFragmentTest {
scrollToPosition(position = 5)
onView(
atPositionOnView(
R.id.topic_practice_skill_list,
5,
R.id.topic_practice_start_button
recyclerViewId = R.id.topic_practice_skill_list,
position = 5,
targetViewId = R.id.topic_practice_start_button
)
).check(matches(isCompletelyDisplayed()))
onView(
atPositionOnView(
R.id.topic_practice_skill_list,
5,
R.id.topic_practice_start_button
recyclerViewId = R.id.topic_practice_skill_list,
position = 5,
targetViewId = R.id.topic_practice_start_button
)
).check(matches(not(isClickable())))
}
Expand All @@ -156,17 +156,17 @@ class TopicPracticeFragmentTest {
clickPracticeItem(position = 1, targetViewId = R.id.subtopic_check_box)
onView(
atPositionOnView(
R.id.topic_practice_skill_list,
1,
R.id.subtopic_check_box
recyclerViewId = R.id.topic_practice_skill_list,
position = 1,
targetViewId = R.id.subtopic_check_box
)
).check(matches(isChecked()))
clickPracticeItem(position = 2, targetViewId = R.id.subtopic_check_box)
onView(
atPositionOnView(
R.id.topic_practice_skill_list,
2,
R.id.subtopic_check_box
recyclerViewId = R.id.topic_practice_skill_list,
position = 2,
targetViewId = R.id.subtopic_check_box
)
).check(matches(isChecked()))
}
Expand All @@ -181,9 +181,9 @@ class TopicPracticeFragmentTest {
scrollToPosition(position = 5)
onView(
atPositionOnView(
R.id.topic_practice_skill_list,
5,
R.id.topic_practice_start_button
recyclerViewId = R.id.topic_practice_skill_list,
position = 5,
targetViewId = R.id.topic_practice_start_button
)
).check(matches(isClickable()))
}
Expand All @@ -197,9 +197,9 @@ class TopicPracticeFragmentTest {
clickPracticeItem(position = 1, targetViewId = R.id.subtopic_check_box)
onView(
atPositionOnView(
R.id.topic_practice_skill_list,
1,
R.id.subtopic_check_box
recyclerViewId = R.id.topic_practice_skill_list,
position = 1,
targetViewId = R.id.subtopic_check_box
)
).check(matches(not(isChecked())))
}
Expand All @@ -215,9 +215,9 @@ class TopicPracticeFragmentTest {
testCoroutineDispatchers.runCurrent()
onView(
atPositionOnView(
R.id.topic_practice_skill_list,
5,
R.id.topic_practice_start_button
recyclerViewId = R.id.topic_practice_skill_list,
position = 5,
targetViewId = R.id.topic_practice_start_button
)
).check(matches(not(isClickable())))
}
Expand All @@ -243,9 +243,9 @@ class TopicPracticeFragmentTest {
onView(isRoot()).perform(orientationLandscape())
onView(
atPositionOnView(
R.id.topic_practice_skill_list,
1,
R.id.subtopic_check_box
recyclerViewId = R.id.topic_practice_skill_list,
position = 1,
targetViewId = R.id.subtopic_check_box
)
).check(matches(isChecked()))
}
Expand All @@ -259,18 +259,18 @@ class TopicPracticeFragmentTest {
testCoroutineDispatchers.runCurrent()
onView(
atPositionOnView(
R.id.topic_practice_skill_list,
5,
R.id.topic_practice_start_button
recyclerViewId = R.id.topic_practice_skill_list,
position = 5,
targetViewId = R.id.topic_practice_start_button
)
).check(matches(not(isClickable())))
onView(isRoot()).perform(orientationLandscape())
scrollToPosition(position = 5)
onView(
atPositionOnView(
R.id.topic_practice_skill_list,
5,
R.id.topic_practice_start_button
recyclerViewId = R.id.topic_practice_skill_list,
position = 5,
targetViewId = R.id.topic_practice_start_button
)
).check(matches(not(isClickable())))
}
Expand All @@ -286,9 +286,9 @@ class TopicPracticeFragmentTest {
testCoroutineDispatchers.runCurrent()
onView(
atPositionOnView(
R.id.topic_practice_skill_list,
5,
R.id.topic_practice_start_button
recyclerViewId = R.id.topic_practice_skill_list,
position = 5,
targetViewId = R.id.topic_practice_start_button
)
).check(matches(isClickable()))
}
Expand All @@ -300,9 +300,9 @@ class TopicPracticeFragmentTest {
clickPracticeTab()
onView(
atPositionOnView(
R.id.topic_practice_skill_list,
0,
R.id.master_skills_text_view
recyclerViewId = R.id.topic_practice_skill_list,
position = 0,
targetViewId = R.id.master_skills_text_view
)
).check(
matches(
Expand All @@ -314,9 +314,9 @@ class TopicPracticeFragmentTest {
onView(isRoot()).perform(orientationLandscape())
onView(
atPositionOnView(
R.id.topic_practice_skill_list,
0,
R.id.master_skills_text_view
recyclerViewId = R.id.topic_practice_skill_list,
position = 0,
targetViewId = R.id.master_skills_text_view
)
).check(
matches(
Expand Down Expand Up @@ -345,7 +345,7 @@ class TopicPracticeFragmentTest {
testCoroutineDispatchers.runCurrent()
onView(
allOf(
withText(TopicTab.getTabForPosition(2).name),
withText(TopicTab.getTabForPosition(position = 2).name),
isDescendantOfA(withId(R.id.topic_tabs_container))
)
).perform(click())
Expand All @@ -364,9 +364,9 @@ class TopicPracticeFragmentTest {
private fun clickPracticeItem(position: Int, targetViewId: Int) {
onView(
atPositionOnView(
R.id.topic_practice_skill_list,
position,
targetViewId
recyclerViewId = R.id.topic_practice_skill_list,
position = position,
targetViewId = targetViewId
)
).perform(click())
testCoroutineDispatchers.runCurrent()
Expand Down

0 comments on commit a69ce89

Please sign in to comment.