-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
iOS: Add pinch actions #1104
iOS: Add pinch actions #1104
Conversation
Updating description as I implemented the functions inside the generation process. Still have a few things to handle:
I also added a lot of type into "supported types" but I don't really understand what it is supposed to mean when we declare types are "supported" should I do something more inside other parts of the code ? |
I did the remapping from double to NSNumber and the generated GreyActions are working OK but I'm still not sure of how good a practice it is :) |
I realized I had generated a bunch of functions I didn't really know about by adding their arguments type to the supported types. Could you tell me more about what it does mean to add something in there, what kind of check am I supposed to do on variables before "supporting" them ? I need to support "double" but it also adds another action along with mines. I also don't know what tests to write to make the coverage up to 100% again, could you please give me a tip ? :) |
Seems like you managed with unit tests. I also saw you removed many types from iOS generator adapter, any reason for that? |
|
Making it 100% safe to merge will require addition of new E2E tests that will actually test this new API. |
@rotemmiz
"Making it 100% safe to merge will require addition of new E2E tests that will actually test this new API.
I still have a question: What is the aim of the the supported types array? Am I supposed to test some stuff before adding "double" in it ? I Also noted that the generator fails to generate a few functions because their type is not supported I'd love to remove these warnings but I don't want to manipulate these "supported types" before understanding what they mean :) |
Let's add @DanielMSchmidt to the conversation |
Hello @DanielMSchmidt I'm planning on working on e2e tests this week end and would love to have your feedback before I start implementing a e2e project with a react native maps as e2e test, what do you think ? Also I still don't really understand what is the aim of the "supportedTypes" array, if you know more about it i'd love to read from you :) Thank you for your time and help anyway. |
generation/core/generator.js
Outdated
@@ -70,6 +70,9 @@ module.exports = function getGenerator({ | |||
if (methodArg === null) { | |||
console.error(method); | |||
} | |||
if (!supportedTypes.includes(methodArg.type)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we have a separate map for this, which gives you the methods that could not be generated for each class due to which types.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right ! I'll take it off
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
I looked through it, seems good to me. Thank you for your patience 😇 |
@DanielMSchmidt Thank you very much for your review ! About the two questions I asked above:
|
We have a two-way contract: native side - client side. Both sides need to be able to handle the input of a type. We prevent generating methods for the client side that we can not use on the native side.
As @rotemmiz already said we would very much prefer a test case without an external dependency |
@rotemmiz @DanielMSchmidt. So I did add the ios e2e tests, now looking for android I'll check it these evening ! |
Hello @rotemmiz @DanielMSchmidt, I'm having trouble fixing the e2e tests on android as some of them look flaky. Here the stressTimeouts first test run three times in a row: I don't really understand why it would break like this from time to time, do you have any advice ? |
I've been investigating and it seems these tests have been switched from :ios: to cross platform in this PR It looks the CI was red and became green on a rerun, I also noticed the artifacts were not updated at the time. I'm re switching them to :ios: only for now, what do you think ? |
@rotemmiz @DanielMSchmidt, Hello guys, I've been adding some docs :) Do you see something missing in order to merge this first step ? In order to continue on the Android implementation, I have been looking at how it is done in Espresso and it looks like most people use UIAutomator in order to perform two swipes to realize the pinch gesture. If it looks ok to you guys I'll start implementing this ! :) |
@d4vidi Hello I'm adding you to the conversation as it looks you are pretty active these days :) |
Sorry for the delay @sraikimaxime, I'm going to take a look right now 💪 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would love to see some API docs for the newly added feature.
But besides this looks like a great PR, thank you very much 🎉
docs/Guide.Contributing.md
Outdated
1. In `detox/test` project, build the ios project with `npm run build:ios`. | ||
2. Run all end-to-end tests on iOS with `npm run e2e:ios`. | ||
3. Update the snapshots with: `npm run verify-artifacts:ios -- -u`. | ||
4. In `detox/test` project, build the ios project with `npm run build:android` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this line was added, did you mean to build the android project with this line?
4. In `detox/test` project, build the ios project with `npm run build:android` | |
4. In `detox/test` project, build the android project with `npm run build:android` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Totally right, fixing this :)
detox/test/e2e/12.animations.test.js
Outdated
@@ -51,7 +51,7 @@ describe('Animations', () => { | |||
await expect(element(by.id('UniqueId_AnimationsScreen_afterAnimationText'))).toNotExist(); | |||
}); | |||
|
|||
it(`should wait during delays shorter than 1.5s (driver: ${driver})`, async () => { | |||
it(`:ios: should wait during delays shorter than 1.5s (driver: ${driver})`, async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did you disable tests for Android?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as I said in this comment these tests look flaky? cause looks like coming from here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll try to run them from updated master and let you know the result
@@ -4,7 +4,7 @@ describe('StressTimeouts', () => { | |||
await element(by.text('Timeouts')).tap(); | |||
}); | |||
|
|||
it('should handle a short timeout', async () => { | |||
it(':ios: should handle a short timeout', async () => { | |||
await element(by.id('TimeoutShort')).tap(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did you disable tests for Android?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as I said in this comment these tests look flaky? cause looks like coming from here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll try to run them from updated master and let you know the result
@@ -4,10 +4,10 @@ exports[` 1`] = ` | |||
Array [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We stopped testing artifacts file snapshots, no need to change it. PR might need a rebase/merge from master.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok removing it + unupdating the doc :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still, shouldn't we remove this snapshot in this case ? if so I can do it in this PR :)
Thanks for this PR! |
@DanielMSchmidt Thank you ! I have added a small doc on APIRef.ActionsOnElement.md is there another place where you'd expect documentation ? |
seems fine to me |
hey @sraikimaxime, The PR looks good and I would like to merge it in, but still seems like artifact snapshot tests are deleted. We don't currently use them, but deleting them shouldn't be a part of this PR. Please revert their deletion, and we'll merge it in. |
af41b6a
to
7824c14
Compare
Thank you @rotemmiz ! :) Should I open a new PR to remove the artifacts ? |
Description:
This is the first step of the implementation of tools allowing to manipulate react-native-maps MapView. I'm opening this PR to have the earliest challenge on how I'm going forward.
##iOS
I've been looking to how EarlGrey proposes to manipulate maps but as far as my understanding goes, it only allows to swipe on it and pinch on it to handle the zoom. Therefore I've been testing to connect expect with earl grey's actionForPinchFastInDirectionWithAngle and actionForPinchSlowInDirectionWithAngle And managed to manipulate the map like in the gif I add to this description.
So far I've been able to zoom in, zoom out and move around in the react native maps thanks to these actions.
##Android
Haven't started yet :)