Skip to content

refactor(tests): Enhance plugin testing with shared fixtures and beforeAll setup - #187

Merged
antobinary merged 3 commits into
bigbluebutton:v0.0.xfrom
antonbsa:test-shared-fixtures
Jun 11, 2025
Merged

antobinary merged 3 commits into
bigbluebutton:v0.0.xfrom
antonbsa:test-shared-fixtures

Conversation

@antonbsa

@antonbsa antonbsa commented May 30, 2025 •

Copy link
Copy Markdown

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:

    • Added createSampleTest in tests/core/fixtures/sampleFixture.ts to generate a Playwright test instance with reusable sampleTest fixtures for plugin setup.
    • Added checkPluginAvailability in tests/core/fixtures/sampleBeforeAll.ts to handle plugin manifest fetching and environment variable setup in a shared beforeAll hook.
  • Simplified Test Files:

    • Refactored samples/sample-action-button-dropdown-plugin/tests/test.spec.ts and samples/sample-actions-bar-plugin/tests/test.spec.ts to use the new shared fixtures, replacing custom setup logic.

Documentation Updates

  • Added a new README.md in tests/core/fixtures to document the usage of createSampleTest and checkPluginAvailability, including examples and environment variable handling.
  • Updated tests/README.md to reference the new documentation for setting up base spec files.

Configuration Updates

  • Updated .env.template to include environment variables for custom plugin URLs (ACTION_BUTTON_DROPDOWN_URL, ACTIONS_BAR_URL) to support the new fixture setup.

@GuiLeme
GuiLeme self-requested a review June 3, 2025 15:35

@GuiLeme GuiLeme left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM!

@antobinary
antobinary merged commit ddefadd into bigbluebutton:v0.0.x Jun 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants