This commit is contained in:
EwelinaLasowy 2022-01-14 13:48:18 +01:00
parent c9b5c220e9
commit b1b13b973b
3 changed files with 12 additions and 9 deletions

View File

@ -1,5 +1,7 @@
<?php <?php
declare(strict_types=1);
namespace Tests\Browser; namespace Tests\Browser;
use Illuminate\Foundation\Testing\DatabaseMigrations; use Illuminate\Foundation\Testing\DatabaseMigrations;
@ -19,9 +21,9 @@ class AuthenticationTest extends DuskTestCase
$this->user = User::factory()->create(); $this->user = User::factory()->create();
} }
public function testUserCanLogout() public function testUserCanLogout(): void
{ {
$this->browse(function (Browser $browser) { $this->browse(function (Browser $browser): void {
$browser->loginAs($this->user) $browser->loginAs($this->user)
->visit("/") ->visit("/")
->assertVisible("@user-menu") ->assertVisible("@user-menu")

View File

@ -1,5 +1,7 @@
<?php <?php
declare(strict_types=1);
namespace Tests\Browser\Pages; namespace Tests\Browser\Pages;
use Laravel\Dusk\Browser; use Laravel\Dusk\Browser;
@ -13,16 +15,13 @@ class HomePage extends Page
*/ */
public function url() public function url()
{ {
return '/'; return "/";
} }
/** /**
* Assert that the browser is on the page. * Assert that the browser is on the page.
*
* @param \Laravel\Dusk\Browser $browser
* @return void
*/ */
public function assert(Browser $browser) public function assert(Browser $browser): void
{ {
// //
} }
@ -35,7 +34,7 @@ class HomePage extends Page
public function elements() public function elements()
{ {
return [ return [
'@element' => '#selector', "@element" => "#selector",
]; ];
} }
} }

View File

@ -1,5 +1,7 @@
<?php <?php
declare(strict_types=1);
namespace Tests\Browser\Pages; namespace Tests\Browser\Pages;
use Laravel\Dusk\Page as BasePage; use Laravel\Dusk\Page as BasePage;
@ -14,7 +16,7 @@ abstract class Page extends BasePage
public static function siteElements() public static function siteElements()
{ {
return [ return [
'@element' => '#selector', "@element" => "#selector",
]; ];
} }
} }