diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 2162959f1..21810efe0 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -104,6 +104,6 @@ jobs: run: php artisan serve --no-reload & - name: Run Dusk Tests - run: php artisan dusk --without-tty + run: php artisan dusk --without-tty --ansi env: APP_URL: http://127.0.0.1:8000 diff --git a/src/Console/DuskCommand.php b/src/Console/DuskCommand.php index 0701b2367..1260c3dc2 100644 --- a/src/Console/DuskCommand.php +++ b/src/Console/DuskCommand.php @@ -125,13 +125,23 @@ protected function phpunitArguments($options) } $options = array_values(array_filter($options, function ($option) { - return ! Str::startsWith($option, ['--env=', '--pest']); + return ! Str::startsWith($option, ['--env=', '--pest', '--ansi', '--no-ansi']); })); if (! file_exists($file = base_path('phpunit.dusk.xml'))) { $file = base_path('phpunit.dusk.xml.dist'); } + if (version_compare(Version::id(), '10.0', '>=')) { + if ($this->option('ansi')) { + $options[] = '--colors=always'; + } + + if ($this->option('no-ansi')) { + $options[] = '--colors=never'; + } + } + return array_merge(['-c', $file], $options); }