@@ -386,7 +386,7 @@ class Appium extends Webdriver {
386386 _buildAppiumEndpoint ( ) {
387387 const { protocol, port, hostname, path } = this . browser . options
388388 // Build path to Appium REST API endpoint
389- return `${ protocol } ://${ hostname } :${ port } ${ path } `
389+ return `${ protocol } ://${ hostname } :${ port } ${ path } /session/ ${ this . browser . sessionId } `
390390 }
391391
392392 /**
@@ -602,7 +602,7 @@ class Appium extends Webdriver {
602602
603603 return this . axios ( {
604604 method : 'post' ,
605- url : `${ this . _buildAppiumEndpoint ( ) } /session/ ${ this . browser . sessionId } / appium/device/remove_app` ,
605+ url : `${ this . _buildAppiumEndpoint ( ) } /appium/device/remove_app` ,
606606 data : { appId, bundleId } ,
607607 } )
608608 }
@@ -619,7 +619,7 @@ class Appium extends Webdriver {
619619 onlyForApps . call ( this )
620620 return this . axios ( {
621621 method : 'post' ,
622- url : `${ this . _buildAppiumEndpoint ( ) } /session/ ${ this . browser . sessionId } / appium/app/reset` ,
622+ url : `${ this . _buildAppiumEndpoint ( ) } /appium/app/reset` ,
623623 } )
624624 }
625625
@@ -693,7 +693,7 @@ class Appium extends Webdriver {
693693
694694 const res = await this . axios ( {
695695 method : 'get' ,
696- url : `${ this . _buildAppiumEndpoint ( ) } /session/ ${ this . browser . sessionId } / orientation` ,
696+ url : `${ this . _buildAppiumEndpoint ( ) } /orientation` ,
697697 } )
698698
699699 const currentOrientation = res . data . value
@@ -717,7 +717,7 @@ class Appium extends Webdriver {
717717
718718 return this . axios ( {
719719 method : 'post' ,
720- url : `${ this . _buildAppiumEndpoint ( ) } /session/ ${ this . browser . sessionId } / orientation` ,
720+ url : `${ this . _buildAppiumEndpoint ( ) } /orientation` ,
721721 data : { orientation } ,
722722 } )
723723 }
@@ -956,21 +956,19 @@ class Appium extends Webdriver {
956956 * ```js
957957 * // taps outside to hide keyboard per default
958958 * I.hideDeviceKeyboard();
959- * I.hideDeviceKeyboard('tapOutside');
960- *
961- * // or by pressing key
962- * I.hideDeviceKeyboard('pressKey', 'Done');
963959 * ```
964960 *
965961 * Appium: support Android and iOS
966962 *
967- * @param {'tapOutside' | 'pressKey' } [strategy] Desired strategy to close keyboard (‘tapOutside’ or ‘pressKey’)
968- * @param {string } [key] Optional key
969963 */
970- async hideDeviceKeyboard ( strategy , key ) {
964+ async hideDeviceKeyboard ( ) {
971965 onlyForApps . call ( this )
972- strategy = strategy || 'tapOutside'
973- return this . browser . hideKeyboard ( strategy , key )
966+
967+ return this . axios ( {
968+ method : 'post' ,
969+ url : `${ this . _buildAppiumEndpoint ( ) } /appium/device/hide_keyboard` ,
970+ data : { } ,
971+ } )
974972 }
975973
976974 /**
@@ -1046,7 +1044,13 @@ class Appium extends Webdriver {
10461044 * @param {* } locator
10471045 */
10481046 async tap ( locator ) {
1049- return this . makeTouchAction ( locator , 'tap' )
1047+ const { elementId } = await this . browser . $ ( parseLocator . call ( this , locator ) )
1048+
1049+ return this . axios ( {
1050+ method : 'post' ,
1051+ url : `${ this . _buildAppiumEndpoint ( ) } /element/${ elementId } /click` ,
1052+ data : { } ,
1053+ } )
10501054 }
10511055
10521056 /**
@@ -1493,7 +1497,14 @@ class Appium extends Webdriver {
14931497 */
14941498 async click ( locator , context ) {
14951499 if ( this . isWeb ) return super . click ( locator , context )
1496- return super . click ( parseLocator . call ( this , locator ) , parseLocator . call ( this , context ) )
1500+
1501+ const { elementId } = await this . browser . $ ( parseLocator . call ( this , locator ) , parseLocator . call ( this , context ) )
1502+
1503+ return this . axios ( {
1504+ method : 'post' ,
1505+ url : `${ this . _buildAppiumEndpoint ( ) } /element/${ elementId } /click` ,
1506+ data : { } ,
1507+ } )
14971508 }
14981509
14991510 /**
0 commit comments