Changeset 12694
- Timestamp:
- 8 Mar 2015, 22:24:33 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.ikoba/branches/uli-payments/src/waeup/ikoba/customers/tests/test_browser.py
r12693 r12694 1287 1287 # Tests for contract related views and pages 1288 1288 1289 never_ending_button_text = ( 1290 'Select payment method and proceed to payment ' 1291 'gateway (final submission)') 1292 1293 def add_product_option(self, contract): 1294 prodoption = ProductOption() 1295 prodoption.title = u'Any product option' 1296 prodoption.fee = Decimal('88.8') 1297 prodoption.currency = 'EUR' 1298 contract.product_options = [prodoption, ] 1299 1300 def prepare_payment_select(self): 1301 IWorkflowState(self.customer).setState('approved') 1302 IWorkflowState(self.document).setState('verified') 1303 self.contract.document_object = self.document 1304 self.add_product_option(self.contract) 1305 IWorkflowState(self.contract).setState('created') 1306 # login as customer 1307 self.browser.open(self.login_path) 1308 self.browser.getControl(name="form.login").value = self.customer_id 1309 self.browser.getControl(name="form.password").value = 'cpwd' 1310 self.browser.getControl("Login").click() 1311 1289 1312 def test_manage_contract(self): 1290 1313 # Managers can access the pages of customer contractsconter … … 1559 1582 self.assertEqual(IWorkflowState(self.contract).getState(), 'approved') 1560 1583 1561 def add_product_option(self, contract):1562 prodoption = ProductOption()1563 prodoption.title = u'Any product option'1564 prodoption.fee = Decimal('88.8')1565 prodoption.currency = 'EUR'1566 contract.product_options = [prodoption, ]1567 1568 def prepare_payment_select(self):1569 IWorkflowState(self.customer).setState('approved')1570 IWorkflowState(self.document).setState('verified')1571 self.contract.document_object = self.document1572 self.add_product_option(self.contract)1573 IWorkflowState(self.contract).setState('created')1574 # login as customer1575 self.browser.open(self.login_path)1576 self.browser.getControl(name="form.login").value = self.customer_id1577 self.browser.getControl(name="form.password").value = 'cpwd'1578 self.browser.getControl("Login").click()1579 1580 1584 def test_select_payment(self): 1581 1585 # select payment … … 1591 1595 # we get warned if no payment was selected 1592 1596 self.prepare_payment_select() 1593 never_ending_button_text = (1594 'Select payment method and proceed to payment gateway'1595 ' (final submission)')1596 1597 self.browser.open( 1597 1598 '%s/CON1/select_payment_method' % self.contracts_path) 1598 self.browser.getControl( never_ending_button_text).click()1599 self.browser.getControl(self.never_ending_button_text).click() 1599 1600 self.assertTrue( 1600 1601 'Please pick a payment method' in self.browser.contents) … … 1603 1604 # we can proceed with payments if we select a payment method 1604 1605 self.prepare_payment_select() 1605 never_ending_button_text = (1606 'Select payment method and proceed to payment gateway'1607 ' (final submission)')1608 1606 self.browser.open( 1609 1607 '%s/CON1/select_payment_method' % self.contracts_path) 1610 1608 radio_ctrl = self.browser.getControl(name='gw') 1611 1609 radio_ctrl.displayValue = ['Credit Card (Demo Payments)'] 1612 self.browser.getControl( never_ending_button_text).click()1610 self.browser.getControl(self.never_ending_button_text).click() 1613 1611 self.assertTrue( 1614 1612 'Payment has been initiated.' in self.browser.contents)
Note: See TracChangeset for help on using the changeset viewer.