-
-
Notifications
You must be signed in to change notification settings - Fork 45
Merge layout navigations in dv connect initial #3104
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
Changes from all commits
bf55933
d882931
4468235
4660af3
026222a
b920607
2432ac4
f2cf7ff
6c36f9c
6d25ea2
8fcc48c
04e176e
e5ce498
21152d4
e5f6bba
3f05061
31a6329
6876262
6239f12
592ab65
5d4346b
52811f0
31e68d9
e08da79
cfa2f31
666bbec
0e9b2f3
698876b
ea17917
fede028
2874e88
8a24825
f3b66c4
2ccd722
3636000
6d83e4d
b759f1f
6730f41
a59a670
a45de98
f0ea8d7
9dd796f
12043ea
3b8ab30
e2608f9
5907041
99b1dcb
818b08e
b939e61
985560b
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 |
|---|---|---|
|
|
@@ -26,6 +26,9 @@ import androidx.test.espresso.ViewAction | |
| import androidx.test.espresso.ViewInteraction | ||
| import androidx.test.espresso.action.ViewActions.clearText | ||
| import androidx.test.espresso.action.ViewActions.click | ||
| import androidx.test.espresso.action.ViewActions.closeSoftKeyboard | ||
| import androidx.test.espresso.action.ViewActions.repeatedlyUntil | ||
| import androidx.test.espresso.action.ViewActions.replaceText | ||
| import androidx.test.espresso.action.ViewActions.swipeUp | ||
| import androidx.test.espresso.action.ViewActions.typeText | ||
| import androidx.test.espresso.assertion.ViewAssertions.matches | ||
|
|
@@ -34,6 +37,7 @@ import androidx.test.espresso.intent.Intents.intending | |
| import androidx.test.espresso.intent.matcher.IntentMatchers | ||
| import androidx.test.espresso.intent.matcher.IntentMatchers.hasAction | ||
| import androidx.test.espresso.matcher.RootMatchers | ||
| import androidx.test.espresso.matcher.ViewMatchers.hasDescendant | ||
| import androidx.test.espresso.matcher.ViewMatchers.hasSibling | ||
| import androidx.test.espresso.matcher.ViewMatchers.isAssignableFrom | ||
| import androidx.test.espresso.matcher.ViewMatchers.isDisplayed | ||
|
|
@@ -208,7 +212,13 @@ object InstrumentationUtility { | |
| @JvmStatic | ||
| fun logout() { | ||
| gotoHome() | ||
| onView(withId(R.id.home_gridview_buttons)) | ||
| onView(withId(R.id.nsv_home_screen)) | ||
| .perform(swipeUp()) | ||
| onView(withId(R.id.nsv_home_screen)) // multiple swipe | ||
| .perform(swipeUp()) // to make `logout` button visible as it may have large scroll | ||
| onView(withId(R.id.nsv_home_screen)) | ||
| .perform(swipeUp()) | ||
| onView(withId(R.id.nsv_home_screen)) | ||
| .perform(swipeUp()) | ||
| onView(withText("Log out of CommCare")) | ||
|
Comment on lines
+215
to
223
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. 🛠️ Refactor suggestion Four hard-coded Manually invoking Replace the block with: onView(withId(R.id.nsv_home_screen))
.perform(
repeatedlyUntil(
swipeUp(),
hasDescendant(withText("Log out of CommCare")),
10 // max attempts
)
)This leverages the import you already added, removes magic numbers, and self-adapts to screen size changes. 🤖 Prompt for AI Agents (early access) |
||
| .perform(click()) | ||
|
|
@@ -306,10 +316,7 @@ object InstrumentationUtility { | |
| @JvmStatic | ||
| fun enterText(@IdRes editTextId: Int, text: String) { | ||
| onView(withId(editTextId)) | ||
| .perform(clearText()) | ||
| onView(withId(editTextId)) | ||
| .perform(typeText(text)) | ||
| Espresso.closeSoftKeyboard() | ||
| .perform(click(), replaceText(text), closeSoftKeyboard()) | ||
| } | ||
|
|
||
| fun enterText(text: String) { | ||
|
|
||
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.
Review inconsistent key naming for Wi-Fi Direct
The key
wifi.direct.wifi.direct.offredundantly repeatswifi.direct. Consider renaming towifi.direct.offor similar to maintain a consistent key hierarchy.🤖 Prompt for AI Agents (early access)