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.
We can probably remove this right?
There was a problem hiding this comment.
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.
Ok, I've removed them.
JavonDavis
left a comment
There was a problem hiding this comment.
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.
I will remove this.
There was a problem hiding this comment.
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.jsfile 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.jsScreencast:
There are no user facing changes in this PR.
RELEASE-NOTES.txt.