- Can I use o-testbench-dusk for pure Laravel projects without WordPress?
- No, this package is specifically designed for hybrid Laravel/WordPress applications using WpStarter. If your project is Laravel-only, use Laravel Dusk or Pest directly without this package.
- What Laravel versions does o-testbench-dusk support?
- The package aligns with Laravel TestBench and Dusk’s compatibility, which typically supports Laravel 8.x, 9.x, and 10.x. However, verify your specific version against the last release (March 2023) as it’s unmaintained.
- How do I install o-testbench-dusk in a WpStarter project?
- Run `composer require wpstarter/o-testbench-dusk` after ensuring WpStarter, Laravel TestBench, and Dusk are installed. Configure Dusk’s `ChromeDriver` and update your `phpunit.xml` to include the package’s test helpers.
- Does this package work with WordPress plugins or only themes?
- It supports both WordPress plugins and themes, especially those interacting with Laravel backend logic. Use it to test UI flows like admin dashboards, REST API-driven interfaces, or custom plugin forms.
- Will o-testbench-dusk break if I update Laravel or WordPress?
- Yes, there’s a high risk due to the package’s unmaintained status. Test thoroughly after updates, and consider forking or replacing it if compatibility issues arise with newer Laravel/Dusk or WordPress versions.
- Can I run tests in CI/CD pipelines like GitHub Actions?
- Yes, but you’ll need to configure headless Chrome/Firefox drivers in your CI environment. Ensure your pipeline has Docker or VMs to support Dusk’s browser requirements, which can be resource-intensive.
- What alternatives exist for testing WordPress + Laravel UI flows?
- Consider native WordPress tools like WP_Browser or WP_CLI for WordPress-only tests, or Laravel Pest + Playwright for cross-framework testing. Spatie’s Laravel WordPress plugins also offer testing utilities.
- How do I test WordPress admin dashboard interactions with this package?
- Extend Dusk’s `Browser` class to interact with WordPress admin URLs (e.g., `/wp-admin`). Use TestBench to mock Laravel services, then assert UI elements like admin notices or form submissions.
- Does o-testbench-dusk support testing REST API endpoints?
- Indirectly, yes. While Dusk focuses on UI, you can combine it with TestBench to mock Laravel’s REST API responses and verify UI changes triggered by API calls (e.g., form submissions via AJAX).
- What should I do if o-testbench-dusk fails in production?
- Fallback to manual testing or fork the package to fix issues. Document the failure, isolate the cause (e.g., WordPress/WpStarter version conflicts), and explore alternatives like custom Dusk setups or Playwright for long-term stability.