Changeset View
Changeset View
Standalone View
Standalone View
src/tests/Browser/PaymentStripeTest.php
Show All 37 Lines | class PaymentStripeTest extends TestCaseDusk | ||||
/** | /** | ||||
* Test the payment process | * Test the payment process | ||||
* | * | ||||
* @group stripe | * @group stripe | ||||
*/ | */ | ||||
public function testPayment(): void | public function testPayment(): void | ||||
{ | { | ||||
$user = $this->getTestUser('payment-test@kolabnow.com', [ | $user = $this->getTestUser('payment-test@kolabnow.com', [ | ||||
'password' => 'simple123', | 'password' => \App\Utils::generatePassphrase(), | ||||
]); | ]); | ||||
$this->browse(function (Browser $browser) use ($user) { | $this->browse(function (Browser $browser) use ($user) { | ||||
$browser->visit(new Home()) | $browser->visit(new Home()) | ||||
->submitLogon('payment-test@kolabnow.com', 'simple123', true, ['paymentProvider' => 'stripe']) | ->submitLogon('payment-test@kolabnow.com', \App\Utils::generatePassphrase(), true, ['paymentProvider' => 'stripe']) | ||||
->on(new Dashboard()) | ->on(new Dashboard()) | ||||
->click('@links .link-wallet') | ->click('@links .link-wallet') | ||||
->on(new WalletPage()) | ->on(new WalletPage()) | ||||
->assertSeeIn('@main button', 'Add credit') | ->assertSeeIn('@main button', 'Add credit') | ||||
->click('@main button') | ->click('@main button') | ||||
->with(new Dialog('@payment-dialog'), function (Browser $browser) { | ->with(new Dialog('@payment-dialog'), function (Browser $browser) { | ||||
$browser->assertSeeIn('@title', 'Top up your wallet') | $browser->assertSeeIn('@title', 'Top up your wallet') | ||||
->waitFor('#payment-method-selection #creditcard') | ->waitFor('#payment-method-selection #creditcard') | ||||
Show All 38 Lines | class PaymentStripeTest extends TestCaseDusk | ||||
/** | /** | ||||
* Test the auto-payment setup process | * Test the auto-payment setup process | ||||
* | * | ||||
* @group stripe | * @group stripe | ||||
*/ | */ | ||||
public function testAutoPaymentSetup(): void | public function testAutoPaymentSetup(): void | ||||
{ | { | ||||
$user = $this->getTestUser('payment-test@kolabnow.com', [ | $user = $this->getTestUser('payment-test@kolabnow.com', [ | ||||
'password' => 'simple123', | 'password' => \App\Utils::generatePassphrase(), | ||||
]); | ]); | ||||
// Test creating auto-payment | // Test creating auto-payment | ||||
$this->browse(function (Browser $browser) use ($user) { | $this->browse(function (Browser $browser) use ($user) { | ||||
$browser->visit(new Home()) | $browser->visit(new Home()) | ||||
->submitLogon('payment-test@kolabnow.com', 'simple123', true, ['paymentProvider' => 'stripe']) | ->submitLogon('payment-test@kolabnow.com', \App\Utils::generatePassphrase(), true, ['paymentProvider' => 'stripe']) | ||||
->on(new Dashboard()) | ->on(new Dashboard()) | ||||
->click('@links .link-wallet') | ->click('@links .link-wallet') | ||||
->on(new WalletPage()) | ->on(new WalletPage()) | ||||
->assertMissing('@body #mandate-form .alert') | ->assertMissing('@body #mandate-form .alert') | ||||
->click('@main #mandate-form button') | ->click('@main #mandate-form button') | ||||
->with(new Dialog('@payment-dialog'), function (Browser $browser) { | ->with(new Dialog('@payment-dialog'), function (Browser $browser) { | ||||
$browser->assertSeeIn('@title', 'Set up auto-payment') | $browser->assertSeeIn('@title', 'Set up auto-payment') | ||||
->waitFor('#payment-method-selection #creditcard') | ->waitFor('#payment-method-selection #creditcard') | ||||
▲ Show 20 Lines • Show All 114 Lines • Show Last 20 Lines |