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

Removed Dusk #13550

Merged
merged 1 commit into from
Aug 31, 2023
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
17 changes: 0 additions & 17 deletions .chipperci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ environment:

services:
- mysql: 5.7
- dusk:

on:
push:
Expand Down Expand Up @@ -43,19 +42,3 @@ pipeline:
- name: PHPUnit Feature Tests
cmd: |
php artisan test --testsuite Feature

# - name: Browser Tests
# cmd: |
# cp -v .env.dusk.example .env.dusk.ci
# sed -i "s@APP_ENV=.*@APP_ENV=ci@g" .env.dusk.ci
# sed -i "s@APP_URL=.*@APP_URL=http://$BUILD_HOST:8000@g" .env.dusk.ci
# #sed -i "s@DB_HOST=.*@DB_HOST=mysql@g" .env.dusk.ci
# sed -i "s@DB_HOST=.*@DB_HOST=$DB_HOST@g" .env.dusk.ci
# sed -i "s@DB_USERNAME=.*@DB_USERNAME=chipperci@g" .env.dusk.ci
# sed -i "s@DB_DATABASE=.*@DB_DATABASE=chipperci@g" .env.dusk.ci
# sed -i "s@DB_PASSWORD=.*@DB_PASSWORD=secret@g" .env.dusk.ci
#
# php -S [::0]:8000 -t public 2>server.log &
# sleep 2
# php artisan dusk:chrome-driver $CHROME_DRIVER
# php artisan dusk --env=ci
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
.couscous
.DS_Store
.env
.env.dusk.*
!.env.dusk.example
.env.testing
phpstan.neon
.idea
Expand Down
31 changes: 0 additions & 31 deletions TESTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,34 +18,3 @@ Now you are ready to run the entire test suite from your terminal:
To run individual test files, you can pass the path to the test that you want to run:

`php artisan test tests/Unit/AccessoryTest.php`

## Browser Tests

Browser tests are run via [Laravel Dusk](https://laravel.com/docs/8.x/dusk) and require Google Chrome to be installed.

Before attempting to run Dusk tests copy the example environment file for Dusk and update the values to match your environment:

`cp .env.dusk.example .env.dusk.local`
> `local` refers to the value of `APP_ENV` in your `.env` so if you have it set to `dev` then the file should be named `.env.dusk.dev`.

**Important**: Dusk tests cannot be run using an in-memory SQLite database. Additionally, the Dusk test suite uses the `DatabaseMigrations` trait which will leave the database in a fresh state after running. Therefore, it is recommended that you create a test database and point `DB_DATABASE` in `.env.dusk.local` to it.

### Running Browser Tests

Your application needs to be configured and up and running in order for the browser tests to actually run. When running the tests locally, you can start the application using the following command:

`php artisan serve`

Now you are ready to run the test suite. Use the following command from another terminal tab or window:

`php artisan dusk`

To run individual test files, you can pass the path to the test that you want to run:

`php artisan dusk tests/Browser/LoginTest.php`

If you get an error when attempting to run Dusk tests that says `Couldn't connect to server` run:

`php artisan dusk:chrome-driver --detect`

This command will install the specific ChromeDriver Dusk needs for your operating system and Chrome version.
7 changes: 1 addition & 6 deletions app/Providers/AppServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,7 @@ public function register()
// Only load rollbar if there is a rollbar key and the app is in production
if (($this->app->environment('production')) && (config('logging.channels.rollbar.access_token'))) {
$this->app->register(\Rollbar\Laravel\RollbarServiceProvider::class);
}

// Only load dusk's service provider if the app is in local or develop mode
if ($this->app->environment(['local', 'develop'])) {
$this->app->register(\Laravel\Dusk\DuskServiceProvider::class);
}
}

$this->app->singleton('ArieTimmerman\Laravel\SCIMServer\SCIMConfig', SnipeSCIMConfig::class); // this overrides the default SCIM configuration with our own

Expand Down
2 changes: 0 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@
"require-dev": {
"brianium/paratest": "^6.6",
"fakerphp/faker": "^1.16",
"laravel/dusk": "^6.25",
"mockery/mockery": "^1.4",
"nunomaduro/larastan": "^1.0",
"nunomaduro/phpinsights": "^2.7",
Expand Down Expand Up @@ -107,7 +106,6 @@
},
"autoload-dev": {
"classmap": [
"tests/DuskTestCase.php",
"tests/TestCase.php"
],
"psr-4": {
Expand Down
140 changes: 1 addition & 139 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

46 changes: 0 additions & 46 deletions tests/Browser/LoginTest.php

This file was deleted.

41 changes: 0 additions & 41 deletions tests/Browser/Pages/HomePage.php

This file was deleted.

20 changes: 0 additions & 20 deletions tests/Browser/Pages/Page.php

This file was deleted.

2 changes: 0 additions & 2 deletions tests/Browser/console/.gitignore

This file was deleted.

2 changes: 0 additions & 2 deletions tests/Browser/screenshots/.gitignore

This file was deleted.

2 changes: 0 additions & 2 deletions tests/Browser/source/.gitignore

This file was deleted.

Loading