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 @@ -110,7 +110,7 @@ export class AndroidDevice implements AndroidDevicePage {
110
110
) ;
111
111
}
112
112
const [ x , y ] = element . center ;
113
- await this . longPress ( x , y , param . duration ) ;
113
+ await this . longPress ( x , y , param ? .duration ) ;
114
114
} ,
115
115
} as DeviceAction < { duration ?: number } > ,
116
116
{
@@ -128,6 +128,9 @@ export class AndroidDevice implements AndroidDevicePage {
128
128
const startPoint = element
129
129
? { left : element . center [ 0 ] , top : element . center [ 1 ] }
130
130
: undefined ;
131
+ if ( ! param || ! param . direction ) {
132
+ throw new Error ( 'AndroidPull requires a direction parameter' ) ;
133
+ }
131
134
if ( param . direction === 'down' ) {
132
135
await this . pullDown ( startPoint , param . distance , param . duration ) ;
133
136
} 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