Changeset View
Changeset View
Standalone View
Standalone View
src/tests/Browser/Pages/PaymentStatus.php
- This file was copied from src/tests/Browser/Pages/Signup.php.
<?php | <?php | ||||
namespace Tests\Browser\Pages; | namespace Tests\Browser\Pages; | ||||
use Laravel\Dusk\Page; | use Laravel\Dusk\Page; | ||||
class Signup extends Page | class PaymentStatus 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 '/signup'; | return '/payment/status'; | ||||
} | } | ||||
/** | /** | ||||
* 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('/signup') | $browser->waitForLocation($this->url()) | ||||
->waitUntilMissing('.app-loader') | ->waitUntilMissing('@app .app-loader'); | ||||
->assertPresent('@step0') | |||||
->assertPresent('@step1') | |||||
->assertPresent('@step2') | |||||
->assertPresent('@step3'); | |||||
} | } | ||||
/** | /** | ||||
* 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', | ||||
'@step0' => '#step0', | '@content' => '.card .card-text', | ||||
'@step1' => '#step1', | '@lock-alert' => '#lock-alert', | ||||
'@step2' => '#step2', | '@button' => '.card button.btn-primary', | ||||
'@step3' => '#step3', | |||||
]; | ]; | ||||
} | } | ||||
} | } |