$ show laravel/dusk
Laravel Dusk is a browser automation and testing library for Laravel applications. It provides a fluent, expressive API for interacting with web pages via ChromeDriver or Selenium WebDriver, enabling end-to-end testing without requiring JDK or Selenium server. The library integrates deeply with Laravel's testing infrastructure (PHPUnit/Pest), offering a TestCase base class, console commands for installation and ChromeDriver management, and a rich set of assertions and interactions (clicking, typing, waiting, screenshots, Vue component inspection). It is architecturally a library that wraps the php-webdriver package, adding Laravel-specific conveniences such as environment management, cookie encryption, authentication helpers, and page/component abstractions. The codebase is well-structured with traits for separation of concerns, macroable support for extensibility, and comprehensive unit and browser test coverage.
The LLM identified 2 files worth highlighting for reuse:
Resolves CSS selectors with a prefix, supports element shortcuts (e.g., '@modal' mapped to '#modal'), and handles dusk attribute selectors. It provides methods to find elements by ID, name, value, text, and various form field types. The class is self-contained (depends only on RemoteWebDriver and Dusk configuration) and could be extracted for use in other browser automation projects that need flexible selector resolution.
Detects the current operating system (Windows, macOS Intel/ARM, Linux) and provides Chrome version commands and ChromeDriver download slugs. It encapsulates platform-specific logic in a clean, static API. This utility is standalone and reusable in any PHP project that needs to manage ChromeDriver binaries across different environments.