Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Mobile] E2E Tests Update usage of touchPerform #55609

Merged
merged 4 commits into from
Oct 25, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
82 changes: 35 additions & 47 deletions packages/react-native-editor/__device-tests__/helpers/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -280,25 +280,27 @@ const clickMiddleOfElement = async ( driver, element ) => {
const location = await element.getLocation();
const size = await element.getSize();

await driver.touchPerform( [
{
action: 'press',
options: { x: location.x + size.width / 2, y: location.y },
},
{ action: 'release' },
] );
await driver
.action( 'pointer', {
parameters: { pointerType: 'touch' },
} )
.move( { x: location.x + size.width / 2, y: location.y } )
.down()
.up()
.perform();
};

// Clicks in the top left of an element.
const clickBeginningOfElement = async ( driver, element ) => {
const location = await element.getLocation();
await driver.touchPerform( [
{
action: 'press',
options: { x: location.x, y: location.y },
},
{ action: 'release' },
] );
await driver
.action( 'pointer', {
parameters: { pointerType: 'touch' },
} )
.move( { x: location.x, y: location.y } )
.down()
.up()
.perform();
};

// Long press to activate context menu.
Expand Down Expand Up @@ -339,22 +341,15 @@ const longPressMiddleOfElement = async (
};

const tapStatusBariOS = async ( driver ) => {
await driver.touchPerform( [
{
action: 'press',
options: { x: 20, y: 20 },
},
{
action: 'wait',
options: {
ms: 100,
},
},
{
action: 'release',
options: {},
},
] );
await driver
.action( 'pointer', {
parameters: { pointerType: 'touch' },
} )
.move( { x: 20, y: 20 } )
.down()
.up()
.pause( 100 )
.perform();

// Wait for the scroll animation to finish
await driver.pause( 3000 );
Expand Down Expand Up @@ -481,23 +476,16 @@ const dragAndDropAfterElement = async ( driver, element, nextElement ) => {
? elementLocation.y + nextElementLocation.y + nextElementSize.height
: nextElementLocation.y + nextElementSize.height;

await driver.touchPerform( [
{
action: 'press',
options: { x, y },
},
{
action: 'wait',
options: {
ms: 5000,
},
},
{
action: 'moveTo',
options: { x, y: nextYPosition },
},
{ action: 'release' },
] );
await driver
.action( 'pointer', {
parameters: { pointerType: 'touch' },
} )
.move( { x, y } )
.down()
.pause( 5000 )
.move( { x, y: nextYPosition, duration: 500 } )
.up()
.perform();
};

const toggleHtmlMode = async ( driver, toggleOn ) => {
Expand Down
Loading