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

[8.x] Explicitly set chromedriver port. #1124

Merged
merged 1 commit into from
Aug 26, 2024
Merged
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
2 changes: 1 addition & 1 deletion .github/workflows/browser-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ jobs:
run: php vendor/bin/testbench dusk:chrome-driver --detect

- name: Start Chrome Driver
run: ./bin/chromedriver-linux &
run: ./bin/chromedriver-linux --port=9515 &

- name: Run Laravel Server
run: php vendor/bin/testbench serve --no-reload &
Expand Down
3 changes: 2 additions & 1 deletion src/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ protected function setUp(): void
protected function driver()
{
return RemoteWebDriver::create(
'http://localhost:9515', DesiredCapabilities::chrome()
$_ENV['DUSK_DRIVER_URL'] ?? env('DUSK_DRIVER_URL') ?? 'http://localhost:9515',
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Replicate line from stub file:

$_ENV['DUSK_DRIVER_URL'] ?? env('DUSK_DRIVER_URL') ?? 'http://localhost:9515',

DesiredCapabilities::chrome()
);
}

Expand Down
2 changes: 1 addition & 1 deletion stubs/DuskTestCase.stub
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ abstract class DuskTestCase extends BaseTestCase
public static function prepare(): void
{
if (! static::runningInSail()) {
static::startChromeDriver();
static::startChromeDriver(['--port=9515']);
}
}

Expand Down