Skip to content

Conversation

@tommitchelmore
Copy link

Configurable Playwright Binary Location

Problem

We run a bespoke non-laravel project structure, and our frontend code lives in a nested directory.

We want to be able to specify the location of the Playwright Binary at launch, i.e.

./vendor/bin/pest --playwright-path ./frontend/node_modules/.bin

I feel this is in a similar vein to #136 - supporting bespoke/non-standard Playwright set ups would be a great direction to go in.

Solution

In this PR I've added a static property to the Playwright class executablePath that defaults to the current hard-coded string in 4.x.

In Plugin, I've added a section to handleArguments that handles a value passed to --playwright-path.

In ServerManager, I've replaced the hard-coded path string with Playwright::executablePath().

@nexxai
Copy link
Contributor

nexxai commented Sep 3, 2025

I know this is super nitpicky, but in your comments you have it spelled "Playwrite" when it's actually spelled "Playwright"

@tommitchelmore
Copy link
Author

I know this is super nitpicky, but in your comments you have it spelled "Playwrite" when it's actually spelled "Playwright"

Ah not my finest! Resolved that this morning.

@jasonmccreary
Copy link
Collaborator

@tommitchelmore, the tests are failing. Could you review and reopen.

@jasonmccreary jasonmccreary marked this pull request as draft September 4, 2025 23:25
@tommitchelmore tommitchelmore marked this pull request as ready for review September 5, 2025 13:56
@tommitchelmore
Copy link
Author

@jasonmccreary that's resolves now, apologies - I'd not clocked that.

@tommitchelmore
Copy link
Author

@jasonmccreary Going to double check my implementation.

image

@tommitchelmore tommitchelmore marked this pull request as draft September 5, 2025 14:22
@tommitchelmore tommitchelmore marked this pull request as ready for review September 5, 2025 14:25
@jasonmccreary
Copy link
Collaborator

@tommitchelmore, thanks. Looks like everything is in order now. I'm going to defer this to @nunomaduro though.

The only note I have is that the custom exception is unnecessary code. Just throw a RuntimeException directly.

@tommitchelmore
Copy link
Author

@jasonmccreary thank you for your time, much appreciated! I've just removed that exception.

@tommitchelmore
Copy link
Author

Just bumping this - having this feature merged would be a big help for us.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants