-
Notifications
You must be signed in to change notification settings - Fork 324
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
Dusk under Laravel Sail fails when there is a .env.dusk.local file #851
Comments
I got the same issue. The problem, I suspect, is that if you try to run the dusk tests within the Docker container with your |
Thanks! I just tried that in my app and it does work. I don't quite understand why though... When I have Anyways, problem solved, so thanks for your help. |
Leaving this here, just incase anyone has a similar issue that isn't resolved by using I had more luck when updating the Update mysql:
image: 'mysql:8.0'
ports:
- '${FORWARD_DB_PORT:-3306}:3306'
environment:
MYSQL_ROOT_PASSWORD: '${DB_PASSWORD}'
MYSQL_DATABASE: '${DB_DATABASE}'
MYSQL_USER: '${DB_USERNAME}'
MYSQL_PASSWORD: '${DB_PASSWORD}'
MYSQL_ALLOW_EMPTY_PASSWORD: 'yes'
volumes:
- 'sailmysql:/var/lib/mysql'
networks:
- sail
mysql.test:
image: 'mysql:8.0'
environment:
MYSQL_ROOT_PASSWORD: '${DB_PASSWORD}'
MYSQL_DATABASE: '${DB_DATABASE_TEST}'
MYSQL_USER: '${DB_USERNAME}'
MYSQL_PASSWORD: '${DB_PASSWORD}'
MYSQL_ALLOW_EMPTY_PASSWORD: 'yes'
tmpfs: '/var/lib/mysql'
networks:
- sail Then update <?xml version="1.0" encoding="UTF-8"?>
<phpunit backupGlobals="false"
backupStaticAttributes="false"
bootstrap="vendor/autoload.php"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false">
<testsuites>
<testsuite name="Browser Test Suite">
<directory suffix="Test.php">./tests/Browser</directory>
</testsuite>
</testsuites>
<php>
<server name="DB_HOST" value="mysql.test"/>
<server name="DB_DATABASE" value="laravel_test"/>
</php>
</phpunit> There is no need for the |
I just found that removing @driesvints Would it be useful to update the docs with instruction to leave out I guess that would be here: https://laravel.com/docs/8.x/sail#laravel-dusk |
@matthewlilly did you still enable selenium and the laravel.test selenium dependency? |
Yes, I used selenium in testing. |
Environment
Development platform:
Description:
Laravel dusk fails when there is a .env.dusk.local file.
The contents of the .env.dusk.local file do not appear to affect the result. Copying a working .env file to .env.dusk.local is enough to make Dusk report a problem.
This behaviour was detected on an existing application, but it can be reproduced with a fresh Laravel install.
Steps To Reproduce:
Fresh Laravel install with Sail:
composer create-project laravel/laravel test
composer install laravel/dusk --dev
edit docker-compose.yml to enable selenium by uncommenting the following lines:
And the dependency of laravel.test on selenium:
sail up -d
sail artisan dusk:install
sail dusk
Default test runs OK
cp .env .env.dusk.local
sail dusk
Default test results in Error:
The text was updated successfully, but these errors were encountered: