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
d9fb0673
Commit
d9fb0673
authored
Feb 20, 2013
by
cahrens
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Test point for formatting of JSON entry.
parent
dd959d11
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
1 deletions
+22
-1
cms/djangoapps/contentstore/features/advanced-settings.feature
+7
-0
cms/djangoapps/contentstore/features/advanced-settings.py
+15
-1
No files found.
cms/djangoapps/contentstore/features/advanced-settings.feature
View file @
d9fb0673
...
...
@@ -22,3 +22,9 @@ Feature: Advanced (manual) course policy
Then
they are alphabetized
And
I reload the page
Then
they are alphabetized
Scenario
:
Test how multi-line input appears
Given
I have opened a new course in Studio
When
I select the Advanced Settings
And
I create a JSON object
Then
it is displayed as formatted
\ No newline at end of file
cms/djangoapps/contentstore/features/advanced-settings.py
View file @
d9fb0673
...
...
@@ -45,6 +45,19 @@ 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'
)
...
...
@@ -53,7 +66,8 @@ def create_entry(key, value):
# 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
.
ARROW_LEFT
)
css_find
(
'.CodeMirror textarea'
)
.
last
.
_element
.
send_keys
(
Keys
.
BACK_SPACE
)
css_find
(
'.CodeMirror textarea'
)
.
last
.
_element
.
send_keys
(
Keys
.
BACK_SPACE
)
css_find
(
'.CodeMirror textarea'
)
.
last
.
fill
(
value
)
...
...
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