Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
ecommerce
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
ecommerce
Commits
90709cf4
Commit
90709cf4
authored
Apr 11, 2018
by
raeeschachar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix for
https://openedx.atlassian.net/browse/LEARNER-4765
parent
f124e98b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
1 deletions
+35
-1
e2e/test_payment.py
+35
-1
No files found.
e2e/test_payment.py
View file @
90709cf4
...
@@ -9,7 +9,8 @@ from selenium.webdriver.support.wait import WebDriverWait
...
@@ -9,7 +9,8 @@ from selenium.webdriver.support.wait import WebDriverWait
from
e2e.api
import
DiscoveryApi
,
EcommerceApi
,
EnrollmentApi
from
e2e.api
import
DiscoveryApi
,
EcommerceApi
,
EnrollmentApi
from
e2e.config
import
LMS_USERNAME
,
PAYPAL_EMAIL
,
PAYPAL_PASSWORD
from
e2e.config
import
LMS_USERNAME
,
PAYPAL_EMAIL
,
PAYPAL_PASSWORD
from
e2e.helpers
import
EcommerceHelpers
from
e2e.constants
import
ADDRESS_FR
,
ADDRESS_US
from
e2e.helpers
import
EcommerceHelpers
,
LmsHelpers
log
=
logging
.
getLogger
(
__name__
)
log
=
logging
.
getLogger
(
__name__
)
...
@@ -119,6 +120,7 @@ class TestSeatPayment(object):
...
@@ -119,6 +120,7 @@ class TestSeatPayment(object):
def
add_item_to_basket
(
self
,
selenium
,
sku
):
def
add_item_to_basket
(
self
,
selenium
,
sku
):
# Add the item to the basket and start the checkout process
# Add the item to the basket and start the checkout process
selenium
.
get
(
EcommerceHelpers
.
build_url
(
'/basket/add/?sku='
+
sku
))
selenium
.
get
(
EcommerceHelpers
.
build_url
(
'/basket/add/?sku='
+
sku
))
selenium
.
implicitly_wait
(
3
)
assert
selenium
.
find_element_by_css_selector
(
'.basket-client-side'
)
.
is_displayed
()
assert
selenium
.
find_element_by_css_selector
(
'.basket-client-side'
)
.
is_displayed
()
def
refund_orders_for_course_run
(
self
,
course_run_id
):
def
refund_orders_for_course_run
(
self
,
course_run_id
):
...
@@ -136,3 +138,35 @@ class TestSeatPayment(object):
...
@@ -136,3 +138,35 @@ class TestSeatPayment(object):
verified_seat
=
seat
verified_seat
=
seat
break
break
return
verified_seat
return
verified_seat
def
test_verified_seat_payment_with_credit_card
(
self
,
selenium
):
""" Validates users can add a verified seat to the cart and checkout with a credit card. """
LmsHelpers
.
login
(
selenium
)
# Get the course run we want to purchase
course_run
=
self
.
get_verified_course_run
()
verified_seat
=
self
.
get_verified_seat
(
course_run
)
for
address
in
(
ADDRESS_US
,
ADDRESS_FR
,):
self
.
add_item_to_basket
(
selenium
,
verified_seat
[
'sku'
])
self
.
checkout_with_credit_card
(
selenium
,
address
)
self
.
assert_browser_on_receipt_page
(
selenium
)
course_run_key
=
course_run
[
'key'
]
self
.
assert_user_enrolled_in_course_run
(
LMS_USERNAME
,
course_run_key
)
self
.
refund_orders_for_course_run
(
course_run_key
)
def
test_verified_seat_payment_with_paypal
(
self
,
selenium
):
""" Validates users can add a verified seat to the cart and checkout with PayPal. """
LmsHelpers
.
login
(
selenium
)
# Get the course run we want to purchase
course_run
=
self
.
get_verified_course_run
()
verified_seat
=
self
.
get_verified_seat
(
course_run
)
self
.
add_item_to_basket
(
selenium
,
verified_seat
[
'sku'
])
self
.
checkout_with_paypal
(
selenium
)
self
.
assert_browser_on_receipt_page
(
selenium
)
course_run_key
=
course_run
[
'key'
]
self
.
assert_user_enrolled_in_course_run
(
LMS_USERNAME
,
course_run_key
)
self
.
refund_orders_for_course_run
(
course_run_key
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment