mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-07 21:04:28 -04:00
Merge pull request #6274 from beganovich/v5-588-tests
(v5) Required fields check browser test
This commit is contained in:
commit
9baf394173
@ -7,7 +7,8 @@
|
|||||||
- Client portal: Hide "Pay now" buttons if no gateways are configured
|
- Client portal: Hide "Pay now" buttons if no gateways are configured
|
||||||
|
|
||||||
## Fixed:
|
## Fixed:
|
||||||
- Client portal: Showing message instead of blank page when trying to download zero quotes.
|
- Client portal: Showing message instead of blank page when trying to download zero quotes
|
||||||
|
- Client portal: Fixed bug with payment gateways after checking for required fields
|
||||||
|
|
||||||
## [v5.2.0-release](https://github.com/invoiceninja/invoiceninja/releases/tag/v5.2.0-release)
|
## [v5.2.0-release](https://github.com/invoiceninja/invoiceninja/releases/tag/v5.2.0-release)
|
||||||
## Added:
|
## Added:
|
||||||
|
@ -12,6 +12,8 @@
|
|||||||
|
|
||||||
namespace Tests\Browser\ClientPortal;
|
namespace Tests\Browser\ClientPortal;
|
||||||
|
|
||||||
|
use App\Models\Client;
|
||||||
|
use App\Models\CompanyGateway;
|
||||||
use Laravel\Dusk\Browser;
|
use Laravel\Dusk\Browser;
|
||||||
use Tests\Browser\Pages\ClientPortal\Login;
|
use Tests\Browser\Pages\ClientPortal\Login;
|
||||||
use Tests\DuskTestCase;
|
use Tests\DuskTestCase;
|
||||||
@ -42,4 +44,37 @@ class PaymentsTest extends DuskTestCase
|
|||||||
->visitRoute('client.logout');
|
->visitRoute('client.logout');
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function testRequiredFieldsCheck()
|
||||||
|
{
|
||||||
|
$this->disableCompanyGateways();
|
||||||
|
|
||||||
|
// Enable Stripe.
|
||||||
|
CompanyGateway::where('gateway_key', 'd14dd26a37cecc30fdd65700bfb55b23')->restore();
|
||||||
|
|
||||||
|
// Stripe requires post code.
|
||||||
|
Client::first()->update(['postal_code' => null]);
|
||||||
|
|
||||||
|
$this->browse(function (Browser $browser) {
|
||||||
|
$browser
|
||||||
|
->visitRoute('client.invoices.index')
|
||||||
|
->click('@pay-now')
|
||||||
|
->press('Pay Now')
|
||||||
|
->clickLink('Credit Card')
|
||||||
|
->assertSee('Postal Code')
|
||||||
|
->type('client_postal_code', 10000)
|
||||||
|
->press('Continue')
|
||||||
|
->pause(2000)
|
||||||
|
->type('#cardholder-name', 'John Doe')
|
||||||
|
->withinFrame('iframe', function (Browser $browser) {
|
||||||
|
$browser
|
||||||
|
->type('cardnumber', '4242 4242 4242 4242')
|
||||||
|
->type('exp-date', '04/22')
|
||||||
|
->type('cvc', '242');
|
||||||
|
})
|
||||||
|
->click('#pay-now')
|
||||||
|
->waitForText('Details of the payment', 60)
|
||||||
|
->visitRoute('client.logout');
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user