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

#129 fix #130

Merged
merged 5 commits into from Oct 31, 2014
Merged

#129 fix #130

merged 5 commits into from Oct 31, 2014

Conversation

TikhomirovSergey
Copy link
Contributor

MobileElement is touchable now. Here are available methods:

/**
     * Convenience method for tapping the center of the given element
     * 
     * @param fingers
     *            number of fingers/appendages to tap with
     * @param duration
     *            how long between pressing down, and lifting fingers/appendages
     */
element.tap(int fingers, int duration);

/**
    * Convenience method for pinching the given element.
    * "pinching" refers to the action of two appendages pressing the screen and sliding towards each other.
    * NOTE:
    * This convenience method places the initial touches around the element, if this would happen to place one of them
    * off the screen, appium with return an outOfBounds error. In this case, revert to using the MultiTouchAction api
    * instead of this method.
    *
*/
element.pinch();

/**
       * Convenience method for "zooming in" on the given element.
       * "zooming in" refers to the action of two appendages pressing the screen and sliding away from each other.
       * NOTE:
       * This convenience method slides touches away from the element, if this would happen to place one of them
       * off the screen, appium will return an outOfBounds error. In this case, revert to using the MultiTouchAction api
       * instead of this method.
       */
element.zoom();

/**
         * Convenience method for swiping across the given element
         *
         * @param duration
         *            amount of time in milliseconds for the entire swipe action to
         *            take
         */
element.swipe(int duration);

@Jonahss
Copy link
Member

Jonahss commented Oct 28, 2014

Awesome.
For swipe, right now it swipes from upper left to lower right of the element? How about changing it to accept a direction parameter so the user can specify up,down,left,right. Not sure how useful the diagonal swipe would be

@TikhomirovSergey
Copy link
Contributor Author

For swipe, right now it swipes from upper left to lower right of the element?

Yeah. I implemented it so for a while.

How about changing it to accept a direction parameter so the user can specify up,down,left,right. Not >sure how useful the diagonal swipe would be

I am agree with you. But I have a question. Should we perform the swipping from the upper left or from the center if direction is specified?

I think we can use both swippings. The first is here, the second (with direction) I am going to implement tomorrow.

@TikhomirovSergey
Copy link
Contributor Author

How about my variants:

  • right - from left side (mid y, not corner) to right
  • left - from right side (mid y, not corner) to left
  • up - from lower to upper (mid x)
  • down - from upper to lower (mid x)

?

@Jonahss
Copy link
Member

Jonahss commented Oct 28, 2014

👍 yup, that's exactly what I was imagining.

On Tue, Oct 28, 2014 at 3:01 PM, Sergey Tikhomirov <notifications@github.com

wrote:

How about my variants:

right - from left side (mid y, not corner) to right

left - from right side (mid y, not corner) to left

up - from lower to upper (mid x)

down - from upper to lower (mid x)

?


Reply to this email directly or view it on GitHub
#130 (comment).

@TikhomirovSergey
Copy link
Contributor Author

Hey! I've finished.
Now we can to perform directed swipe. If there is no direction diagonal swipe is performed.

I think it + previous modifications are enough for a new release. What do you think? Let produce it if there is ok. :)

@Jonahss
Copy link
Member

Jonahss commented Oct 30, 2014

Yeah definitely merits a new release.
Do you think diagonal swipe as default is useful? I think it should just require an argument and not have a default. I'm not sure when a diagonal swipe is ever really useful for anybody. What do you think?

@TikhomirovSergey
Copy link
Contributor Author

Ok @Jonahss
I had thought and decided to remove diagonal swiping. There are UP, DOWN, LEFT, RIGHT for a while. If people want diagonal swiping we can extend SwipeElementDirection by addition of DIAGONAL_LEFT_RIGHT and DIAGONAL_RIGHT_LEFT elements

@Jonahss
Copy link
Member

Jonahss commented Oct 31, 2014

Cool. working on testing now, and will then release

@Jonahss
Copy link
Member

Jonahss commented Oct 31, 2014

I ran into a problem :( It doesn't work in web views because the 'perform' command has to be in the NATIVE_CONTEXT but the element is in the WEBVIEW context. I'm going to see if I can fix the relevant appium code. When I deleted a few lines, it works :)

@TikhomirovSergey
Copy link
Contributor Author

I know that it works with native content and there are problems with WEBVIEW (perform is not implemented command). But I have thought that it is known issue which is going to be fixed :(

@Jonahss
Copy link
Member

Jonahss commented Oct 31, 2014

Yeah I didn't know it was an issue. I'll just see if I can fix it now.

Jonahss added a commit that referenced this pull request Oct 31, 2014
@Jonahss Jonahss merged commit 7bc291d into appium:master Oct 31, 2014
@TikhomirovSergey
Copy link
Contributor Author

Thanks :) What with WebView?

@Jonahss
Copy link
Member

Jonahss commented Oct 31, 2014

Yeah I'm working on it. I've got it working on iOS just fine, and Android will require a little work but I've got it working :)

@Jonahss
Copy link
Member

Jonahss commented Oct 31, 2014

I'll publish latest after I fix appium up

@TikhomirovSergey
Copy link
Contributor Author

@Jonahss
Is it relevant issue? appium/appium#3896
If it is I think it should be reopened as you are trying to work out this problem.

@Jonahss
Copy link
Member

Jonahss commented Nov 3, 2014

Created a new issue: appium/appium#3960

@mihirsasmal
Copy link

Is it implemented for C# client ?

@TikhomirovSergey
Copy link
Contributor Author

It is implemented for java client for a while.

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

Successfully merging this pull request may close these issues.

None yet

3 participants