Skip to content

Adds MultiTouch Gesture Template and examples using it with zoom in and zoom out #85

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

Merged
merged 9 commits into from
Nov 21, 2024

Conversation

DancingNerd
Copy link
Contributor

No description provided.

Copy link

@simonychoy simonychoy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think these scripts work as intended with the current percentages used, unless I am misreading this.

@DancingNerd DancingNerd changed the title Adds zoom in and out multi-touch gesture snippets for mobile Adds MultiTouch Gesture Template and examples using it with zoom in and zoom out Nov 19, 2024
Comment on lines +541 to +548
const x =
(1 - t) * (1 - t) * start.x +
2 * (1 - t) * t * control.x +
t * t * end.x;
const y =
(1 - t) * (1 - t) * start.y +
2 * (1 - t) * t * control.y +
t * t * end.y;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🙃 🤯

Copy link

@simonychoy simonychoy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, just have a few minor things to update.

@DancingNerd DancingNerd merged commit 50ef960 into main Nov 21, 2024
@DancingNerd DancingNerd deleted the mobile-zoom branch November 21, 2024 17:56
@@ -55,18 +55,22 @@ function mablJavaScriptStep(mablInputs, callback) {
1. Create a new element object.
`const element = new MobileElement();` //=> Create a new element object

2. Find the element or get screen information.
2. Find the element or just get the screen location and be done.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
2. Find the element or just get the screen location and be done.
2. Find the element or just get the screen location.

const image = await new MobileElement().findByXpath("//XCUIElementTypeImage");
await new MultiTouch().zoomIn(image.center).perform();
await new MultiTouch().zoomOut(image.center).perform();
## One vertical swipe and one horizontal swipe at the same time

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is a vertical swipe followed by a horizontal swipe right? Was confused about the "at the same time" phrasing here.

* @private
*/
async waitUntilLoop() {
this.count++;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: I think it would be better to name this loopCount to be a bit more descriptive.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants