Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
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
edx-platform
Commits
defbd874
Commit
defbd874
authored
Feb 19, 2014
by
Will Daly
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Protect Acid XBlock test from stale element or zero-length locator list
parent
30f5b460
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
6 deletions
+28
-6
common/test/acceptance/pages/studio/unit.py
+11
-6
common/test/acceptance/tests/test_lms.py
+17
-0
No files found.
common/test/acceptance/pages/studio/unit.py
View file @
defbd874
...
...
@@ -4,7 +4,7 @@ Unit page in Studio
from
bok_choy.page_object
import
PageObject
from
bok_choy.query
import
SubQuery
from
bok_choy.promise
import
EmptyPromise
,
fulfill
from
bok_choy.promise
import
Promise
,
EmptyPromise
,
fulfill
from
.
import
BASE_URL
...
...
@@ -27,12 +27,17 @@ class UnitPage(PageObject):
return
self
.
is_css_present
(
'body.view-unit'
)
def
component
(
self
,
title
):
return
Component
(
self
.
browser
,
self
.
q
(
css
=
Component
.
BODY_SELECTOR
)
.
filter
(
return
Component
(
self
.
browser
,
self
.
_locator
(
title
))
def
_locator
(
self
,
title
):
def
_check_func
():
locators
=
self
.
q
(
css
=
Component
.
BODY_SELECTOR
)
.
filter
(
SubQuery
(
css
=
Component
.
NAME_SELECTOR
)
.
filter
(
text
=
title
)
)[
0
][
'data-locator'
]
)
)
.
map
(
lambda
el
:
el
[
'data-locator'
])
.
results
return
(
len
(
locators
)
>
0
,
locators
[
0
])
return
fulfill
(
Promise
(
_check_func
,
"Found data locator for component"
))
class
Component
(
PageObject
):
...
...
common/test/acceptance/tests/test_lms.py
View file @
defbd874
...
...
@@ -69,6 +69,23 @@ class RegistrationTest(UniqueCourseTest):
course_names
=
dashboard
.
available_courses
self
.
assertIn
(
self
.
course_info
[
'display_name'
],
course_names
)
def
assert_course_available
(
self
,
course_id
):
# Occassionally this does not show up immediately,
# so we wait and try reloading the page
def
_check_course_available
():
available
=
self
.
find_courses_page
.
course_id_list
if
course_id
in
available
:
return
True
else
:
self
.
find_courses_page
.
visit
()
return
False
return
fulfill
(
EmptyPromise
(
_check_course_available
,
"Found course {course_id} in the list of available courses"
.
format
(
course_id
=
course_id
),
try_limit
=
3
,
try_interval
=
2
))
class
LanguageTest
(
UniqueCourseTest
):
"""
...
...
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