-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Fixed unit test suite that was not running, added working browser test #11671
Conversation
💖 Thanks for this pull request! 💖 We use semantic commit messages to streamline the release process and easily generate changelogs between versions. Before your pull request can be merged, you should update your pull request title to start with a semantic prefix if it doesn't have one already. Examples of commit messages with semantic prefixes:
Things that will help get your PR across the finish line:
We get a lot of pull requests on this repo, so please be patient and we will get back to you as soon as we can. |
Hi chartjes - can you retarget this to the develop branch, per the dev docs? |
Hm, still getting the same errors as before...
This seems to happen whether I use If it's any clue, I use MAMP Pro for local development. I'll use pretty much anything except for Docker tho. |
It also looks like it's not migrating for phpunit automatically.
|
Ah...I will download MAMP Pro and take a look. It might be something as simple as adding details to the documentation about what port Dusk is running on. |
I mean, it shouldn’t matter tho? Whole point is that tests should be runnable from kind of anywhere, especially with something like Dusk, that promises to make all of this easier. |
Dusk relies on Chromedriver to be the headless browser for the tests. There is a port that Chromedriver is using to accept connections and if in the various configuration files it is using a different one from what is expected, then it would be a good idea to make sure we force Chromedriver to always use the same port. I don't think MAMP vs. Docker really matters. For Dusk, it's more about "have we provided configuration settings to make sure everyone has the same experience." |
100% yes - I did make sure I had chrome drivers set up, so I still don’t get why the extra steps. (This is confusion on my understanding of how Dusk is supposed to work, not on what you’ve done here.) It’s also possible Dusk is the wrong choice and we should go back to Codeception. Codeception was brittle, but mostly worked (with enough massaging.) |
I have not been able to get Dusk up and running again locally either. *sigh* Codeception might be easier but I also think it is worth having a meeting to go over a “test strategy” as there might be a better path forward that you haven’t considered.
…On Fri, Aug 19, 2022, at 3:22 PM, snipe wrote:
100% yes - I did make sure I had chrome drivers set up, so I still don’t get why the extra steps. (This is confusion on my understanding of how Dusk is supposed to work, not on what you’ve done here.) It’s also possible Dusk is the wrong choice and we should go back to Codeception. Codeception was brittle, but mostly worked (with enough massaging.)
—
Reply to this email directly, view it on GitHub <#11671 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AAAG5IN45HKAEBMX4MGVDYTVZ7NH5ANCNFSM56MOOBIQ>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
I have it running. Open two shell windows user1@computer:~/Programming/snipe-it-dev % php artisan serve
Starting Laravel development server: http://127.0.0.1:8000
[Fri Aug 19 14:32:46 2022] PHP 8.1.9 Development Server (http://127.0.0.1:8000) started user2@computer:~/Programming/snipe-it-dev % php artisan dusk
PHPUnit 9.5.21 #StandWithUkraine
... 3 / 3 (100%)
Time: 00:04.034, Memory: 36.00 MB
OK (3 tests, 4 assertions) |
user2@computer:~/Programming/snipe-it-dev % php artisan dusk tests/Browser/LoginTest.php
PHPUnit 9.5.21 #StandWithUkraine
.. 2 / 2 (100%)
Time: 00:03.052, Memory: 34.00 MB
OK (2 tests, 3 assertions) |
You have to have the .env, server and client configured correctly.
Here are some commands I have used to diagnose:
|
I'm not seeing anything in the docs about having to run
|
In the docs, "By default, Dusk will automatically attempt to start ChromeDriver. If this does not work for your particular system, you may manually start ChromeDriver before running the dusk command." With your original error
And start it manually:
Then from another window, run Sorry, I'm throwing in a lot of information, on dump mode. I start the server with Looks like the |
Here is an interesting read, of all the different ways people have gotten I read all the comments, starting to understand dusk a little more.
|
I have managed to get everything up-and-running at my end, thank you to @wewhite for digging into it some more. I have updated the documentation to reflect what was discovered. I'm 99.999% sure I am not using the correct branch for this PR. Please take a look so it can be closed out. |
Congrats on merging your first pull request! 🎉🎉🎉 |
Description
I was asked by Alison to investigate why the unit and browser tests were not working.
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Verified that existing unit test suite runs (still reporting errors but there are no environment or configuration-related errors, just failing tests)
Test Configuration:
Checklist: