Skip to content

Commit bf588ec

Browse files
committed
fix: reduce uiscrollable complexity
1 parent ae293af commit bf588ec

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

run/test/specs/locators/settings.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ export class ConversationsMenuItem extends LocatorsInterface {
166166
return {
167167
strategy: '-android uiautomator',
168168
selector:
169-
'new UiScrollable(new UiSelector().className("android.widget.ScrollView")).scrollIntoView(new UiSelector().resourceId("Conversations"))',
169+
'new UiScrollable(new UiSelector().scrollable(true)).scrollIntoView(new UiSelector().resourceId("Conversations"))',
170170
} as const;
171171
case 'ios':
172172
return {
@@ -184,7 +184,7 @@ export class AppearanceMenuItem extends LocatorsInterface {
184184
return {
185185
strategy: '-android uiautomator',
186186
selector:
187-
'new UiScrollable(new UiSelector().className("android.widget.ScrollView")).scrollIntoView(new UiSelector().resourceId("Appearance"))',
187+
'new UiScrollable(new UiSelector().scrollable(true)).scrollIntoView(new UiSelector().resourceId("Appearance"))',
188188
} as const;
189189
case 'ios':
190190
return {
@@ -219,7 +219,7 @@ export class SelectAppIcon extends LocatorsInterface {
219219
return {
220220
strategy: '-android uiautomator',
221221
selector:
222-
'new UiScrollable(new UiSelector().className("android.widget.ScrollView")).scrollIntoView(new UiSelector().text("Select app icon"))',
222+
'new UiScrollable(new UiSelector().scrollable(true)).scrollIntoView(new UiSelector().text("Select app icon"))',
223223
} as const;
224224
case 'ios':
225225
return {
@@ -300,7 +300,7 @@ export class PathMenuItem extends LocatorsInterface {
300300
return {
301301
strategy: '-android uiautomator',
302302
selector:
303-
'new UiScrollable(new UiSelector().className("android.widget.ScrollView")).scrollIntoView(new UiSelector().resourceId("path-menu-item"))',
303+
'new UiScrollable(new UiSelector().scrollable(true)).scrollIntoView(new UiSelector().resourceId("path-menu-item"))',
304304
} as const;
305305
case 'ios':
306306
return {
@@ -318,7 +318,7 @@ export class VersionNumber extends LocatorsInterface {
318318
return {
319319
strategy: '-android uiautomator',
320320
selector:
321-
'new UiScrollable(new UiSelector().className("android.widget.ScrollView")).scrollIntoView(new UiSelector().textStartsWith("Version"))',
321+
'new UiScrollable(new UiSelector().scrollable(true)).scrollIntoView(new UiSelector().textStartsWith("Version"))',
322322
} as const;
323323
case 'ios':
324324
return {

run/types/testing.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -161,11 +161,11 @@ export type XPath =
161161
| `/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.ScrollView/android.widget.TabHost/android.widget.LinearLayout/android.widget.FrameLayout/androidx.viewpager.widget.ViewPager/android.widget.RelativeLayout/android.widget.GridView/android.widget.LinearLayout/android.widget.LinearLayout[2]`;
162162

163163
export type UiAutomatorQuery =
164-
| 'new UiScrollable(new UiSelector().className("android.widget.ScrollView")).scrollIntoView(new UiSelector().resourceId("Appearance"))'
165-
| 'new UiScrollable(new UiSelector().className("android.widget.ScrollView")).scrollIntoView(new UiSelector().resourceId("Conversations"))'
166-
| 'new UiScrollable(new UiSelector().className("android.widget.ScrollView")).scrollIntoView(new UiSelector().resourceId("path-menu-item"))'
167-
| 'new UiScrollable(new UiSelector().className("android.widget.ScrollView")).scrollIntoView(new UiSelector().text("Select app icon"))'
168-
| 'new UiScrollable(new UiSelector().className("android.widget.ScrollView")).scrollIntoView(new UiSelector().textStartsWith("Version"))'
164+
| 'new UiScrollable(new UiSelector().scrollable(true)).scrollIntoView(new UiSelector().resourceId("Appearance"))'
165+
| 'new UiScrollable(new UiSelector().scrollable(true)).scrollIntoView(new UiSelector().resourceId("Conversations"))'
166+
| 'new UiScrollable(new UiSelector().scrollable(true)).scrollIntoView(new UiSelector().resourceId("path-menu-item"))'
167+
| 'new UiScrollable(new UiSelector().scrollable(true)).scrollIntoView(new UiSelector().text("Select app icon"))'
168+
| 'new UiScrollable(new UiSelector().scrollable(true)).scrollIntoView(new UiSelector().textStartsWith("Version"))'
169169
| 'new UiSelector().resourceId("network.loki.messenger.qa:id/messageStatusTextView").text("Sent")'
170170
| 'new UiSelector().text("Enter your display name")'
171171
| `new UiSelector().resourceId("Conversation header name").childSelector(new UiSelector().resourceId("pro-badge-text"))`

0 commit comments

Comments
 (0)