Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[6.x] Ability to set artifacts directories #775

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/Console/DuskCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ protected function phpunitArguments($options)
*/
protected function purgeScreenshots()
{
$path = base_path('tests/Browser/screenshots');
$path = config('dusk.screenshots_path', base_path('tests/Browser/screenshots'));

if (! is_dir($path)) {
return;
Expand All @@ -143,7 +143,7 @@ protected function purgeScreenshots()
*/
protected function purgeConsoleLogs()
{
$path = base_path('tests/Browser/console');
$path = config('dusk.console_log_path', base_path('tests/Browser/console'));

if (! is_dir($path)) {
return;
Expand Down
14 changes: 8 additions & 6 deletions src/Console/InstallCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@ public function handle()
mkdir(base_path('tests/Browser/Components'), 0755, true);
}

if (! is_dir(base_path('tests/Browser/screenshots'))) {
if (! is_dir(config('dusk.screenshots_path', base_path('tests/Browser/screenshots')))) {
$this->createScreenshotsDirectory();
}

if (! is_dir(base_path('tests/Browser/console'))) {
if (! is_dir(config('dusk.console_log_path', base_path('tests/Browser/console')))) {
$this->createConsoleDirectory();
}

Expand Down Expand Up @@ -82,9 +82,10 @@ public function handle()
*/
protected function createScreenshotsDirectory()
{
mkdir(base_path('tests/Browser/screenshots'), 0755, true);
$storeScreenshotsAt = config('dusk.screenshots_path', base_path('tests/Browser/screenshots'));
mkdir($storeScreenshotsAt, 0755, true);

file_put_contents(base_path('tests/Browser/screenshots/.gitignore'), '*
file_put_contents($storeScreenshotsAt.DIRECTORY_SEPARATOR.'.gitignore', '*
!.gitignore
');
}
Expand All @@ -96,9 +97,10 @@ protected function createScreenshotsDirectory()
*/
protected function createConsoleDirectory()
{
mkdir(base_path('tests/Browser/console'), 0755, true);
$storeConsoleLogAt = config('dusk.console_log_path', base_path('tests/Browser/console'));
mkdir($storeConsoleLogAt, 0755, true);

file_put_contents(base_path('tests/Browser/console/.gitignore'), '*
file_put_contents($storeConsoleLogAt.DIRECTORY_SEPARATOR.'.gitignore', '*
!.gitignore
');
}
Expand Down
6 changes: 3 additions & 3 deletions src/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ protected function setUp(): void

Browser::$baseUrl = $this->baseUrl();

Browser::$storeScreenshotsAt = base_path('tests/Browser/screenshots');
Browser::$storeScreenshotsAt = config('dusk.screenshots_path', base_path('tests/Browser/screenshots'));

Browser::$storeConsoleLogAt = base_path('tests/Browser/console');
Browser::$storeConsoleLogAt = config('dusk.console_log_path', base_path('tests/Browser/console'));

Browser::$storeSourceAt = base_path('tests/Browser/source');
Browser::$storeSourceAt = config('dusk.source_path', base_path('tests/Browser/source'));

Browser::$userResolver = function () {
return $this->user();
Expand Down