Skip to content
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

E2E tests: consider to run all editor tests with the fullscreenMode preference enabled #69276

Open
2 of 6 tasks
afercia opened this issue Feb 21, 2025 · 3 comments · May be fixed by #69291
Open
2 of 6 tasks

E2E tests: consider to run all editor tests with the fullscreenMode preference enabled #69276

afercia opened this issue Feb 21, 2025 · 3 comments · May be fixed by #69291
Assignees
Labels
[Package] E2E Tests /packages/e2e-tests [Status] In Progress Tracking issues with work in progress [Type] Bug An existing feature does not function as intended

Comments

@afercia
Copy link
Contributor

afercia commented Feb 21, 2025

Description

Noticed while working on adding tests for #69190

By default, the Post editor has fullscreenMode enabled since a few years.
The Site editor has always been in full screen mode.

However, most of the e2e tests run with the fullscreenMode preferences set to false. This is relevant only for the Post editor but anyways the tests run with the UI in a state that doesn't faithfully represent the default state of the editor UI.

For context: in #69190 I wanted to test what the first focusable element in the page is after page load. I assumed it was the editor 'View Posts' link. However, since the editor isn't in full screen mode, the first focusable is in the WP admin UI instead.

Besides the test edge case scenario, it seems to me the most important consideration is that the UI state in the e2e tests isn't representative of the default UI state. This may lead to unexpected test results or wrong assumptions.

Step-by-step reproduction instructions

  • Run some Post editor tests with the --headed flag so that you can see the browser instance.
  • Observe the editor is not in full screen mode.

Screenshots, screen recording, code snippet

No response

Environment info

No response

Please confirm that you have searched existing issues in the repo.

  • Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

  • Yes

Please confirm which theme type you used for testing.

  • Block
  • Classic
  • Hybrid (e.g. classic with theme.json)
  • Not sure
@afercia afercia added [Package] E2E Tests /packages/e2e-tests [Type] Bug An existing feature does not function as intended labels Feb 21, 2025
@afercia
Copy link
Contributor Author

afercia commented Feb 21, 2025

I may be missing something but I can't see a good reason why the e2e tests should run with full screen mode disabled. Maybe it's just a 'legacy' configuration because the Post editor used to have full screen mode disabled by default but that changed many years ago. Pinging @Mamaduka and @t-hamano as way more familiar than me with e2e tests.

@t-hamano
Copy link
Contributor

I can't see a good reason why the e2e tests should run with full screen mode disabled.

I don't know exactly why, but I suspect it's to ensure that existing tests continue to work as they always have.

#20611 enabled fullscreen mode by default. At the same time, fullscreen mode was disabled in e2e tests (https://github.com/WordPress/gutenberg/pull/20611/files#diff-8ddd09a157b6d53a93fb7f3cd63d98cc2a1d57c6729f8acb7c4f662faac307eaR47-R53).

In the current e2e tests, fullscreen mode is disabled here and here. We could remove these lines or change the fallback value to true, but this might affect developers who are already using @worpdress/e2e-test-utils-playwright for their e2e tests.

Either way, I think it’s a good idea to check if all e2e tests pass in Gutenberg when fullscreen mode is enabled.

@github-actions github-actions bot added the [Status] In Progress Tracking issues with work in progress label Feb 24, 2025
@afercia
Copy link
Contributor Author

afercia commented Feb 24, 2025

I pushed #69291 to check whether the test pass with full screen mode enabled by default.

One more thing I would like to ask is about the Post Editor welcome guide modal. Although the welcomeGuide is disabled for the tests, I see it opens when running some tests. Not sure whether it's a matter of timing of it's some unexpected behavior.
For the tests, the opening of the welcome guide seems to be a waste of time and it potentially makes tests unreliable especially when testing focus and the like. Seems to me that, ideally, the welcome guide should be prevented unless testing specifically for its functionality. Any idea on why it's opening?

To reproduce: run this test suite in headed mode:
npm run test:e2e -- --headed editor/various/list-view.spec.js

see that for the first three teste the welcome guide opens.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Package] E2E Tests /packages/e2e-tests [Status] In Progress Tracking issues with work in progress [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants