File tree Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -15,9 +15,9 @@ export default class WaitCommandPlugin extends BasePlugin {
1515 async _find ( driver , locatorArgs ) {
1616 const strategy = locatorArgs [ 0 ] ;
1717 const selector = locatorArgs [ 1 ] ;
18- const automationName = this . _getAutomationName ( driver ) ;
18+ const baseUrl = this . _constructSessionUrl ( driver ) ;
1919 const response = await fetch (
20- `http:// ${ driver [ automationName ] . host } : ${ driver [ automationName ] . systemPort } / wd/hub/session/${ driver . sessionId } /element` ,
20+ `${ baseUrl } wd/hub/session/${ driver . sessionId } /element` ,
2121 {
2222 body : JSON . stringify ( {
2323 strategy,
@@ -42,6 +42,15 @@ export default class WaitCommandPlugin extends BasePlugin {
4242 }
4343
4444 _getAutomationName ( driver ) {
45- return driver . caps . automationName . toLowerCase ( ) ;
45+ return driver . caps . automationName ;
46+ }
47+
48+ _constructSessionUrl ( driver ) {
49+ const automationName = this . _getAutomationName ( driver ) ;
50+ if ( automationName === 'XCuiTest' ) {
51+ return `${ driver . wda . wdaBaseUrl } :${ driver . wda . wdaLocalPort } /` ;
52+ } else {
53+ return `http://${ driver [ automationName ] . host } :${ driver [ automationName ] . systemPort } /` ;
54+ }
4655 }
4756}
You can’t perform that action at this time.
0 commit comments