dusk-mode

Toggle Laravel Dusk between visible and headless modes via DUSK_HEADLESS.

Updated Mar 31, 2026
One-click install
npx skills add https://github.com/kdrezo/claude-skills --skill dusk-mode
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: dusk-mode
Source: https://github.com/kdrezo/claude-skills/tree/main/dusk-mode
Command: npx skills add https://github.com/kdrezo/claude-skills --skill dusk-mode

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Switch Laravel Dusk between visible (Chrome shows) and headless (Chrome runs in background) modes, ensuring tests run under the desired display state with an automatic current-mode indicator when no argument is provided.

Core Features & Use Cases

  • Automates switching Dusk Chrome mode between visible and headless for Laravel+Dusk projects.
  • Provides status reporting of the current mode via environment checks and project configuration.
  • Use Case: Validate test behavior in both modes across a Laravel project by toggling DUSK_HEADLESS.

Quick Start

Use the dusk-mode skill to switch to headless mode by setting DUSK_HEADLESS=true in .env.dusk.local and confirming the status shows headless.

Frequently Asked Questions about dusk-mode

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I switch Laravel Dusk tests between visible and headless modes?

To switch Laravel Dusk tests between visible and headless modes, toggle the DUSK_HEADLESS environment variable in your .env.dusk.local file and apply the corresponding headless arguments in tests/DuskTestCase.php. This ensures Chrome runs in the desired display state.

What is the DUSK_HEADLESS environment variable used for in Laravel?

The DUSK_HEADLESS environment variable in Laravel determines whether Dusk test execution launches a visible Chrome window or runs headless in the background. It automates switching and provides status reporting of the current testing mode.

Do I need to modify DuskTestCase.php to run Selenium tests headless in Laravel?

Yes, you need to adapt tests/DuskTestCase.php to apply headless arguments when the DUSK_HEADLESS environment variable is enabled. This configuration ensures your automated Selenium tests execute correctly in the background.

Can I check the current Dusk mode status before running automated tests?

You can check the current Dusk mode status by running the toggle command without arguments. It reports whether Dusk is currently set to visible or headless by reading the environment checks and project configuration.

What prerequisites are required to automate toggling Dusk Chrome mode?

To automate toggling Dusk Chrome mode, your Laravel project must have Dusk installed and configured. The required prerequisites include defining the DUSK_HEADLESS environment variable in your .env.dusk.local file.

Why does my Laravel Dusk test show a visible browser window when I expect headless?

Your Laravel Dusk test shows a visible browser because the DUSK_HEADLESS variable in .env.dusk.local is not set to true, or tests/DuskTestCase.php lacks the proper headless arguments configuration to run Chrome in the background.