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 {
293293 const size = await this . size ( ) ;
294294
295295 if ( direction === Direction . down || direction === Direction . up ) {
296+ if ( xOffset > 0 ) {
297+ location . x += xOffset ;
298+ }
296299 if ( yOffset === 0 ) {
297300 yOffset = location . y + size . height - 5 ;
298301 }
299302 }
300303
301304 if ( direction === Direction . left || direction === Direction . right ) {
305+ if ( yOffset > 0 ) {
306+ location . y += yOffset ;
307+ }
302308 if ( xOffset === 0 ) {
303309 xOffset = location . x + size . width - 5 ;
304310 }
@@ -330,7 +336,7 @@ export class UIElement {
330336 while ( el === null && retries >= 0 ) {
331337 try {
332338 el = await elementToSearch ( ) ;
333- if ( ! el || el === null || ! ( await el . isDisplayed ( ) ) ) {
339+ if ( ! el || el === null || ! ( el && await el . isDisplayed ( ) ) ) {
334340 el = null ;
335341 await this . scroll ( direction , yOffset , xOffset ) ;
336342 }
@@ -370,7 +376,7 @@ export class UIElement {
370376 if ( shouldClearText ) {
371377 await this . adbDeleteText ( adbDeleteCharsCount ) ;
372378 }
373- text = text . replace ( " " , "%s" ) ;
379+ text = text . replace ( " " , "%s" ) ;
374380 await this . click ( ) ;
375381 await adbShellCommand ( this . _driver , "input" , [ "text" , text ] ) ;
376382 } else {
You can’t perform that action at this time.
0 commit comments