File tree Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -111,7 +111,7 @@ export class AndroidDevice implements AndroidDevicePage {
111
111
) ;
112
112
}
113
113
const [ x , y ] = element . center ;
114
- await this . longPress ( x , y , param . duration ) ;
114
+ await this . longPress ( x , y , param ? .duration ) ;
115
115
} ,
116
116
} as DeviceAction < { duration ?: number } > ,
117
117
{
@@ -129,6 +129,9 @@ export class AndroidDevice implements AndroidDevicePage {
129
129
const startPoint = element
130
130
? { left : element . center [ 0 ] , top : element . center [ 1 ] }
131
131
: undefined ;
132
+ if ( ! param || ! param . direction ) {
133
+ throw new Error ( 'AndroidPull requires a direction parameter' ) ;
134
+ }
132
135
if ( param . direction === 'down' ) {
133
136
await this . pullDown ( startPoint , param . distance , param . duration ) ;
134
137
} else if ( param . direction === 'up' ) {
Original file line number Diff line number Diff line change @@ -16,6 +16,10 @@ describe(
16
16
} ) ;
17
17
18
18
await agent . launch ( 'com.android.settings/.Settings' ) ;
19
+ await agent . aiAction ( 'pull down to refresh' ) ;
20
+ await agent . aiAction ( 'long press chat list first chat' ) ;
21
+ await agent . aiAction ( 'click recent apps button' ) ;
22
+ await agent . aiAction ( 'click android home button' ) ;
19
23
await agent . aiAction ( 'scroll list to bottom' ) ;
20
24
await agent . aiAction ( 'open "More settings"' ) ;
21
25
await agent . aiAction ( 'scroll left until left edge' ) ;
You can’t perform that action at this time.
0 commit comments