mirror of
https://github.com/coollabsio/coolify.git
synced 2026-08-24 02:24:11 -05:00
chore: remove legacy Dusk tests and configure maintenance driver
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
APP_ENV=testing
|
||||
APP_KEY=base64:8VEfVNVkXQ9mH2L33WBWNMF4eQ0BWD5CTzB8mIxcl+k=
|
||||
APP_DEBUG=true
|
||||
APP_MAINTENANCE_DRIVER=file
|
||||
|
||||
DB_CONNECTION=testing
|
||||
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Providers;
|
||||
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
|
||||
class DuskServiceProvider extends ServiceProvider
|
||||
{
|
||||
/**
|
||||
* Register Dusk's browser macros.
|
||||
*/
|
||||
public function boot(): void
|
||||
{
|
||||
\Laravel\Dusk\Browser::macro('loginWithRootUser', function () {
|
||||
return $this->visit('/login')
|
||||
->type('email', 'test@example.com')
|
||||
->type('password', 'password')
|
||||
->press('Login');
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -64,7 +64,6 @@
|
||||
"driftingly/rector-laravel": "^2.5.0",
|
||||
"fakerphp/faker": "^1.24.1",
|
||||
"laravel/boost": "^2.4.8",
|
||||
"laravel/dusk": "^8.6.0",
|
||||
"laravel/pint": "^1.30.4",
|
||||
"mockery/mockery": "^1.6.12",
|
||||
"nunomaduro/collision": "^8.9.5",
|
||||
|
||||
Generated
+1
-141
@@ -4,7 +4,7 @@
|
||||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
||||
"This file is @generated automatically"
|
||||
],
|
||||
"content-hash": "2d511da9e5e82eade5aa7e5094c888ae",
|
||||
"content-hash": "13e5d201c34a64cdf53e80a21304c9d5",
|
||||
"packages": [
|
||||
{
|
||||
"name": "aws/aws-crt-php",
|
||||
@@ -13698,80 +13698,6 @@
|
||||
},
|
||||
"time": "2026-05-19T20:09:50+00:00"
|
||||
},
|
||||
{
|
||||
"name": "laravel/dusk",
|
||||
"version": "v8.6.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/laravel/dusk.git",
|
||||
"reference": "e7fd48762c6a82ad2cd311db07587aa2a97ce143"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/laravel/dusk/zipball/e7fd48762c6a82ad2cd311db07587aa2a97ce143",
|
||||
"reference": "e7fd48762c6a82ad2cd311db07587aa2a97ce143",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"ext-json": "*",
|
||||
"ext-zip": "*",
|
||||
"guzzlehttp/guzzle": "^7.5",
|
||||
"illuminate/console": "^10.0|^11.0|^12.0|^13.0",
|
||||
"illuminate/support": "^10.0|^11.0|^12.0|^13.0",
|
||||
"php": "^8.1",
|
||||
"php-webdriver/webdriver": "^1.15.2",
|
||||
"symfony/console": "^6.2|^7.0|^8.0",
|
||||
"symfony/finder": "^6.2|^7.0|^8.0",
|
||||
"symfony/process": "^6.2|^7.0|^8.0",
|
||||
"vlucas/phpdotenv": "^5.2"
|
||||
},
|
||||
"require-dev": {
|
||||
"laravel/framework": "^10.0|^11.0|^12.0|^13.0",
|
||||
"mockery/mockery": "^1.6",
|
||||
"orchestra/testbench-core": "^8.19|^9.17|^10.8|^11.0",
|
||||
"phpstan/phpstan": "^1.10",
|
||||
"phpunit/phpunit": "^10.1|^11.0|^12.0.1",
|
||||
"psy/psysh": "^0.11.12|^0.12",
|
||||
"symfony/yaml": "^6.2|^7.0|^8.0"
|
||||
},
|
||||
"suggest": {
|
||||
"ext-pcntl": "Used to gracefully terminate Dusk when tests are running."
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"laravel": {
|
||||
"providers": [
|
||||
"Laravel\\Dusk\\DuskServiceProvider"
|
||||
]
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Laravel\\Dusk\\": "src/"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Taylor Otwell",
|
||||
"email": "taylor@laravel.com"
|
||||
}
|
||||
],
|
||||
"description": "Laravel Dusk provides simple end-to-end testing and browser automation.",
|
||||
"keywords": [
|
||||
"laravel",
|
||||
"testing",
|
||||
"webdriver"
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/laravel/dusk/issues",
|
||||
"source": "https://github.com/laravel/dusk/tree/v8.6.0"
|
||||
},
|
||||
"time": "2026-04-15T14:50:40+00:00"
|
||||
},
|
||||
{
|
||||
"name": "laravel/pint",
|
||||
"version": "v1.30.4",
|
||||
@@ -14817,72 +14743,6 @@
|
||||
},
|
||||
"time": "2022-02-21T01:04:05+00:00"
|
||||
},
|
||||
{
|
||||
"name": "php-webdriver/webdriver",
|
||||
"version": "1.16.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/php-webdriver/php-webdriver.git",
|
||||
"reference": "ac0662863aa120b4f645869f584013e4c4dba46a"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/php-webdriver/php-webdriver/zipball/ac0662863aa120b4f645869f584013e4c4dba46a",
|
||||
"reference": "ac0662863aa120b4f645869f584013e4c4dba46a",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"ext-curl": "*",
|
||||
"ext-json": "*",
|
||||
"ext-zip": "*",
|
||||
"php": "^7.3 || ^8.0",
|
||||
"symfony/polyfill-mbstring": "^1.12",
|
||||
"symfony/process": "^5.0 || ^6.0 || ^7.0 || ^8.0"
|
||||
},
|
||||
"replace": {
|
||||
"facebook/webdriver": "*"
|
||||
},
|
||||
"require-dev": {
|
||||
"ergebnis/composer-normalize": "^2.20.0",
|
||||
"ondram/ci-detector": "^4.0",
|
||||
"php-coveralls/php-coveralls": "^2.4",
|
||||
"php-mock/php-mock-phpunit": "^2.0",
|
||||
"php-parallel-lint/php-parallel-lint": "^1.2",
|
||||
"phpunit/phpunit": "^9.3",
|
||||
"squizlabs/php_codesniffer": "^3.5",
|
||||
"symfony/var-dumper": "^5.0 || ^6.0 || ^7.0 || ^8.0"
|
||||
},
|
||||
"suggest": {
|
||||
"ext-simplexml": "For Firefox profile creation"
|
||||
},
|
||||
"type": "library",
|
||||
"autoload": {
|
||||
"files": [
|
||||
"lib/Exception/TimeoutException.php"
|
||||
],
|
||||
"psr-4": {
|
||||
"Facebook\\WebDriver\\": "lib/"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"description": "A PHP client for Selenium WebDriver. Previously facebook/webdriver.",
|
||||
"homepage": "https://github.com/php-webdriver/php-webdriver",
|
||||
"keywords": [
|
||||
"Chromedriver",
|
||||
"geckodriver",
|
||||
"php",
|
||||
"selenium",
|
||||
"webdriver"
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/php-webdriver/php-webdriver/issues",
|
||||
"source": "https://github.com/php-webdriver/php-webdriver/tree/1.16.0"
|
||||
},
|
||||
"time": "2025-12-28T23:57:40+00:00"
|
||||
},
|
||||
{
|
||||
"name": "phpstan/phpstan",
|
||||
"version": "2.2.8",
|
||||
|
||||
+2
-2
@@ -193,8 +193,8 @@ return [
|
||||
*/
|
||||
|
||||
'maintenance' => [
|
||||
'driver' => 'cache',
|
||||
'store' => 'redis',
|
||||
'driver' => env('APP_MAINTENANCE_DRIVER', 'cache'),
|
||||
'store' => env('APP_MAINTENANCE_STORE', 'redis'),
|
||||
],
|
||||
|
||||
/*
|
||||
|
||||
@@ -1,27 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Tests\Browser;
|
||||
|
||||
use Laravel\Dusk\Browser;
|
||||
use Tests\DuskTestCase;
|
||||
use Throwable;
|
||||
|
||||
class LoginTest extends DuskTestCase
|
||||
{
|
||||
/**
|
||||
* A basic test for the login page.
|
||||
* Login with the test user and assert that the user is redirected to the dashboard.
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @throws Throwable
|
||||
*/
|
||||
public function test_login()
|
||||
{
|
||||
$this->browse(callback: function (Browser $browser) {
|
||||
$browser->loginWithRootUser()
|
||||
->assertPathIs('/')
|
||||
->assertSee('Dashboard');
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -1,34 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Tests\Browser;
|
||||
|
||||
use Laravel\Dusk\Browser;
|
||||
use Tests\DuskTestCase;
|
||||
use Throwable;
|
||||
|
||||
class ProjectAddNewTest extends DuskTestCase
|
||||
{
|
||||
/**
|
||||
* A basic test for the projects page.
|
||||
* Login with the test user and assert that the user is redirected to the projects page.
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @throws Throwable
|
||||
*/
|
||||
public function test_login()
|
||||
{
|
||||
$this->browse(function (Browser $browser) {
|
||||
$browser->loginWithRootUser()
|
||||
->visit('/projects')
|
||||
->pressAndWaitFor('+ Add', 1)
|
||||
->assertSee('New Project')
|
||||
->screenshot('project-add-new-1')
|
||||
->type('name', 'Test Project')
|
||||
->screenshot('project-add-new-2')
|
||||
->press('Continue')
|
||||
->assertSee('Test Project.')
|
||||
->screenshot('project-add-new-3');
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -1,29 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Tests\Browser;
|
||||
|
||||
use Laravel\Dusk\Browser;
|
||||
use Tests\DuskTestCase;
|
||||
use Throwable;
|
||||
|
||||
class ProjectSearchTest extends DuskTestCase
|
||||
{
|
||||
/**
|
||||
* A basic test for the projects page.
|
||||
* Login with the test user and assert that the user is redirected to the projects page.
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @throws Throwable
|
||||
*/
|
||||
public function test_login()
|
||||
{
|
||||
$this->browse(function (Browser $browser) {
|
||||
$browser->loginWithRootUser()
|
||||
->visit('/projects')
|
||||
->type('[x-model="search"]', 'joi43j4oi32j4o2')
|
||||
->assertSee('No project found with the search term "joi43j4oi32j4o2".')
|
||||
->screenshot('project-search-not-found');
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -1,27 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Tests\Browser;
|
||||
|
||||
use Laravel\Dusk\Browser;
|
||||
use Tests\DuskTestCase;
|
||||
use Throwable;
|
||||
|
||||
class ProjectTest extends DuskTestCase
|
||||
{
|
||||
/**
|
||||
* A basic test for the projects page.
|
||||
* Login with the test user and assert that the user is redirected to the projects page.
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @throws Throwable
|
||||
*/
|
||||
public function test_login()
|
||||
{
|
||||
$this->browse(function (Browser $browser) {
|
||||
$browser->loginWithRootUser()
|
||||
->visit('/projects')
|
||||
->assertSee('Projects');
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -1,2 +0,0 @@
|
||||
*
|
||||
!.gitignore
|
||||
@@ -1,2 +0,0 @@
|
||||
*
|
||||
!.gitignore
|
||||
@@ -1,57 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Tests;
|
||||
|
||||
use Facebook\WebDriver\Chrome\ChromeOptions;
|
||||
use Facebook\WebDriver\Remote\DesiredCapabilities;
|
||||
use Facebook\WebDriver\Remote\RemoteWebDriver;
|
||||
use Illuminate\Support\Collection;
|
||||
use Laravel\Dusk\TestCase as BaseTestCase;
|
||||
|
||||
abstract class DuskTestCase extends BaseTestCase
|
||||
{
|
||||
use CreatesApplication;
|
||||
|
||||
/**
|
||||
* Prepare for Dusk test execution.
|
||||
*
|
||||
* @beforeClass
|
||||
*/
|
||||
public static function prepare(): void
|
||||
{
|
||||
if (! static::runningInSail()) {
|
||||
static::startChromeDriver();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Create the RemoteWebDriver instance.
|
||||
*/
|
||||
protected function driver(): RemoteWebDriver
|
||||
{
|
||||
$options = (new ChromeOptions)->addArguments(collect([
|
||||
$this->shouldStartMaximized() ? '--start-maximized' : '--window-size=1920,1080',
|
||||
])->unless($this->hasHeadlessDisabled(), function (Collection $items) {
|
||||
return $items->merge([
|
||||
'--disable-gpu',
|
||||
'--headless=new',
|
||||
]);
|
||||
})->all());
|
||||
|
||||
return RemoteWebDriver::create(
|
||||
'http://localhost:4444',
|
||||
DesiredCapabilities::chrome()->setCapability(
|
||||
ChromeOptions::CAPABILITY,
|
||||
$options
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine if the browser window should start maximized.
|
||||
*/
|
||||
protected function baseUrl()
|
||||
{
|
||||
return 'http://localhost:8000';
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user