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
e337292b
Commit
e337292b
authored
Feb 21, 2013
by
Jay Zoldak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix existing advanced settings lettuce tests.
parent
c10dc838
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
8 deletions
+23
-8
cms/djangoapps/contentstore/features/advanced-settings.py
+16
-8
cms/djangoapps/contentstore/features/common.py
+2
-0
common/djangoapps/terrain/steps.py
+5
-0
No files found.
cms/djangoapps/contentstore/features/advanced-settings.py
View file @
e337292b
...
...
@@ -45,30 +45,37 @@ def create_new_entries(step):
def
they_are_alphabetized
(
step
):
assert_policy_entries
([
"a"
,
"display_name"
,
"z"
],
[
'"zebra"'
,
'"Robot Super Course"'
,
'"apple"'
])
@step
(
'I create a JSON object$'
)
def
create_JSON_object
(
step
):
create_entry
(
"json"
,
'{"key": "value", "key_2": "value_2"}'
)
click_save
()
@step
(
'it is displayed as formatted$'
)
def
it_is_formatted
(
step
):
assert_policy_entries
([
"display_name"
,
"json"
],
[
'"Robot Super Course"'
,
'{
\n
"key": "value",
\n
"key_2": "value_2"
\n
}'
])
# TODO: this is copied from terrain's step.py. Need to figure out how to share that code.
@step
(
'I reload the page$'
)
def
reload_the_page
(
step
):
world
.
browser
.
reload
()
def
create_entry
(
key
,
value
):
css_click_at
(
'a.new-advanced-policy-item'
)
newKey
=
css_find
(
'#__new_advanced_key__ input'
)
.
first
newKey
.
fill
(
key
)
# Scroll down the page so the button is visible
world
.
scroll_to_bottom
()
css_click_at
(
'a.new-advanced-policy-item'
,
10
,
10
)
new_key_css
=
'div#__new_advanced_key__ input'
new_key_element
=
css_find
(
new_key_css
)
.
first
new_key_element
.
fill
(
key
)
# For some reason have to get the instance for each command (get error that it is no longer attached to the DOM)
# Have to do all this because Selenium has a bug that fill does not remove existing text
css_find
(
'.CodeMirror textarea'
)
.
last
.
double_click
()
css_find
(
'.CodeMirror textarea'
)
.
last
.
_element
.
send_keys
(
Keys
.
BACK_SPACE
)
css_find
(
'.CodeMirror textarea'
)
.
last
.
_element
.
send_keys
(
Keys
.
BACK_SPAC
E
)
css_find
(
'.CodeMirror textarea'
)
.
last
.
fill
(
value
)
new_value_css
=
'div.CodeMirror textarea'
css_find
(
new_value_css
)
.
last
.
fill
(
""
)
css_find
(
new_value_css
)
.
last
.
_element
.
send_keys
(
Keys
.
DELETE
,
Keys
.
DELET
E
)
css_find
(
new_value_css
)
.
last
.
fill
(
value
)
def
delete_entry
(
index
):
...
...
@@ -91,11 +98,12 @@ def assert_entries(css, expected_values):
assert_equal
(
len
(
expected_values
),
len
(
webElements
))
# Sometimes get stale reference if I hold on to the array of elements
for
counter
in
range
(
len
(
expected_values
)):
assert_equal
(
expected_values
[
counter
],
css_find
(
css
)[
counter
]
.
value
)
assert_equal
(
expected_values
[
counter
],
css_find
(
css
)[
counter
]
.
value
)
def
click_save
():
css
=
".save-button"
def
is_shown
(
driver
):
visible
=
css_find
(
css
)
.
first
.
visible
if
visible
:
...
...
cms/djangoapps/contentstore/features/common.py
View file @
e337292b
...
...
@@ -11,6 +11,7 @@ logger = getLogger(__name__)
########### STEP HELPERS ##############
@step
(
'I (?:visit|access|open) the Studio homepage$'
)
def
i_visit_the_studio_homepage
(
step
):
# To make this go to port 8001, put
...
...
@@ -50,6 +51,7 @@ def i_have_opened_a_new_course(step):
####### HELPER FUNCTIONS ##############
def
create_studio_user
(
uname
=
'robot'
,
email
=
'robot+studio@edx.org'
,
...
...
common/djangoapps/terrain/steps.py
View file @
e337292b
...
...
@@ -108,6 +108,11 @@ def i_am_an_edx_user(step):
#### helper functions
@world.absorb
def
scroll_to_bottom
():
# Maximize the browser
world
.
browser
.
execute_script
(
"window.scrollTo(0, screen.height);"
)
@world.absorb
def
create_user
(
uname
):
...
...
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