[#23019867] At this point, a supporter can change the pledge amount to a smaller amount (no new PayPal transaction required) or a larger amount (a new PayPal transaction is required and the old transaction is canceled.)
I've not implemented the storage of the premium yet -- that's coming next. I've not implemented straight out cancellation of a pledge yet. More UI refinement needed, especially around encouraging supporters not to decrease (or cancel) a pledge and refinements to help people know that they have made a modification.pull/1/head
parent
508a87a6dc
commit
5823c0e2de
|
@ -90,10 +90,12 @@ def paySandbox(test, selenium, url, authorize=False, already_at_url=False, sleep
|
||||||
|
|
||||||
email_element = WebDriverWait(selenium, 60).until(lambda d : d.find_element_by_id("login_email"))
|
email_element = WebDriverWait(selenium, 60).until(lambda d : d.find_element_by_id("login_email"))
|
||||||
email_element.click()
|
email_element.click()
|
||||||
|
email_element.clear()
|
||||||
email_element.send_keys(settings.PAYPAL_BUYER_LOGIN)
|
email_element.send_keys(settings.PAYPAL_BUYER_LOGIN)
|
||||||
|
|
||||||
password_element = WebDriverWait(selenium, 60).until(lambda d : d.find_element_by_id("login_password"))
|
password_element = WebDriverWait(selenium, 60).until(lambda d : d.find_element_by_id("login_password"))
|
||||||
password_element.click()
|
password_element.click()
|
||||||
|
password_element.clear()
|
||||||
password_element.send_keys(settings.PAYPAL_BUYER_PASSWORD)
|
password_element.send_keys(settings.PAYPAL_BUYER_PASSWORD)
|
||||||
|
|
||||||
submit_button = WebDriverWait(selenium, 60).until(lambda d : d.find_element_by_id("submitLogin"))
|
submit_button = WebDriverWait(selenium, 60).until(lambda d : d.find_element_by_id("submitLogin"))
|
||||||
|
|
|
@ -246,14 +246,28 @@ def support_campaign():
|
||||||
change_pledge_button = WebDriverWait(sel,20).until(lambda d: d.find_element_by_css_selector("input[value*='Change Pledge']"))
|
change_pledge_button = WebDriverWait(sel,20).until(lambda d: d.find_element_by_css_selector("input[value*='Change Pledge']"))
|
||||||
change_pledge_button.click()
|
change_pledge_button.click()
|
||||||
|
|
||||||
# enter a new pledge
|
# enter a new pledge, which is less than the previous amount and therefore doesn't require a new PayPal transaction
|
||||||
preapproval_amount_input = WebDriverWait(sel,20).until(lambda d: d.find_element_by_css_selector("input#id_preapproval_amount"))
|
preapproval_amount_input = WebDriverWait(sel,20).until(lambda d: d.find_element_by_css_selector("input#id_preapproval_amount"))
|
||||||
preapproval_amount_input.clear() # get rid of existing pledge
|
preapproval_amount_input.clear() # get rid of existing pledge
|
||||||
preapproval_amount_input.send_keys("5")
|
preapproval_amount_input.send_keys("5")
|
||||||
pledge_button = WebDriverWait(sel,20).until(lambda d: d.find_element_by_css_selector("input[value*='Modify Pledge']"))
|
pledge_button = WebDriverWait(sel,20).until(lambda d: d.find_element_by_css_selector("input[value*='Modify Pledge']"))
|
||||||
pledge_button.click()
|
pledge_button.click()
|
||||||
|
|
||||||
#
|
# return to the Work page again
|
||||||
|
work_url = WebDriverWait(sel,20).until(lambda d: d.find_element_by_css_selector('p > a[href*="/work/"]'))
|
||||||
|
work_url.click()
|
||||||
|
change_pledge_button = WebDriverWait(sel,20).until(lambda d: d.find_element_by_css_selector("input[value*='Change Pledge']"))
|
||||||
|
change_pledge_button.click()
|
||||||
|
|
||||||
|
# enter a new pledge, which is less than the previous amount and therefore doesn't require a new PayPal transaction
|
||||||
|
preapproval_amount_input = WebDriverWait(sel,20).until(lambda d: d.find_element_by_css_selector("input#id_preapproval_amount"))
|
||||||
|
preapproval_amount_input.clear() # get rid of existing pledge
|
||||||
|
preapproval_amount_input.send_keys("25")
|
||||||
|
pledge_button = WebDriverWait(sel,20).until(lambda d: d.find_element_by_css_selector("input[value*='Modify Pledge']"))
|
||||||
|
pledge_button.click()
|
||||||
|
paySandbox(None, sel, sel.current_url, authorize=True, already_at_url=True, sleep_time=5)
|
||||||
|
|
||||||
|
print pm.checkStatus()
|
||||||
|
|
||||||
return sel
|
return sel
|
||||||
#sel.quit()
|
#sel.quit()
|
||||||
|
|
Loading…
Reference in New Issue