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
78fd1fc1
Commit
78fd1fc1
authored
Nov 01, 2013
by
Will Daly
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1568 from edx/will/acceptance-test-fixes
Will/acceptance test fixes
parents
3674d4fe
9ab35759
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
10 deletions
+26
-10
common/djangoapps/terrain/ui_helpers.py
+19
-5
lms/djangoapps/courseware/features/problems.py
+6
-1
lms/djangoapps/instructor/features/bulk_email.py
+1
-4
No files found.
common/djangoapps/terrain/ui_helpers.py
View file @
78fd1fc1
...
...
@@ -44,6 +44,12 @@ REQUIREJS_WAIT = {
re
.
compile
(
'^My Courses
\
|'
):
[
"js/sock"
,
"gettext"
,
"js/base"
,
"jquery.ui"
,
"coffee/src/main"
,
"underscore"
],
# Upload
re
.
compile
(
r'^\s*Files & Uploads'
):
[
'js/base'
,
'jquery.ui'
,
'coffee/src/main'
,
'underscore'
,
'js/views/assets'
,
'js/views/asset'
]
}
...
...
@@ -389,12 +395,14 @@ def css_find(css, wait_time=30):
@world.absorb
def
css_click
(
css_selector
,
index
=
0
,
wait_time
=
30
):
def
css_click
(
css_selector
,
index
=
0
,
wait_time
=
30
,
dismiss_alert
=
False
):
"""
Perform a click on a CSS selector, first waiting for the element
to be present and clickable.
This method will return True if the click worked.
If `dismiss_alert` is true, dismiss any alerts that appear.
"""
wait_for_clickable
(
css_selector
,
timeout
=
wait_time
)
wait_for_visible
(
css_selector
,
index
=
index
,
timeout
=
wait_time
)
...
...
@@ -403,10 +411,16 @@ def css_click(css_selector, index=0, wait_time=30):
msg
=
"Element {}[{}] is present but not visible"
.
format
(
css_selector
,
index
)
)
result
=
retry_on_exception
(
lambda
:
css_find
(
css_selector
)[
index
]
.
click
())
if
result
:
wait_for_js_to_load
()
return
result
retry_on_exception
(
lambda
:
css_find
(
css_selector
)[
index
]
.
click
())
# Dismiss any alerts that occur.
# We need to do this before calling `wait_for_js_to_load()`
# to avoid getting an unexpected alert exception
if
dismiss_alert
:
world
.
browser
.
get_alert
()
.
accept
()
wait_for_js_to_load
()
return
True
@world.absorb
...
...
lms/djangoapps/courseware/features/problems.py
View file @
78fd1fc1
...
...
@@ -107,6 +107,9 @@ def check_problem(step):
world
.
browser
.
execute_script
(
"window.scrollTo(0,1024)"
)
world
.
css_click
(
"input.check"
)
# Wait for the problem to finish re-rendering
world
.
wait_for_ajax_complete
()
@step
(
u'The "([^"]*)" problem displays a "([^"]*)" answer'
)
def
assert_problem_has_answer
(
step
,
problem_type
,
answer_class
):
...
...
@@ -127,6 +130,9 @@ def assert_problem_has_answer(step, problem_type, answer_class):
def
reset_problem
(
_step
):
world
.
css_click
(
'input.reset'
)
# Wait for the problem to finish re-rendering
world
.
wait_for_ajax_complete
()
@step
(
u'I press the button with the label "([^"]*)"$'
)
def
press_the_button_with_label
(
_step
,
buttonname
):
...
...
@@ -172,7 +178,6 @@ def assert_answer_mark(_step, problem_type, isnt_marked, correctness):
*problem_type* is a string identifying the type of problem (e.g. 'drop down')
*correctness* is in ['correct', 'incorrect', 'unanswered']
"""
# Determine which selector(s) to look for based on correctness
assert
(
correctness
in
[
'correct'
,
'incorrect'
,
'unanswered'
])
assert
(
problem_type
in
PROBLEM_DICT
)
...
...
lms/djangoapps/instructor/features/bulk_email.py
View file @
78fd1fc1
...
...
@@ -115,10 +115,7 @@ def when_i_send_an_email(step, recipient):
editor
.
fill
(
'test message'
)
# Click send
world
.
css_click
(
'input[name="send"]'
)
# Confirm the alert
world
.
browser
.
get_alert
()
.
accept
()
world
.
css_click
(
'input[name="send"]'
,
dismiss_alert
=
True
)
# Expect to see a message that the email was sent
expected_msg
=
"Your email was successfully queued for sending."
...
...
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