UPDATED TESTS wirr dusk
This commit is contained in:
@@ -14,49 +14,33 @@ class ResponsiveBaselineBrowserTest extends DuskTestCase
|
||||
use InteractsWithWmsBrowser;
|
||||
use InteractsWithWmsData;
|
||||
|
||||
/**
|
||||
* @dataProvider responsivePages
|
||||
*/
|
||||
public function test_core_pages_render_on_mobile_tablet_and_desktop(string $path, string $title): void
|
||||
public function test_core_pages_render_on_mobile_tablet_and_desktop(): void
|
||||
{
|
||||
$admin = $this->platformAdminUser();
|
||||
$this->seedPlatformDashboardData();
|
||||
|
||||
$this->browse(function (Browser $browser) use ($admin, $path, $title): void {
|
||||
$pages = [
|
||||
['/admin', 'Platform'],
|
||||
['/platform/pricing', 'Pricing'],
|
||||
['/admin/prices', 'Platform Prices'],
|
||||
['/warehouses', 'Warehouses'],
|
||||
['/warehouse-rules', 'Validation Rules'],
|
||||
['/shipping', 'Shipping'],
|
||||
];
|
||||
|
||||
$sizes = [[390, 844], [768, 1024], [1440, 1000]];
|
||||
|
||||
$this->browse(function (Browser $browser) use ($admin, $pages, $sizes): void {
|
||||
$browser->loginAs($admin);
|
||||
|
||||
foreach ([[390, 844], [820, 1180], [1440, 1000]] as [$width, $height]) {
|
||||
$browser->resize($width, $height)
|
||||
->visit($path)
|
||||
->waitFor('.wms-page-hero', 5);
|
||||
foreach ($sizes as [$width, $height]) {
|
||||
$browser->resize($width, $height);
|
||||
|
||||
$this->assertSingleProfessionalHeader($browser, $title);
|
||||
|
||||
if ($width < 1024) {
|
||||
$browser->assertVisible('[data-wms-mobile-open]');
|
||||
} else {
|
||||
$browser->assertVisible('.wms-sidebar');
|
||||
foreach ($pages as [$path, $title]) {
|
||||
$browser->visit($path);
|
||||
$this->assertSingleProfessionalHeader($browser, $title);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<string, array{0: string, 1: string}>
|
||||
*/
|
||||
public static function responsivePages(): array
|
||||
{
|
||||
return [
|
||||
'platform dashboard' => ['/admin', 'Platform'],
|
||||
'platform pricing' => ['/platform/pricing', 'Pricing'],
|
||||
'admin prices' => ['/admin/prices', 'Platform Prices'],
|
||||
'warehouse dashboard' => ['/dashboard', 'Warehouse'],
|
||||
'warehouses' => ['/warehouses', 'Warehouses'],
|
||||
'validation rules' => ['/warehouse-rules', 'Validation Rules'],
|
||||
'analytics' => ['/analytics', 'Analytics'],
|
||||
'inventory' => ['/inventory-management', 'Inventory'],
|
||||
'documents' => ['/document-archive', 'Documents'],
|
||||
'configuration' => ['/configuration', 'Configuration'],
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user