Changeset View
Changeset View
Standalone View
Standalone View
src/tests/Browser/Pages/PaymentMollie.php
- This file was copied from src/tests/Browser/Pages/Wallet.php.
<?php | <?php | ||||
namespace Tests\Browser\Pages; | namespace Tests\Browser\Pages; | ||||
use Laravel\Dusk\Page; | use Laravel\Dusk\Page; | ||||
class Wallet extends Page | class PaymentMollie extends Page | ||||
{ | { | ||||
/** | /** | ||||
* 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 '/wallet'; | return ''; | ||||
} | } | ||||
/** | /** | ||||
* 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) | public function assert($browser) | ||||
{ | { | ||||
$browser->assertPathIs($this->url()) | $browser->waitFor('#container'); | ||||
->waitUntilMissing('@app .app-loader') | |||||
->assertSeeIn('#wallet .card-title', 'Account balance'); | |||||
} | } | ||||
/** | /** | ||||
* 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', | '@form' => '#container', | ||||
'@title' => '#container .header__info', | |||||
'@amount' => '#container .header__amount', | |||||
'@methods' => '#payment-method-list', | |||||
'@status-table' => 'table.table--select-status', | |||||
]; | ]; | ||||
} | } | ||||
} | } |