-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
RTL: Add basic e2e test #29250
Comments
We do have RTL e2e tests but they actually "fake the language" to just test writing flow. Actually switching the language would be better but this would make most of our e2e test utils unusable (translations) |
Ah right: https://github.com/WordPress/gutenberg/blob/d06379316e3541e8c24ae29cf6855644c6f3eab6/packages/e2e-tests/specs/editor/various/rtl.test.js Thanks!
For a bug like #29248, a real language shouldn't even be required. Makes me wonder why our tests didn't flag the issue 🤔 Maybe it's really never been an issue on |
I had a look into the test's code and ran it locally, and I think I see why it didn't trigger the error: We're only setting two RTL flags in a fairly editor-specific context: gutenberg/packages/e2e-tests/specs/editor/various/rtl.test.js Lines 19 to 20 in d063793
It's really just the editing canvas that seems affected by this, whereas the overall editor chrome is still LTR. The following is a screenshot from running the test locally (via Compare that to a GB instance with an RTL language set (via Settings > General ( Note that e.g. the sidebar is on the left-hand side. So I think we might get away without installing a new language, but we should at least make sure the editor reflects an RTL language more faithfully in our e2e test. |
@akirk Maybe you have an idea what's the easiest way to do that? (See above for more context.) |
Maybe it's as simple as diff --git a/packages/e2e-tests/specs/editor/various/rtl.test.js b/packages/e2e-tests/specs/editor/various/rtl.test.js
index f14219d5b1..fae42b02cb 100644
--- a/packages/e2e-tests/specs/editor/various/rtl.test.js
+++ b/packages/e2e-tests/specs/editor/various/rtl.test.js
@@ -16,7 +16,7 @@ describe( 'RTL', () => {
beforeEach( async () => {
await createNewPost();
await page.evaluate( () => {
- document.querySelector( '.is-root-container' ).dir = 'rtl';
+ document.documentElement.dir = 'rtl';
wp.i18n.isRTL = () => true;
} );
} ); |
No, that doesn't seem to do the trick 😕 |
Closed by #29598. |
Gutenberg 10.0 and 10.1 have a regression for RTL languages that causes the editor to WSOD. We should add a basic e2e test to set the language to e.g. Hebrew and attempt to create a new post in order to cover against this kind of regression.
The text was updated successfully, but these errors were encountered: