File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -293,12 +293,18 @@ export class UIElement {
293
293
const size = await this . size ( ) ;
294
294
295
295
if ( direction === Direction . down || direction === Direction . up ) {
296
+ if ( xOffset > 0 ) {
297
+ location . x += xOffset ;
298
+ }
296
299
if ( yOffset === 0 ) {
297
300
yOffset = location . y + size . height - 5 ;
298
301
}
299
302
}
300
303
301
304
if ( direction === Direction . left || direction === Direction . right ) {
305
+ if ( yOffset > 0 ) {
306
+ location . y += yOffset ;
307
+ }
302
308
if ( xOffset === 0 ) {
303
309
xOffset = location . x + size . width - 5 ;
304
310
}
@@ -330,7 +336,7 @@ export class UIElement {
330
336
while ( el === null && retries >= 0 ) {
331
337
try {
332
338
el = await elementToSearch ( ) ;
333
- if ( ! el || el === null || ! ( await el . isDisplayed ( ) ) ) {
339
+ if ( ! el || el === null || ! ( el && await el . isDisplayed ( ) ) ) {
334
340
el = null ;
335
341
await this . scroll ( direction , yOffset , xOffset ) ;
336
342
}
@@ -370,7 +376,7 @@ export class UIElement {
370
376
if ( shouldClearText ) {
371
377
await this . adbDeleteText ( adbDeleteCharsCount ) ;
372
378
}
373
- text = text . replace ( " " , "%s" ) ;
379
+ text = text . replace ( " " , "%s" ) ;
374
380
await this . click ( ) ;
375
381
await adbShellCommand ( this . _driver , "input" , [ "text" , text ] ) ;
376
382
} else {
You can’t perform that action at this time.
0 commit comments