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

Add duration of element.longPress for iOS #412

Merged
merged 2 commits into from
May 6, 2018

Conversation

jhen0409
Copy link
Contributor

Related to #410. I also added the test case Long Press Me 1.5s.

@jhen0409 jhen0409 force-pushed the longpress-duration branch 2 times, most recently from 6409603 to ec50f11 Compare November 16, 2017 16:18
Copy link
Member

@rotemmiz rotemmiz left a comment

Choose a reason for hiding this comment

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

Great PR! Thanks !
There are a few point I want to discuss before we merge it, please go over the notes.

super();
this._call = invoke.callDirectly(GreyActions.actionForLongPress());
if (duration) {
Copy link
Member

Choose a reason for hiding this comment

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

let's add default value, drop the condition, and use only GreyActions.actionForLongPressWithDuration

@@ -17,13 +17,18 @@ describe('Actions', () => {
await expect(element(by.text('Long Press Working!!!'))).toBeVisible();
});

it(':ios: should long press with duration on an element', async () => {
Copy link
Member

Choose a reason for hiding this comment

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

I don't want to create more discrepancy between iOS and Android API, I'm willing to help you add Android support as well if you need help.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah I also really want this feature can be supported for Android, if you could help will be great. Thanks. :)

it('should multi tap on an element', async () => {
await element(by.id('UniqueId819')).multiTap(3);
await expect(element(by.id('UniqueId819'))).toHaveText('Taps: 3');
});

it('should tap on an element at point', async () => {
await element(by.id('View7990')).tapAtPoint({x:180, y:140});
await element(by.id('View7990')).tapAtPoint({x:180, y:160});
Copy link
Member

Choose a reason for hiding this comment

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

Why was that changed ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I added a button for new test case, so the UniqueId819 button position was changed.

Copy link
Member

Choose a reason for hiding this comment

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

👍

@jhen0409 jhen0409 force-pushed the longpress-duration branch 3 times, most recently from 5984004 to 0f18872 Compare November 19, 2017 13:55
@@ -47,6 +47,7 @@ if (

// Constants
const SUPPORTED_TYPES = [
"CFTimeInterval",
Copy link
Contributor

Choose a reason for hiding this comment

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

🎉🎉🎉

@jozan
Copy link

jozan commented Jan 25, 2018

How is this progressing? Can I help somehow? We pretty much need this feature for both platforms. :)

@jozan
Copy link

jozan commented Feb 4, 2018

Alright, I started working on this feature based on this PR.

@rotemmiz
Copy link
Member

rotemmiz commented Feb 4, 2018

@jozan, for Android?

@jozan
Copy link

jozan commented Feb 5, 2018 via email

@stale
Copy link

stale bot commented Mar 22, 2018

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the 🏚 stale label Mar 22, 2018
@rotemmiz
Copy link
Member

Go away stale bot! Sorry for the huge delay. We have intention to merge this in.

@stale stale bot removed the 🏚 stale label Mar 22, 2018
@LeoNatan
Copy link
Contributor

LeoNatan commented May 4, 2018

Any news on this PR? Let’s merge for iOS and then in the future add for Android?

@rotemmiz
Copy link
Member

rotemmiz commented May 4, 2018

Yes, let's do it

@LeoNatan
Copy link
Contributor

LeoNatan commented May 4, 2018

@jhen0409 Could you please merge master and see that tests are not broken?

@jhen0409 jhen0409 requested a review from LeoNatan as a code owner May 5, 2018 08:10
@jhen0409
Copy link
Contributor Author

jhen0409 commented May 5, 2018

@LeoNatan 👌

@LeoNatan
Copy link
Contributor

LeoNatan commented May 5, 2018

Thanks!

@LeoNatan
Copy link
Contributor

LeoNatan commented May 5, 2018

@yershalom Jenkins is flaky, please look why.

Copy link
Contributor

@LeoNatan LeoNatan left a comment

Choose a reason for hiding this comment

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

Thanks for this PR.

I saw some style changes. Any reason those are needed?

@@ -65,9 +65,9 @@ class TapAtPointAction extends Action {
}

class LongPressAction extends Action {
constructor() {
constructor(duration = 750) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is the default 750? Is this what Earl Grey uses in the long press action?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I forgot the reason, but it should be 1000 for now.

Copy link
Contributor

Choose a reason for hiding this comment

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

Let's instead use the default. If no param is provided, let's call the current API, but if there is provided, let's call the new API.

@jhen0409 jhen0409 force-pushed the longpress-duration branch from 694e7ed to 996eb24 Compare May 5, 2018 11:17
@jhen0409
Copy link
Contributor Author

jhen0409 commented May 5, 2018

The some style changes caused by Prettier, I reverted it.

@LeoNatan
Copy link
Contributor

LeoNatan commented May 5, 2018

Cool. Let’s wait for the CI and I’ll merge. Thank you for your contribution!

@jhen0409 jhen0409 force-pushed the longpress-duration branch from 996eb24 to 5f1b6b0 Compare May 5, 2018 12:34
@jhen0409 jhen0409 force-pushed the longpress-duration branch from 5f1b6b0 to 72233dc Compare May 6, 2018 02:00
@LeoNatan LeoNatan merged commit 21f9a75 into wix:master May 6, 2018
@wix wix locked and limited conversation to collaborators Jul 23, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants