Changeset View
Changeset View
Standalone View
Standalone View
src/tests/Browser/PaymentStripeTest.php
Show First 20 Lines • Show All 110 Lines • ▼ Show 20 Lines | public function testAutoPaymentSetup(): void | ||||
$browser->visit(new Home()) | $browser->visit(new Home()) | ||||
->submitLogon('payment-test@kolabnow.com', 'simple123', true, ['paymentProvider' => 'stripe']) | ->submitLogon('payment-test@kolabnow.com', 'simple123', 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', 'Add auto-payment') | $browser->assertSeeIn('@title', 'Set up auto-payment') | ||||
->waitFor('#payment-method-selection #creditcard') | ->waitFor('#payment-method-selection #creditcard') | ||||
->assertMissing('#payment-method-selection #paypal') | ->assertMissing('#payment-method-selection #paypal') | ||||
->assertMissing('#payment-method-selection #banktransfer') | ->assertMissing('#payment-method-selection #banktransfer') | ||||
->click('#creditcard'); | ->click('#creditcard'); | ||||
}) | }) | ||||
->with(new Dialog('@payment-dialog'), function (Browser $browser) { | ->with(new Dialog('@payment-dialog'), function (Browser $browser) { | ||||
$browser->assertSeeIn('@title', 'Add auto-payment') | $browser->assertSeeIn('@title', 'Set up auto-payment') | ||||
->assertSeeIn('@body label[for="mandate_amount"]', 'Fill up by') | ->assertSeeIn('@body label[for="mandate_amount"]', 'Fill up by') | ||||
->assertValue('@body #mandate_amount', PaymentProvider::MIN_AMOUNT / 100) | ->assertValue('@body #mandate_amount', PaymentProvider::MIN_AMOUNT / 100) | ||||
->assertSeeIn('@body label[for="mandate_balance"]', 'when account balance is below') // phpcs:ignore | ->assertSeeIn('@body label[for="mandate_balance"]', 'when account balance is below') // phpcs:ignore | ||||
->assertValue('@body #mandate_balance', '0') | ->assertValue('@body #mandate_balance', '0') | ||||
->assertSeeIn('@button-cancel', 'Cancel') | ->assertSeeIn('@button-cancel', 'Cancel') | ||||
->assertSeeIn('@button-action', 'Continue') | ->assertSeeIn('@button-action', 'Continue') | ||||
// Test error handling | // Test error handling | ||||
->type('@body #mandate_amount', 'aaa') | ->type('@body #mandate_amount', 'aaa') | ||||
▲ Show 20 Lines • Show All 100 Lines • Show Last 20 Lines |