mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-08 06:24:30 -04:00
Crypress: Payment with new card
This commit is contained in:
parent
6992216117
commit
e6697e183c
@ -60,7 +60,7 @@ class BraintreePaymentDriver extends BaseDriver
|
||||
{
|
||||
$class = self::$methods[$payment_method_id];
|
||||
|
||||
$this->payment_method = new PayPal($this);
|
||||
$this->payment_method = new $class($this);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
@ -1,8 +1,10 @@
|
||||
{
|
||||
"video": false,
|
||||
"baseUrl": "https://localhost:8080/",
|
||||
"baseUrl": "http://localhost:8080/",
|
||||
"chromeWebSecurity": false,
|
||||
"env": {
|
||||
"runningEnvironment": "docker"
|
||||
}
|
||||
},
|
||||
"viewportWidth": 1280,
|
||||
"viewportHeight": 800
|
||||
}
|
||||
|
47
cypress/integration/gateways/braintree_credit_card.spec.js
vendored
Normal file
47
cypress/integration/gateways/braintree_credit_card.spec.js
vendored
Normal file
@ -0,0 +1,47 @@
|
||||
context('Checkout.com: Credit card testing', () => {
|
||||
beforeEach(() => {
|
||||
cy.clientLogin();
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
cy.visit('/client/logout');
|
||||
});
|
||||
|
||||
it('should not be able to add payment method', function () {
|
||||
cy.visit('/client/payment_methods');
|
||||
|
||||
cy.get('[data-cy=add-payment-method]').click();
|
||||
cy.get('[data-cy=add-credit-card-link]').click();
|
||||
|
||||
cy.get('[data-ref=gateway-container]')
|
||||
.contains('This payment method can be can saved for future use, once you complete your first transaction. Don\'t forget to check "Store credit card details" during payment process.');
|
||||
});
|
||||
|
||||
it('should pay with new card', function () {
|
||||
cy.visit('/client/invoices');
|
||||
|
||||
cy.get('[data-cy=pay-now]').first().click();
|
||||
cy.get('[data-cy=pay-now-dropdown]').click();
|
||||
cy.get('[data-cy=pay-with-0]').click();
|
||||
|
||||
cy
|
||||
.get('#braintree-hosted-field-number')
|
||||
.wait(5000)
|
||||
.iframeLoaded()
|
||||
.its('document')
|
||||
.getInDocument('#credit-card-number')
|
||||
.type(4111111111111111)
|
||||
|
||||
cy
|
||||
.get('#braintree-hosted-field-expirationDate')
|
||||
.wait(5000)
|
||||
.iframeLoaded()
|
||||
.its('document')
|
||||
.getInDocument('#expiration')
|
||||
.type(1224)
|
||||
|
||||
cy.get('#pay-now').click();
|
||||
|
||||
cy.url().should('contain', '/client/payments/VolejRejNm');
|
||||
});
|
||||
});
|
Loading…
x
Reference in New Issue
Block a user