Skip to content

Commit

Permalink
Adjust tests
Browse files Browse the repository at this point in the history
  • Loading branch information
staudenmeir committed Aug 19, 2024
1 parent 5ed3af4 commit 73a19b4
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions tests/UpdateTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@ public function testChromeVersionDetection()

$version = $this->driverVersion(explode('.', $chromeVersion)[0]);

$previousVersion = explode('.', $version)[0] - 1;

$this->artisan('dusk:update', ['version' => $previousVersion]);

$this->artisan('dusk:update', ['--detect' => null])
->expectsOutput('Chrome version '.$chromeVersion.' detected.')
->expectsOutput('ChromeDriver binary successfully updated to version '.$version.'.')
Expand All @@ -79,8 +83,6 @@ public function testChromeVersionDetection()

$this->assertStringContainsString($version, shell_exec(__DIR__.'/bin/chromedriver-linux --version'));
$this->assertTrue(is_executable(__DIR__.'/bin/chromedriver-linux'));
$this->assertFalse(file_exists(__DIR__.'/bin/chromedriver-mac'));
$this->assertFalse(file_exists(__DIR__.'/bin/chromedriver-win.exe'));
}

public function testChromeVersionDetectionWithPath()
Expand All @@ -89,15 +91,17 @@ public function testChromeVersionDetectionWithPath()

$version = $this->driverVersion(explode('.', $chromeVersion)[0]);

$previousVersion = explode('.', $version)[0] - 1;

$this->artisan('dusk:update', ['version' => $previousVersion]);

$this->artisan('dusk:update', ['--detect' => '/usr/bin/google-chrome'])
->expectsOutput('Chrome version '.$chromeVersion.' detected.')
->expectsOutput('ChromeDriver binary successfully updated to version '.$version.'.')
->assertExitCode(0);

$this->assertStringContainsString($version, shell_exec(__DIR__.'/bin/chromedriver-linux --version'));
$this->assertTrue(is_executable(__DIR__.'/bin/chromedriver-linux'));
$this->assertFalse(file_exists(__DIR__.'/bin/chromedriver-mac'));
$this->assertFalse(file_exists(__DIR__.'/bin/chromedriver-win.exe'));
}

public function testChromeVersionDetectionWithInvalidPath()
Expand Down

0 comments on commit 73a19b4

Please sign in to comment.