mirror of
				https://github.com/invoiceninja/invoiceninja.git
				synced 2025-10-31 09:57:33 -04:00 
			
		
		
		
	- Added: iframeLoaded method for Cypress - Fixed: saving payment method id for CreditCard.php - Added: chromeWebSecurity: false flag for insecure iframe connections - Formatted: payment_methods/index - Formatted: payment-methods-table.blade.php - Added: Test for adding credit card to Stripe - Fixed: Removing client gateway tokens
		
			
				
	
	
		
			60 lines
		
	
	
		
			1.7 KiB
		
	
	
	
		
			JavaScript
		
	
	
	
		
			Vendored
		
	
	
	
			
		
		
	
	
			60 lines
		
	
	
		
			1.7 KiB
		
	
	
	
		
			JavaScript
		
	
	
	
		
			Vendored
		
	
	
	
| context('Payment methods', () => {
 | |
|     beforeEach(() => {
 | |
|         cy.clientLogin();
 | |
|     });
 | |
| 
 | |
|     it('should show payment methods page', () => {
 | |
|         cy.visit('/client/payment_methods');
 | |
|         cy.location().should(location => {
 | |
|             expect(location.pathname).to.eq('/client/payment_methods');
 | |
|         });
 | |
|     });
 | |
| 
 | |
|     it('should show payment methods text', () => {
 | |
|         cy.visit('/client/payment_methods');
 | |
| 
 | |
|         cy.get('body')
 | |
|             .find('span')
 | |
|             .first()
 | |
|             .should('contain.text', 'Payment Method');
 | |
|     });
 | |
| 
 | |
|     it('should add stripe credit card', () => {
 | |
|         cy.visit('/client/payment_methods');
 | |
| 
 | |
|         cy.get('body')
 | |
|             .find('#add-payment-method')
 | |
|             .first()
 | |
|             .should('contain.text', 'Add Payment Method')
 | |
|             .click()
 | |
| 
 | |
|         cy.location().should(location => {
 | |
|             expect(location.pathname).to.eq('/client/payment_methods/create');
 | |
|         });
 | |
| 
 | |
|         cy.wait(3000);
 | |
| 
 | |
|         cy.get('#cardholder-name').type('Invoice Ninja');
 | |
| 
 | |
|         cy.getWithinIframe('[name="cardnumber"]').type('4242424242424242');
 | |
|         cy.getWithinIframe('[name="exp-date"]').type('2442');
 | |
|         cy.getWithinIframe('[name="cvc"]').type('242');
 | |
|         cy.getWithinIframe('[name="postal"]').type('12345');
 | |
| 
 | |
|         cy.get('#card-button').click();
 | |
| 
 | |
|         cy.location().should(location => {
 | |
|             expect(location.pathname).to.eq('/client/payment_methods');
 | |
|         });
 | |
|     });
 | |
| 
 | |
|     it('should have per page options dropdown', () => {
 | |
|         cy.visit('/client/payment_methods');
 | |
| 
 | |
|         cy.get('body')
 | |
|             .find('select')
 | |
|             .first()
 | |
|             .should('have.value', '10');
 | |
|     });
 | |
| });
 |