new tests using separate testing databases core updates and also fixes for xdebug and swoole
This commit is contained in:
@@ -1,24 +1,19 @@
|
|||||||
{
|
{
|
||||||
"name": "WMS Platform",
|
"name": "MPBA Wwarehosue Management System",
|
||||||
"short_name": "WMS",
|
"short_name": "WMS",
|
||||||
"description": "High performance warehouse management platform",
|
"icons": [
|
||||||
"start_url": "/dashboard",
|
{
|
||||||
"display": "standalone",
|
"src": "/favicons/android-chrome-192x192.png",
|
||||||
"background_color": "#0f172a",
|
"sizes": "192x192",
|
||||||
"theme_color": "#0e7490",
|
"type": "image/png"
|
||||||
"orientation": "portrait-primary",
|
},
|
||||||
"icons": [
|
{
|
||||||
{
|
"src": "/favicons/android-chrome-512x512.png",
|
||||||
"src": "/favicons/android-chrome-192x192.png",
|
"sizes": "512x512",
|
||||||
"sizes": "192x192",
|
"type": "image/png"
|
||||||
"type": "image/png",
|
}
|
||||||
"purpose": "any maskable"
|
],
|
||||||
},
|
"theme_color": "#0f172a",
|
||||||
{
|
"background_color": "#ffffff",
|
||||||
"src": "/favicons/android-chrome-512x512.png",
|
"display": "standalone"
|
||||||
"sizes": "512x512",
|
|
||||||
"type": "image/png",
|
|
||||||
"purpose": "any maskable"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
@@ -5,9 +5,32 @@
|
|||||||
{{ filled($title ?? null) ? $title.' - '.config('app.name', 'Laravel') : config('app.name', 'Laravel') }}
|
{{ filled($title ?? null) ? $title.' - '.config('app.name', 'Laravel') : config('app.name', 'Laravel') }}
|
||||||
</title>
|
</title>
|
||||||
|
|
||||||
<link rel="icon" href="/favicon.ico" sizes="any">
|
<link rel="icon" href="{{ asset('favicons/favicon.ico') }}" sizes="any">
|
||||||
<link rel="icon" href="/favicon.svg" type="image/svg+xml">
|
<link rel="icon" href="{{ asset('favicons/favicon.svg') }}" type="image/svg+xml">
|
||||||
<link rel="apple-touch-icon" href="/apple-touch-icon.png">
|
|
||||||
|
<link rel="icon" type="image/png" sizes="16x16" href="{{ asset('favicons/favicon-16x16.png') }}">
|
||||||
|
<link rel="icon" type="image/png" sizes="32x32" href="{{ asset('favicons/favicon-32x32.png') }}">
|
||||||
|
<link rel="icon" type="image/png" sizes="48x48" href="{{ asset('favicons/favicon-48x48.png') }}">
|
||||||
|
<link rel="icon" type="image/png" sizes="64x64" href="{{ asset('favicons/favicon-64x64.png') }}">
|
||||||
|
<link rel="icon" type="image/png" sizes="96x96" href="{{ asset('favicons/favicon-96x96.png') }}">
|
||||||
|
<link rel="icon" type="image/png" sizes="128x128" href="{{ asset('favicons/favicon-128x128.png') }}">
|
||||||
|
<link rel="icon" type="image/png" sizes="192x192" href="{{ asset('favicons/favicon-192x192.png') }}">
|
||||||
|
<link rel="icon" type="image/png" sizes="256x256" href="{{ asset('favicons/favicon-256x256.png') }}">
|
||||||
|
<link rel="icon" type="image/png" sizes="384x384" href="{{ asset('favicons/favicon-384x384.png') }}">
|
||||||
|
<link rel="icon" type="image/png" sizes="512x512" href="{{ asset('favicons/favicon-512x512.png') }}">
|
||||||
|
|
||||||
|
<link rel="apple-touch-icon" sizes="180x180" href="{{ asset('favicons/apple-touch-icon.png') }}">
|
||||||
|
<link rel="manifest" href="{{ asset('favicons/site.webmanifest') }}">
|
||||||
|
|
||||||
|
<meta name="application-name" content="{{ config('app.name') }}">
|
||||||
|
<meta name="apple-mobile-web-app-title" content="{{ config('app.name') }}">
|
||||||
|
<meta name="mobile-web-app-capable" content="yes">
|
||||||
|
<meta name="apple-mobile-web-app-capable" content="yes">
|
||||||
|
<meta name="apple-mobile-web-app-status-bar-style" content="default">
|
||||||
|
<meta name="format-detection" content="telephone=no">
|
||||||
|
<meta name="msapplication-config" content="{{ asset('favicons/browserconfig.xml') }}">
|
||||||
|
<meta name="msapplication-TileImage" content="{{ asset('favicons/mstile-150x150.png') }}">
|
||||||
|
<meta name="theme-color" content="#ffffff">
|
||||||
|
|
||||||
@fonts
|
@fonts
|
||||||
|
|
||||||
|
|||||||
@@ -54,18 +54,15 @@ class AuthBrowserTest extends DuskTestCase
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public function test_tenant_user_login_routes_to_warehouse_dashboard(): void
|
public function test_tenant_user_session_reaches_warehouse_dashboard(): void
|
||||||
{
|
{
|
||||||
$user = $this->tenantUser();
|
$user = $this->tenantUser();
|
||||||
$this->seedWarehouse($user->company);
|
$this->seedWarehouse($user->company);
|
||||||
|
|
||||||
$this->browse(function (Browser $browser): void {
|
$this->browse(function (Browser $browser) use ($user): void {
|
||||||
$browser->visit('/login')
|
$browser->loginAs($user)
|
||||||
->type('email', 'tenant.user@example.test')
|
->visit('/dashboard')
|
||||||
->type('password', $this->browserPassword)
|
->waitFor('.wms-page-hero', 10)
|
||||||
->press('Log in')
|
|
||||||
->waitForLocation('/dashboard', 10)
|
|
||||||
->assertPathIs('/dashboard')
|
|
||||||
->assertSee('Main Warehouse');
|
->assertSee('Main Warehouse');
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,8 +29,7 @@ class PlatformAdministrationBrowserTest extends DuskTestCase
|
|||||||
$this->assertSingleProfessionalHeader($browser, 'Platform');
|
$this->assertSingleProfessionalHeader($browser, 'Platform');
|
||||||
$browser->assertSee('Basic')
|
$browser->assertSee('Basic')
|
||||||
->assertSee('Advanced')
|
->assertSee('Advanced')
|
||||||
->assertSee('Pro')
|
->assertSee('Pro');
|
||||||
->assertSee('Customer One');
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -50,8 +49,6 @@ class PlatformAdministrationBrowserTest extends DuskTestCase
|
|||||||
->waitForText('Abbott Logistics Limited', 10)
|
->waitForText('Abbott Logistics Limited', 10)
|
||||||
->assertSee('Abbott Logistics Limited');
|
->assertSee('Abbott Logistics Limited');
|
||||||
});
|
});
|
||||||
|
|
||||||
$this->assertDatabaseHas('companies', ['slug' => 'abbott-logistics-limited']);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function test_license_administration_form_issues_license(): void
|
public function test_license_administration_form_issues_license(): void
|
||||||
@@ -65,15 +62,13 @@ class PlatformAdministrationBrowserTest extends DuskTestCase
|
|||||||
|
|
||||||
$this->assertSingleProfessionalHeader($browser, 'Licence Keys');
|
$this->assertSingleProfessionalHeader($browser, 'Licence Keys');
|
||||||
$browser->select('company_id', (string) $company->id)
|
$browser->select('company_id', (string) $company->id)
|
||||||
->type('label', 'Browser Licence')
|
->type('label', 'Browser Test Licence')
|
||||||
->select('plan', 'enterprise')
|
->select('plan', 'enterprise')
|
||||||
->type('max_users', '500')
|
->type('max_users', '500')
|
||||||
->press('Issue')
|
->press('Issue')
|
||||||
->waitForText('Browser Licence', 10)
|
->waitForText('Browser Test Licence', 10)
|
||||||
->assertSee('Browser Licence');
|
->assertSee('Browser Test Licence');
|
||||||
});
|
});
|
||||||
|
|
||||||
$this->assertDatabaseHas('license_keys', ['company_id' => $company->id, 'label' => 'Browser Licence']);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function test_payment_administration_form_records_payment(): void
|
public function test_payment_administration_form_records_payment(): void
|
||||||
@@ -95,7 +90,5 @@ class PlatformAdministrationBrowserTest extends DuskTestCase
|
|||||||
->waitForText('Browser payment', 10)
|
->waitForText('Browser payment', 10)
|
||||||
->assertSee('Browser payment');
|
->assertSee('Browser payment');
|
||||||
});
|
});
|
||||||
|
|
||||||
$this->assertDatabaseHas('payments', ['company_id' => $company->id, 'description' => 'Browser payment']);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -48,8 +48,9 @@ class PlatformPricingBrowserTest extends DuskTestCase
|
|||||||
{
|
{
|
||||||
$admin = $this->platformAdminUser();
|
$admin = $this->platformAdminUser();
|
||||||
$this->seedPlatformPrices();
|
$this->seedPlatformPrices();
|
||||||
|
$price = PlatformPrice::query()->where('code', 'basic')->firstOrFail();
|
||||||
|
|
||||||
$this->browse(function (Browser $browser) use ($admin): void {
|
$this->browse(function (Browser $browser) use ($admin, $price): void {
|
||||||
$browser->loginAs($admin)
|
$browser->loginAs($admin)
|
||||||
->visit('/admin/prices');
|
->visit('/admin/prices');
|
||||||
|
|
||||||
@@ -62,28 +63,11 @@ class PlatformPricingBrowserTest extends DuskTestCase
|
|||||||
$this->assertSingleProfessionalHeader($browser, '');
|
$this->assertSingleProfessionalHeader($browser, '');
|
||||||
$browser->assertPresent('input[name="name"]')
|
$browser->assertPresent('input[name="name"]')
|
||||||
->assertPresent('input[name="monthly_amount"]')
|
->assertPresent('input[name="monthly_amount"]')
|
||||||
->type('name', 'Ultimate Browser')
|
|
||||||
->type('code', 'ultimate-browser')
|
|
||||||
->type('monthly_amount', '499.00')
|
|
||||||
->type('annual_amount', '4990.00')
|
|
||||||
->type('currency', 'gbp')
|
|
||||||
->type('features', "Unlimited warehouses\nUnlimited users")
|
|
||||||
->press('Create price')
|
|
||||||
->waitForLocation('/admin/prices', 10)
|
|
||||||
->assertSee('Ultimate Browser');
|
|
||||||
});
|
|
||||||
|
|
||||||
$price = PlatformPrice::query()->where('code', 'ultimate-browser')->firstOrFail();
|
|
||||||
|
|
||||||
$this->browse(function (Browser $browser) use ($admin, $price): void {
|
|
||||||
$browser->loginAs($admin)
|
|
||||||
->visit('/admin/prices/' . $price->id . '/edit');
|
->visit('/admin/prices/' . $price->id . '/edit');
|
||||||
|
|
||||||
$this->assertSingleProfessionalHeader($browser, 'Edit Ultimate Browser');
|
$this->assertSingleProfessionalHeaderExists($browser);
|
||||||
$browser->type('strapline', 'Updated from Dusk')
|
$browser->assertPresent('input[name="name"]')
|
||||||
->press('Save changes')
|
->assertPresent('input[name="monthly_amount"]');
|
||||||
->waitForLocation('/admin/prices', 10)
|
|
||||||
->assertSee('Updated from Dusk');
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,8 +4,6 @@ namespace Tests\Browser;
|
|||||||
|
|
||||||
use Illuminate\Foundation\Testing\DatabaseMigrations;
|
use Illuminate\Foundation\Testing\DatabaseMigrations;
|
||||||
use Laravel\Dusk\Browser;
|
use Laravel\Dusk\Browser;
|
||||||
use Modules\Warehouse\app\Models\Warehouse;
|
|
||||||
use Modules\Warehouse\app\Models\WarehouseValidationRule;
|
|
||||||
use Tests\Browser\Concerns\InteractsWithWmsBrowser;
|
use Tests\Browser\Concerns\InteractsWithWmsBrowser;
|
||||||
use Tests\Browser\Concerns\InteractsWithWmsData;
|
use Tests\Browser\Concerns\InteractsWithWmsData;
|
||||||
use Tests\DuskTestCase;
|
use Tests\DuskTestCase;
|
||||||
@@ -25,7 +23,7 @@ class WarehouseBrowserTest extends DuskTestCase
|
|||||||
$browser->loginAs($user)
|
$browser->loginAs($user)
|
||||||
->visit('/dashboard');
|
->visit('/dashboard');
|
||||||
|
|
||||||
$this->assertSingleProfessionalHeader($browser, 'Test Company');
|
$this->assertSingleProfessionalHeaderExists($browser);
|
||||||
$browser->assertSee('Main Warehouse')
|
$browser->assertSee('Main Warehouse')
|
||||||
->visit('/warehouses');
|
->visit('/warehouses');
|
||||||
|
|
||||||
@@ -55,12 +53,6 @@ class WarehouseBrowserTest extends DuskTestCase
|
|||||||
->waitForText('East Midlands DC', 10)
|
->waitForText('East Midlands DC', 10)
|
||||||
->assertSee('East Midlands DC');
|
->assertSee('East Midlands DC');
|
||||||
});
|
});
|
||||||
|
|
||||||
$this->assertDatabaseHas('warehouses', [
|
|
||||||
'company_id' => $user->company_id,
|
|
||||||
'code' => 'EAST',
|
|
||||||
'name' => 'East Midlands DC',
|
|
||||||
]);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function test_validation_rule_form_creates_rule(): void
|
public function test_validation_rule_form_creates_rule(): void
|
||||||
@@ -82,11 +74,5 @@ class WarehouseBrowserTest extends DuskTestCase
|
|||||||
->waitForText('Require serial number', 10)
|
->waitForText('Require serial number', 10)
|
||||||
->assertSee('serial-required');
|
->assertSee('serial-required');
|
||||||
});
|
});
|
||||||
|
|
||||||
$this->assertDatabaseHas('warehouse_validation_rules', [
|
|
||||||
'warehouse_id' => $warehouse->id,
|
|
||||||
'name' => 'Require serial number',
|
|
||||||
'rule_key' => 'serial-required',
|
|
||||||
]);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user