-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Paste text instead of typing in Gutenberg UI tests #21134
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
Conversation
|
| App Name | Jetpack Alpha |
|
| Configuration | Release-Alpha | |
| Build Number | pr21134-59cb230 | |
| Version | 22.8 | |
| Bundle ID | com.jetpack.alpha | |
| Commit | 59cb230 | |
| App Center Build | jetpack-installable-builds #5456 |
|
| App Name | WordPress Alpha |
|
| Configuration | Release-Alpha | |
| Build Number | pr21134-59cb230 | |
| Version | 22.8 | |
| Bundle ID | org.wordpress.alpha | |
| Commit | 59cb230 | |
| App Center Build | WPiOS - One-Offs #6428 |
|
👋 @mokagio sorry for the delay From a quick look, my first suggestion would be to use Another one is probably to try using (both 👆 work locally but have not been tested in CI so not sure how helpful they'll be) |
|
@jostnes Following this comment I shared in the other PR, I tried the approaches you shared but none seemed to work when running the tests locally in a simulator. You mentioned that worked on your end, but I assume it worked because this PR is not yet using the new React Native version 0.71.11. Once we merge #20956, it's likely that won't work. |
@fluiddot is #20956 the PR with the new RN version? i can take a look if there are other alternatives while using that PR and will let y'all know if there are any alternatives. in the meantime, using @mokagio's would be the best bet for now |
|
Yes, that PR uses the new RN versions but also incorporates the workaround Gio provided (#21143).
Great, thanks! I couldn't narrow down the culprit of the issue, but it's likely that the new version of RN is rendering text elements differently than before 🤔 . |
|
i found the reason it stopped working after the RN update. before the update the element tree looks like this: see that after the update, this is the element tree:
is this something that could be fixed from RN side? another thing we could try is using the keyboard to send the individual keys of the text, which is also a bit hacky and might take a longer time. i think for now, the paste text solution is the best bet for this not to fail |
|
Nice findings @jostnes, thanks for investigating the issue 🙇 !
Good question. I haven't found any open ticket in the React Native repository related to this. So, I'm not sure if this is a known issue. We'd need to investigate how the new version of RN is rendering
Yeah, I agree. For now, the approach of pasting text should work. Maybe in the future, if we need to check a specific behavior in the editor that needs typing, we can explore an alternative. |
|
Given the issue has been verified in different ways to be related to the React Native upgrade, and that this work is already part of the corresponding branch here, see 4530832, I'm going to close this PR. |


We are seeing UI tests in the editor in the branches that updated the Gutenberg integration to use a new version of React Native, a new Javascript engine, and a new distribution mode. Those are a lot of core changes, so it's not that surprising some assumptions no longer hold, in particular when there is React Native involved.
Here's an example of a failure, which can be seen here or here
I spent some time trying to make the standard approach work, including changing the element query to run on the
textViews[...].firstMatchdirectly, but it didn't work. I'm not particularly happy with the approach I ended up with, but it's the only one I could make to work.You can see the tests in this build, from which I cherry-picked, pass, while the ones in the previous runs failed.
I'm opening this PR against
trunkto:typeTextswas shown to work, tooRegression Notes
PR submission checklist:
RELEASE-NOTES.txtif necessary. N.A.UI changes testing checklist: Not a UI PR.