Skip to content

Commit

Permalink
refactor: Prefer action to touchAction
Browse files Browse the repository at this point in the history
Avoid the deprecated `touchAction` command.

> The `touchAction` command is deprecated and will be removed in a future version. We recommend to use the action command instead with pointer type touch, e.g.:
>
> await browser.action('pointer', {
>   parameters: { pointerType: 'touch' }
> })

https://webdriver.io/docs/api/element/touchAction/

This may also relate to the fact that Mobile JSON Wire Protocol is
deprecated as well.

> Mobile JSON Wire Protocol
>
> The Mobile JSON Wire Protocol is a super set of mobile commands on top of the JSON Wire Protocol. Given this one is deprecated the Mobile JSON Wire Protocol also got deprecated. Appium might still support some of its commands but it is not recommended to use them.

https://webdriver.io/docs/api/protocols#mobile-json-wire-protocol
  • Loading branch information
dcalhoun committed Oct 16, 2023
1 parent 7bb46de commit bf527ee
Showing 1 changed file with 10 additions and 20 deletions.
30 changes: 10 additions & 20 deletions packages/react-native-editor/__device-tests__/helpers/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -450,26 +450,16 @@ const swipeFromTo = async (
to = defaultCoordinates,
delay
) =>
driver.touchPerform( [
{
action: 'press',
options: from,
},
{
action: 'wait',
options: {
ms: delay,
},
},
{
action: 'moveTo',
options: to,
},
{
action: 'release',
options: {},
},
] );
await driver
.action( 'pointer', {
parameters: { pointerType: 'touch' },
} )
.move( { ...from, duration: 0 } )
.down( { button: 0 } )
.move( { ...to, duration: 300 } )
.up( { button: 0 } )
.pause( delay )
.perform();

// Starts from the middle of the screen and swipes downwards
const swipeDown = async ( driver, delay = 3000 ) => {
Expand Down

0 comments on commit bf527ee

Please sign in to comment.