Skip to content

Rebuild test infrastructure with Livewire::visit() and workbench SFC pages#20

Open
munezaclovis wants to merge 6 commits intomainfrom
feat/test-infrastructure-overhaul
Open

Rebuild test infrastructure with Livewire::visit() and workbench SFC pages#20
munezaclovis wants to merge 6 commits intomainfrom
feat/test-infrastructure-overhaul

Conversation

@munezaclovis
Copy link
Contributor

Summary

  • Deleted broken test infrastructure: Removed 76 broken browser tests, test CSS fixtures (tests/css/, tests/assets/), and build:test/watch:test npm scripts that duplicated what the workbench already provides
  • Created 4 SFC test pages in workbench/resources/views/pages/tests/ (button, input, form-controls, input-group) with dusk attributes for reliable targeting
  • Wrote 42 passing browser tests using Livewire::visit() covering button variants/sizes/states, input types/states, checkbox/switch/toggle/radio/slider, and input group addons
  • Fixed TestCase provider loading: getPackageProviders() was overriding the base method that loads workbench providers from testbench.yaml, preventing WorkbenchServiceProvider from registering Livewire namespaces correctly. Fixed by merging with getPackageProvidersUsingWorkbench()
  • Added Claude Code config: .claude/ skills, .mcp.json, and .playwright-mcp/ to .gitignore

Test plan

  • vendor/bin/pest tests/MogManagerTest.php — 36 unit tests pass
  • pnpm --filter @mog/workbench build — workbench assets build
  • vendor/bin/pest tests/Browser — 42 browser tests pass
  • vendor/bin/pest — all 78 tests pass together (131 assertions, ~20s)

… pages

Replace 76 broken browser tests with 42 working tests that use Livewire::visit()
against SFC test pages in the workbench. Delete obsolete test CSS fixtures and
build scripts now superseded by the workbench Vite setup.

Key changes:
- Delete broken tests, test CSS fixtures, and build:test/watch:test scripts
- Create 4 SFC test pages in workbench/resources/views/pages/tests/
- Write browser tests for button, input, form controls, and input group
- Fix TestCase to merge workbench providers via getPackageProvidersUsingWorkbench()
  so WorkbenchServiceProvider loads and Livewire namespaces resolve correctly
- Add .claude/ skills, .mcp.json config, and .playwright-mcp/ to .gitignore
Browser tests require Playwright to be installed. Install only
chromium with system deps to keep CI fast.
Playwright requires the npm package to be installed before
npx playwright install can download browser binaries.
Browser tests require an encryption key for CSRF/session handling.
Locally this is provided by the workbench .env, but CI has no .env.
Packages should not commit composer.lock so that CI resolves
fresh dependencies per PHP version, properly testing the matrix.
The LivewirePageController namespace moved from
Features\SupportRouting to Mechanisms\HandleRouting in Livewire v4.1.
Using the Route::livewire() macro is the proper API and works across versions.
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.

1 participant