chore: Added data-test to all extensible-area components #247
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What does this PR do?
This PR adds
data-testattributes to all extensible areas available to plugin developers, improving testability and enabling automated testing of plugins through Playwright or other testing frameworks.One other thing: in order to enhance developer experience with testing, in the generic-content-sidekick-area, there are a couple of auto-set data-tests (to avoid possible collisions - One plugin set a data-test different than the other to the same item, for example):
Take into consideration the above namings for the following rules:
data-testfor the Sidekick Header:sidekick_header_${dataTest}-dataTestis set by user;data-testfor the Section Title:sidekick_section_title_${section}-sectionis the name of the secion;data-testfor the Section Name:sidekick_menu_item_${dataTest}-dataTestis set by user;Motivation
Plugin developers need a reliable way to test their plugins through automated testing frameworks like Playwright. Without standardized
data-testattributes on extensible area components, it's difficult to target and interact with plugin UI elements in tests. This change provides a consistent testing interface across all extensible areas, making it easier for developers to write robust automated tests for their plugins.More
Closely related to PR
Testing changes: to test these changes, one can use the
sample-generic-content-sidekick-pluginand see data-test in the HTML elements like the following: