Ignore:
Timestamp:
8 Mar 2015, 19:20:02 (10 years ago)
Author:
uli
Message:

Make something was selected before proceed.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.ikoba/branches/uli-payments/src/waeup/ikoba/customers/tests/test_browser.py

    r12689 r12690  
    15011501        contract.product_options = [prodoption,]
    15021502
    1503     def test_select_payment(self):
    1504         # select payment
     1503    def prepare_payment_select(self):
    15051504        IWorkflowState(self.customer).setState('approved')
    15061505        IWorkflowState(self.document).setState('verified')
     
    15131512        self.browser.getControl(name="form.password").value = 'cpwd'
    15141513        self.browser.getControl("Login").click()
    1515         # go to our contract
     1514
     1515    def test_select_payment(self):
     1516        # select payment
     1517        self.prepare_payment_select()
    15161518        self.browser.open('%s/CON1/edit' % self.contracts_path)
    15171519        self.browser.getControl("Proceed to checkout").click()
     
    15201522        self.assertTrue(
    15211523            'Credit Card (Demo Payments)' in self.browser.contents)
     1524
     1525    def test_select_payment_no_choice(self):
     1526        # we get warned if no payment was selected
     1527        self.prepare_payment_select()
     1528        never_ending_button_text = (
     1529            'Select payment method and proceed to payment gateway'
     1530            ' (final submission)')
     1531        self.browser.open(
     1532            '%s/CON1/select_payment_method' % self.contracts_path)
     1533        self.browser.getControl(never_ending_button_text).click()
     1534        self.assertTrue(
     1535            'Please pick a payment method' in self.browser.contents)
     1536
     1537    def test_select_payment_demo_provider(self):
     1538        # we can proceed with payments if we select a payment method
     1539        self.prepare_payment_select()
     1540        never_ending_button_text = (
     1541            'Select payment method and proceed to payment gateway'
     1542            ' (final submission)')
     1543        self.browser.open(
     1544            '%s/CON1/select_payment_method' % self.contracts_path)
     1545        radio_ctrl = self.browser.getControl(name='gw')
     1546        radio_ctrl.displayValue = ['Credit Card (Demo Payments)']
     1547        self.browser.getControl(never_ending_button_text).click()
     1548        self.assertTrue(
     1549            'Payment has been initiated.' in self.browser.contents)
Note: See TracChangeset for help on using the changeset viewer.