Changeset View
Changeset View
Standalone View
Standalone View
src/tests/Browser/Pages/PaymentMollie.php
Show All 37 Lines | public function elements(): array | ||||
return [ | return [ | ||||
'@form' => '#container', | '@form' => '#container', | ||||
'@title' => '#container .header__info', | '@title' => '#container .header__info', | ||||
'@amount' => '#container .header__amount', | '@amount' => '#container .header__amount', | ||||
'@methods' => '#payment-method-list', | '@methods' => '#payment-method-list', | ||||
'@status-table' => 'table.table--select-status', | '@status-table' => 'table.table--select-status', | ||||
]; | ]; | ||||
} | } | ||||
/** | |||||
* Submit payment form. | |||||
* | |||||
* @param \Laravel\Dusk\Browser $browser The browser object | |||||
* | |||||
* @return void | |||||
*/ | |||||
public function submitValidCreditCard($browser) | |||||
{ | |||||
if ($browser->element('@methods')) { | |||||
$browser->click('@methods button.grid-button-creditcard') | |||||
->waitFor('button.form__button'); | |||||
} | |||||
$browser->click('@status-table input[value="paid"]') | |||||
->click('button.form__button'); | |||||
} | |||||
} | } |