Skip to content

Test: improve document settings sidebar locator #70331

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

alejandrogonzalvo
Copy link
Contributor

What?

Closes #70330

Currently, the editor.openDocumentSettingsSidebar() of the @wordpress/e2e-test-utils-playwright uses this Locator to match the Open Settings Icon:

const toggleButton = this.page
		.getByRole( 'region', { name: 'Editor top bar' } )
		.getByRole( 'button', {
			name: 'Settings',
			disabled: false,
		} );

Why?

It improves the usage for future tests and users that use this library outside the gutenberg repo (AKA myself).

How?

This could be resolved by improving the locator as follows:

const toggleButton = this.page
		.getByRole( 'region', { name: 'Editor top bar' } )
		.getByRole( 'button', {
			name: 'Settings',
                        exact: true,
			disabled: false,
		} );

Testing Instruction

this tests affects a helper function for the e2e tests, so if the CI passes, it is fine.

Copy link

github-actions bot commented Jun 5, 2025

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

Unlinked Accounts

The following contributors have not linked their GitHub and WordPress.org accounts: @alejandro.gonzalvo.hidalgo@cern.ch.

Contributors, please read how to link your accounts to ensure your work is properly credited in WordPress releases.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Unlinked contributors: alejandro.gonzalvo.hidalgo@cern.ch.

Co-authored-by: alejandrogonzalvo <alejandrogonzalvo@git.wordpress.org>
Co-authored-by: Mamaduka <mamaduka@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

Copy link

github-actions bot commented Jun 5, 2025

👋 Thanks for your first Pull Request and for helping build the future of Gutenberg and WordPress, @alejandrogonzalvo! In case you missed it, we'd love to have you join us in our Slack community.

If you want to learn more about WordPress development in general, check out the Core Handbook full of helpful information.

@github-actions github-actions bot added the First-time Contributor Pull request opened by a first-time contributor to Gutenberg repository label Jun 5, 2025
@alejandrogonzalvo
Copy link
Contributor Author

@Mamaduka I pushed the improvement for the locator, it says I need to add a label to the MR but I believe you need to do that as I don't have permissions :)

I have also linked my Github account to my MR

@Mamaduka Mamaduka added [Type] Enhancement A suggestion for improvement. [Tool] E2E Test Utils /packages/e2e-test-utils labels Jun 5, 2025
Copy link
Member

@Mamaduka Mamaduka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, @alejandrogonzalvo and congrats on your first contribution to the project!

@Mamaduka Mamaduka merged commit 88424c0 into WordPress:trunk Jun 5, 2025
66 of 67 checks passed
@github-actions github-actions bot added this to the Gutenberg 21.1 milestone Jun 5, 2025
@talldan talldan changed the title test: improve document settings sidebar locator Test: improve document settings sidebar locator Jun 25, 2025
@talldan talldan added [Type] Automated Testing Testing infrastructure changes impacting the execution of end-to-end (E2E) and/or unit tests. and removed [Type] Enhancement A suggestion for improvement. labels Jun 25, 2025
chriszarate pushed a commit to chriszarate/gutenberg that referenced this pull request Jul 1, 2025
Unlinked contributors: alejandro.gonzalvo.hidalgo@cern.ch.

Co-authored-by: alejandrogonzalvo <alejandrogonzalvo@git.wordpress.org>
Co-authored-by: Mamaduka <mamaduka@git.wordpress.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
First-time Contributor Pull request opened by a first-time contributor to Gutenberg repository [Tool] E2E Test Utils /packages/e2e-test-utils [Type] Automated Testing Testing infrastructure changes impacting the execution of end-to-end (E2E) and/or unit tests.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve locator inside openDocumentSettingsSidebar to avoid duplicate Locator failures.
3 participants