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
802bd1ff
Commit
802bd1ff
authored
Jul 18, 2016
by
Ahsan Ulhaq
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
End-to-end test causes Jenkins job to hang
ECOM-4823
parent
16cf256d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
8 deletions
+21
-8
acceptance_tests/mixins.py
+7
-4
acceptance_tests/pages/ecommerce.py
+1
-2
acceptance_tests/pages/lms.py
+13
-2
No files found.
acceptance_tests/mixins.py
View file @
802bd1ff
...
@@ -79,8 +79,7 @@ class LogistrationMixin(LmsUserMixin):
...
@@ -79,8 +79,7 @@ class LogistrationMixin(LmsUserMixin):
email
=
email
or
LMS_EMAIL
email
=
email
or
LMS_EMAIL
password
=
password
or
LMS_PASSWORD
password
=
password
or
LMS_PASSWORD
# Note: We use Selenium directly here (as opposed to bok-choy) to avoid issues with promises being broken.
self
.
lms_login_page
.
visit
(
course_id
)
self
.
lms_login_page
.
browser
.
get
(
self
.
lms_login_page
.
url
(
course_id
))
# pylint: disable=not-callable
self
.
lms_login_page
.
login
(
email
,
password
)
self
.
lms_login_page
.
login
(
email
,
password
)
def
register_via_ui
(
self
,
course_id
=
None
):
def
register_via_ui
(
self
,
course_id
=
None
):
...
@@ -110,8 +109,7 @@ def login_with_lms(self, email=None, password=None, course_id=None):
...
@@ -110,8 +109,7 @@ def login_with_lms(self, email=None, password=None, course_id=None):
email
=
email
or
LMS_EMAIL
email
=
email
or
LMS_EMAIL
password
=
password
or
LMS_PASSWORD
password
=
password
or
LMS_PASSWORD
# Note: We use Selenium directly here (as opposed to bok-choy) to avoid issues with promises being broken.
self
.
lms_login_page
.
visit
(
course_id
)
self
.
lms_login_page
.
browser
.
get
(
self
.
lms_login_page
.
url
(
course_id
))
# pylint: disable=not-callable
self
.
lms_login_page
.
login
(
email
,
password
)
self
.
lms_login_page
.
login
(
email
,
password
)
...
@@ -125,6 +123,11 @@ class OttoAuthenticationMixin(object):
...
@@ -125,6 +123,11 @@ class OttoAuthenticationMixin(object):
email
=
email
or
LMS_EMAIL
email
=
email
or
LMS_EMAIL
password
=
password
or
LMS_PASSWORD
password
=
password
or
LMS_PASSWORD
# Note: We have to visit LMS Login page to provide basic auth as otto login page redirect to LMS login page
# which requires basic auth and not providing that could cause the test to hang.
lms_login_page
=
LMSLoginPage
(
self
.
browser
)
lms_login_page
.
visit
()
self
.
otto_login_page
.
visit
()
self
.
otto_login_page
.
visit
()
submit_lms_login_form
(
self
.
otto_login_page
,
email
,
password
)
submit_lms_login_form
(
self
.
otto_login_page
,
email
,
password
)
...
...
acceptance_tests/pages/ecommerce.py
View file @
802bd1ff
...
@@ -36,6 +36,5 @@ class EcommerceLoginPage(LMSLoginPage):
...
@@ -36,6 +36,5 @@ class EcommerceLoginPage(LMSLoginPage):
that page and it's properties.
that page and it's properties.
"""
"""
@property
def
url
(
self
,
course_id
=
None
):
# pylint: disable=arguments-differ,unused-argument
def
url
(
self
):
# pylint: disable=arguments-differ
return
EcommerceAppPage
.
build_ecommerce_url
(
'login'
)
return
EcommerceAppPage
.
build_ecommerce_url
(
'login'
)
acceptance_tests/pages/lms.py
View file @
802bd1ff
import
abc
import
abc
import
urllib
import
urllib
import
socket
from
bok_choy.page_object
import
PageObject
from
bok_choy.page_object
import
PageObject
,
PageLoadError
,
unguarded
from
bok_choy.promise
import
EmptyPromise
from
bok_choy.promise
import
EmptyPromise
from
selenium.common.exceptions
import
NoSuchElementException
from
selenium.common.exceptions
import
NoSuchElementException
,
WebDriverException
from
selenium.webdriver.support.select
import
Select
from
selenium.webdriver.support.select
import
Select
from
acceptance_tests.config
import
LMS_URL_ROOT
,
BASIC_AUTH_USERNAME
,
BASIC_AUTH_PASSWORD
,
MARKETING_URL_ROOT
from
acceptance_tests.config
import
LMS_URL_ROOT
,
BASIC_AUTH_USERNAME
,
BASIC_AUTH_PASSWORD
,
MARKETING_URL_ROOT
...
@@ -44,6 +45,16 @@ class LMSLoginPage(LMSPage):
...
@@ -44,6 +45,16 @@ class LMSLoginPage(LMSPage):
# Wait for LMS to redirect to the dashboard
# Wait for LMS to redirect to the dashboard
EmptyPromise
(
self
.
_is_browser_on_lms_dashboard
,
"LMS login redirected to dashboard"
)
.
fulfill
()
EmptyPromise
(
self
.
_is_browser_on_lms_dashboard
,
"LMS login redirected to dashboard"
)
.
fulfill
()
@unguarded
def
visit
(
self
,
course_id
=
None
):
# pylint: disable=arguments-differ
url
=
self
.
url
(
course_id
)
# pylint: disable=not-callable
try
:
self
.
browser
.
get
(
url
)
except
(
WebDriverException
,
socket
.
gaierror
):
raise
PageLoadError
(
"Could not load page '{!r}' at URL '{}'"
.
format
(
self
,
url
))
class
LMSRegistrationPage
(
LMSPage
):
class
LMSRegistrationPage
(
LMSPage
):
def
url
(
self
,
course_id
=
None
):
# pylint: disable=arguments-differ
def
url
(
self
,
course_id
=
None
):
# pylint: disable=arguments-differ
...
...
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