-
-
Notifications
You must be signed in to change notification settings - Fork 48
Update BrowserStack test device to Samsung S20 #3759
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 10 commits
4c3bec7
6649602
f51f2dd
afc14fa
d0fd0e9
f75e168
51af23d
009f1fe
6e245c1
2f0db0b
7223c56
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 | ||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -57,6 +57,7 @@ public void testAttachmentUpload() { | |||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| onView(withText("Gather Signature")) | ||||||||||||||||||||||||
| .perform(click()); | ||||||||||||||||||||||||
| InstrumentationUtility.waitForView(instanceOf(DrawView.class), 5000, true); | ||||||||||||||||||||||||
| onView(instanceOf(DrawView.class)) | ||||||||||||||||||||||||
| .perform(new GeneralSwipeAction(Swipe.SLOW, GeneralLocation.CENTER_LEFT, GeneralLocation.TOP_RIGHT, Press.FINGER)); | ||||||||||||||||||||||||
|
Comment on lines
59
to
64
Contributor
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. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
# 1) Show the exact context in the test file around the reported lines
FILE="app/instrumentation-tests/src/org/commcare/androidTests/FormAttachmentUploadTest.java"
echo "---- Context: $FILE (lines 40-90) ----"
nl -ba "$FILE" | sed -n '40,90p'
# 2) Find InstrumentationUtility definition
echo "---- Locating InstrumentationUtility ----"
rg -n --hidden --no-ignore -S "class InstrumentationUtility|InstrumentationUtility" app/instrumentation-tests src . || true
# 3) Locate waitForView implementation/signature
echo "---- Locating waitForView(...) definition ----"
rg -n --hidden --no-ignore -S "waitForView\s*\(" . || true
# 4) Extract the method definition (best effort): show around matches
echo "---- Showing method bodies/usages around waitForView(...) ----"
rg -n --hidden --no-ignore -S "waitForView\s*\(" . | head -n 50
# If we can find a file that defines InstrumentationUtility, print around waitForView there
UTIL_FILE="$(rg -l --hidden --no-ignore -S "class InstrumentationUtility" . | head -n 1 || true)"
if [[ -n "${UTIL_FILE}" ]]; then
echo "---- Context: waitForView in $UTIL_FILE ----"
nl -ba "$UTIL_FILE" | sed -n '1,200p'
fi
# 5) Find other usages of waitForView(...) to see intended invocation pattern
echo "---- Other usages of InstrumentationUtility.waitForView(...) ----"
rg -n --hidden --no-ignore -S "InstrumentationUtility\.waitForView\s*\(" . | head -n 50Repository: dimagi/commcare-android Length of output: 247 🏁 Script executed: #!/bin/bash
set -euo pipefail
FILE="app/instrumentation-tests/src/org/commcare/androidTests/FormAttachmentUploadTest.java"
echo "---- Context: $FILE (lines 40-90) ----"
awk 'NR>=40 && NR<=90 {printf "%5d\t%s\n", NR, $0}' "$FILE"
echo "---- Locating InstrumentationUtility ----"
rg -n --no-ignore -S "class InstrumentationUtility|InstrumentationUtility" app/instrumentation-tests src . || true
echo "---- Locating waitForView(...) definition ----"
rg -n --no-ignore -S "waitForView\s*\(" . || true
echo "---- Showing a subset of usages around waitForView(...) ----"
rg -n --no-ignore -S "InstrumentationUtility\.waitForView\s*\(" . || true
# Show around the first definition we find for InstrumentationUtility (if any)
UTIL_FILE="$(rg -l --no-ignore -S "class InstrumentationUtility" . | head -n 1 || true)"
if [[ -n "${UTIL_FILE}" ]]; then
echo "---- Context: waitForView in $UTIL_FILE ----"
awk 'NR>=1 && NR<=220 {printf "%5d\t%s\n", NR, $0}' "$UTIL_FILE"
fiRepository: dimagi/commcare-android Length of output: 50442 🏁 Script executed: #!/bin/bash
set -euo pipefail
# 1) Show the top of the test file (imports + class header)
FILE="app/instrumentation-tests/src/org/commcare/androidTests/FormAttachmentUploadTest.java"
echo "---- File header/imports: $FILE ----"
awk 'NR>=1 && NR<=120 {print NR"\t"$0}' "$FILE"
# 2) Locate waitForView in InstrumentationUtility.kt
UTIL="app/instrumentation-tests/src/org/commcare/utils/InstrumentationUtility.kt"
if [[ -f "$UTIL" ]]; then
echo "---- waitForView matches in $UTIL ----"
rg -n --no-ignore -S "fun\s+waitForView|waitForView\s*\(" "$UTIL"
echo "---- Context around waitForView definition (approx) ----"
# Print regions around any "fun waitForView" line numbers
LINES="$(rg -n --no-ignore -S "fun\s+waitForView" "$UTIL" | cut -d: -f1 | tr '\n' ' ')"
for ln in $LINES; do
start=$((ln-20)); end=$((ln+80))
echo "---- Lines $start..$end around $ln ----"
awk -v s="$start" -v e="$end" 'NR>=s && NR<=e {print NR"\t"$0}' "$UTIL"
done
else
echo "InstrumentationUtility.kt not found at expected path: $UTIL"
fi
# 3) Search for usages in instrumentation tests only
echo "---- waitForView(...) usages under app/instrumentation-tests/src ----"
rg -n --no-ignore -S "InstrumentationUtility\.waitForView\s*\(|\bwaitForView\s*\(" app/instrumentation-tests/src --glob='*.{kt,java}' --glob='*.kt' --glob='*.java' | head -n 80Repository: dimagi/commcare-android Length of output: 9126 🏁 Script executed: rg -n "isRoot|waitForView" app/instrumentation-tests/src/org/commcare/androidTests/FormAttachmentUploadTest.javaRepository: dimagi/commcare-android Length of output: 154 Fix the waitForView step to actually execute in Espresso
Suggested fix+import static androidx.test.espresso.matcher.ViewMatchers.isRoot;
@@
- InstrumentationUtility.waitForView(instanceOf(DrawView.class), 5000, true);
+ onView(isRoot())
+ .perform(InstrumentationUtility.waitForView(instanceOf(DrawView.class), 5000, true));📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||
| onView(instanceOf(DrawView.class)) | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
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.
🧩 Analysis chain
🏁 Script executed:
Repository: dimagi/commcare-android
Length of output: 201
🏁 Script executed:
Repository: dimagi/commcare-android
Length of output: 1558
🏁 Script executed:
Repository: dimagi/commcare-android
Length of output: 1558
Use
withIdinstead ofwithTextforR.idmatcher inDialogTests.kt(Line 51)withText(R.id.choice_dialog_panel_2)uses the view-id integer as a text matcher, which can invalidate the assertion. Switch towithId(R.id.choice_dialog_panel_2).Proposed fix
📝 Committable suggestion
🤖 Prompt for AI Agents