refactor(tests): Enhance plugin testing with shared fixtures and beforeAll setup #187
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 pull request introduces significant refactoring and enhancements to the test infrastructure for sample plugin tests. The changes focus on improving reusability, simplifying test setup, and centralizing shared utilities. Key updates include the creation of reusable fixtures, the removal of redundant code, and the addition of documentation for these utilities.
Test Infrastructure Refactoring
Centralized Test Fixtures:
createSampleTestintests/core/fixtures/sampleFixture.tsto generate a Playwright test instance with reusablesampleTestfixtures for plugin setup.checkPluginAvailabilityintests/core/fixtures/sampleBeforeAll.tsto handle plugin manifest fetching and environment variable setup in a sharedbeforeAllhook.Simplified Test Files:
samples/sample-action-button-dropdown-plugin/tests/test.spec.tsandsamples/sample-actions-bar-plugin/tests/test.spec.tsto use the new shared fixtures, replacing custom setup logic.Documentation Updates
README.mdintests/core/fixturesto document the usage ofcreateSampleTestandcheckPluginAvailability, including examples and environment variable handling.tests/README.mdto reference the new documentation for setting up base spec files.Configuration Updates
.env.templateto include environment variables for custom plugin URLs (ACTION_BUTTON_DROPDOWN_URL,ACTIONS_BAR_URL) to support the new fixture setup.