-
Notifications
You must be signed in to change notification settings - Fork 323
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
Feature Idea: Handle Dusk requests inside test process #996
Comments
Two follow-up thoughts:
|
Ping @crynobone. Do you might have any thoughts here? |
I personally feel you can start this as a 3rd party package and have it proven first. Dusk currently is slow but it should work well with |
Hi there @inxilpro. Thanks for your request but we're going to pass on this and keep things simple for Dusk. Sorry |
If anyone stumbles upon this and is interested, I've got a working proof of concept that's pretty darn cool. Take a look at: |
Right now one of the trickiest parts of using Dusk, in my experience, is the fact that your tests run in one process and the web server runs in a separate process. This means that Dusk tests can't take advantage of things like
RefreshDatabase
, and you can't directly manipulate the application state from within your test.I have an idea that could potentially remove that constraint by proxying incoming Dusk requests back to the process running the PHPUnit tests. Here's how it would work:
socket_*
methods)php artisan serve
works, using a specialdusk-proxy.php
routerdusk-proxy.php
would:TestCase::call
works)A very thin transport protocol would be necessary to send the right request/response data over the TCP connection. Once that was in place, an API would be necessary to tell Dusk when to read the TCP buffer (so that it doesn't just block test execution). I think that second part could mostly (or maybe entirely) be transparent, since calls like
$browser->visit('/login')
implicitly signal when Dusk would need to fetch the request.All-in-all, this would be a huge undertaking and would be a pretty big breaking change. It may make more sense to release something like this as a brand new package. It may be that you've explored this technique and found a major issue with it. Either way, before I explore it too much more, I'd love some feedback on the concept.
The text was updated successfully, but these errors were encountered: