Changeset View
Changeset View
Standalone View
Standalone View
src/tests/Browser/Pages/Admin/Distlist.php
- This file was copied from src/tests/Browser/Pages/Admin/User.php.
<?php | <?php | ||||
namespace Tests\Browser\Pages\Admin; | namespace Tests\Browser\Pages\Admin; | ||||
use Laravel\Dusk\Page; | use Laravel\Dusk\Page; | ||||
class User extends Page | class Distlist extends Page | ||||
{ | { | ||||
protected $userid; | protected $listid; | ||||
/** | /** | ||||
* Object constructor. | * Object constructor. | ||||
* | * | ||||
* @param int $userid User Id | * @param int $listid Distribution list Id | ||||
*/ | */ | ||||
public function __construct($userid) | public function __construct($listid) | ||||
{ | { | ||||
$this->userid = $userid; | $this->listid = $listid; | ||||
} | } | ||||
/** | /** | ||||
* Get the URL for the page. | * Get the URL for the page. | ||||
* | * | ||||
* @return string | * @return string | ||||
*/ | */ | ||||
public function url(): string | public function url(): string | ||||
{ | { | ||||
return '/user/' . $this->userid; | return '/distlist/' . $this->listid; | ||||
} | } | ||||
/** | /** | ||||
* Assert that the browser is on the page. | * Assert that the browser is on the page. | ||||
* | * | ||||
* @param \Laravel\Dusk\Browser $browser The browser object | * @param \Laravel\Dusk\Browser $browser The browser object | ||||
* | * | ||||
* @return void | * @return void | ||||
*/ | */ | ||||
public function assert($browser): void | public function assert($browser): void | ||||
{ | { | ||||
$browser->waitForLocation($this->url()) | $browser->waitForLocation($this->url()) | ||||
->waitUntilMissing('@app .app-loader') | ->waitFor('@distlist-info'); | ||||
->waitFor('@user-info'); | |||||
} | } | ||||
/** | /** | ||||
* Get the element shortcuts for the page. | * Get the element shortcuts for the page. | ||||
* | * | ||||
* @return array | * @return array | ||||
*/ | */ | ||||
public function elements(): array | public function elements(): array | ||||
{ | { | ||||
return [ | return [ | ||||
'@app' => '#app', | '@app' => '#app', | ||||
'@user-info' => '#user-info', | '@distlist-info' => '#distlist-info', | ||||
'@nav' => 'ul.nav-tabs', | '@distlist-config' => '#distlist-config', | ||||
'@user-finances' => '#user-finances', | |||||
'@user-aliases' => '#user-aliases', | |||||
'@user-subscriptions' => '#user-subscriptions', | |||||
'@user-domains' => '#user-domains', | |||||
'@user-users' => '#user-users', | |||||
]; | ]; | ||||
} | } | ||||
} | } |