-
Notifications
You must be signed in to change notification settings - Fork 58
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 Paste UI Tests for Android #1100
Conversation
__device-tests__/helpers/utils.js
Outdated
const x = location.x + 220; | ||
const y = location.y - 50; | ||
action.press( { x, y } ); | ||
//action.wait( 1000 ); |
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 can probably remove this right?
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.
Yes, I'll push a commit to remove those. Initially, I wasn't sure if they were required, as I'd seen similar waits on examples online.
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, I've removed them.
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.
Hey @mkevins I spent some time looking at this and can't come up with a better way to paste the styled text. Though using the coordinates can be a bit unstable and I'd usually opt against it but in this case(checking the styled text) we can go with this for now and open an issue to track it and maybe look at how we can improve it in the future.
Otherwise, the code looks good to me! 👍🏽Thanks for adding this 🙇🏽♂️
__device-tests__/helpers/utils.js
Outdated
const location = await element.getLocation(); | ||
const action = await new wd.TouchAction( driver ); | ||
action.press( { x: location.x + 100, y: location.y - 50 } ); | ||
//action.wait( 1000 ); |
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.
And this one
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 will remove this.
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, I've removed them.
Description
This PR aims to implement UI tests for copying and pasting plain text and styled text from one paragraph block into another.
Since the copy and paste context menu items are not part of the application itself, the approach used to tap those buttons relies on specific x,y offsets from the active UI element. This may be somewhat brittle, and will likely require some tweaking for different platforms / OSs, however, in lieu of an alternative, I think there is some value in using such a workaround.
To test:
Run a device or emulator with Android 8.
(It may be necessary to specify the exact platform version of in the
caps.js
file https://github.com/wordpress-mobile/gutenberg-mobile/blob/develop/__device-tests__/helpers/caps.js#L16).Run the test:
TEST_RN_PLATFORM=android yarn device-tests __device-tests__/gutenberg-editor-paste.test.js
Screencast:
There are no user facing changes in this PR.
RELEASE-NOTES.txt
.