@@ -122,7 +122,7 @@ export class AppiumDriver {
122122 */
123123 public async findElementByXPath ( xPath : string , waitForElement : number = this . defaultWaitTime ) {
124124 const searchM = "waitForElementByXPath" ;
125- return await new UIElement ( await this . _driver . waitForElementByXPath ( xPath , waitForElement ) , this . _driver , this . _wd , this . _webio , searchM , xPath ) ;
125+ return await new UIElement ( await this . _driver . waitForElementByXPath ( xPath , waitForElement ) , this . _driver , this . _wd , this . _webio , this . _args , searchM , xPath ) ;
126126 }
127127
128128 /**
@@ -163,7 +163,7 @@ export class AppiumDriver {
163163 * @param waitForElement
164164 */
165165 public async findElementByClassName ( className : string , waitForElement : number = this . defaultWaitTime ) {
166- return new UIElement ( await this . _driver . waitForElementByClassName ( className , waitForElement ) , this . _driver , this . _wd , this . _webio , "waitForElementByClassName" , className ) ;
166+ return new UIElement ( await this . _driver . waitForElementByClassName ( className , waitForElement ) , this . _driver , this . _wd , this . _webio , this . _args , "waitForElementByClassName" , className ) ;
167167 }
168168
169169 /**
@@ -182,7 +182,7 @@ export class AppiumDriver {
182182 * @param waitForElement
183183 */
184184 public async findElementByAccessibilityId ( id , waitForElement : number = this . defaultWaitTime ) {
185- return new UIElement ( await this . _driver . waitForElementByAccessibilityId ( id , waitForElement ) , this . _driver , this . _wd , this . _webio , "waitForElementByAccessibilityId" , id ) ;
185+ return new UIElement ( await this . _driver . waitForElementByAccessibilityId ( id , waitForElement ) , this . _driver , this . _wd , this . _webio , this . _args , "waitForElementByAccessibilityId" , id ) ;
186186 }
187187
188188 /**
@@ -271,10 +271,10 @@ export class AppiumDriver {
271271 }
272272
273273 public async compareElement ( element : UIElement , imageName : string , ) {
274- return await this . compareRectangles ( await element . getRectangle ( ) , imageName ) ;
274+ return await this . compareRectangle ( await element . getActualRectangle ( ) , imageName ) ;
275275 }
276276
277- public async compareRectangles ( rect : IRectangle , imageName : string , timeOutSeconds : number = 3 , tollerance : number = 0.01 ) {
277+ public async compareRectangle ( rect : IRectangle , imageName : string , timeOutSeconds : number = 3 , tollerance : number = 0.01 ) {
278278 return await this . compare ( imageName , timeOutSeconds , tollerance , rect ) ;
279279 }
280280
@@ -452,7 +452,7 @@ export class AppiumDriver {
452452 return arrayOfUIElements ;
453453 }
454454 array . forEach ( async element => {
455- arrayOfUIElements . push ( new UIElement ( await element , this . _driver , this . _wd , this . _webio , searchM , args , i ) ) ;
455+ arrayOfUIElements . push ( new UIElement ( await element , this . _driver , this . _wd , this . _webio , this . _args , searchM , args , i ) ) ;
456456 i ++ ;
457457 } ) ;
458458
0 commit comments