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
b312944d
Commit
b312944d
authored
Jun 05, 2013
by
Jonah Stanley
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #64 from edx/jonahstanley/fix-codemirror-tests
Jonahstanley/fix codemirror tests
parents
e092aadb
bbd34235
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
13 deletions
+8
-13
cms/djangoapps/contentstore/features/advanced-settings.feature
+0
-8
cms/djangoapps/contentstore/features/advanced-settings.py
+8
-5
No files found.
cms/djangoapps/contentstore/features/advanced-settings.feature
View file @
b312944d
...
@@ -11,8 +11,6 @@ Feature: Advanced (manual) course policy
...
@@ -11,8 +11,6 @@ Feature: Advanced (manual) course policy
Given
I am on the Advanced Course Settings page in Studio
Given
I am on the Advanced Course Settings page in Studio
Then
the settings are alphabetized
Then
the settings are alphabetized
# Skipped because Ubuntu ChromeDriver cannot click notification "Cancel"
@skip
Scenario
:
Test cancel editing key value
Scenario
:
Test cancel editing key value
Given
I am on the Advanced Course Settings page in Studio
Given
I am on the Advanced Course Settings page in Studio
When
I edit the value of a policy key
When
I edit the value of a policy key
...
@@ -21,8 +19,6 @@ Feature: Advanced (manual) course policy
...
@@ -21,8 +19,6 @@ Feature: Advanced (manual) course policy
And
I reload the page
And
I reload the page
Then
the policy key value is unchanged
Then
the policy key value is unchanged
# Skipped because Ubuntu ChromeDriver cannot click notification "Save"
@skip
Scenario
:
Test editing key value
Scenario
:
Test editing key value
Given
I am on the Advanced Course Settings page in Studio
Given
I am on the Advanced Course Settings page in Studio
When
I edit the value of a policy key and save
When
I edit the value of a policy key and save
...
@@ -30,8 +26,6 @@ Feature: Advanced (manual) course policy
...
@@ -30,8 +26,6 @@ Feature: Advanced (manual) course policy
And
I reload the page
And
I reload the page
Then
the policy key value is changed
Then
the policy key value is changed
# Skipped because Ubuntu ChromeDriver cannot edit CodeMirror input
@skip
Scenario
:
Test how multi-line input appears
Scenario
:
Test how multi-line input appears
Given
I am on the Advanced Course Settings page in Studio
Given
I am on the Advanced Course Settings page in Studio
When
I create a JSON object as a value
When
I create a JSON object as a value
...
@@ -39,8 +33,6 @@ Feature: Advanced (manual) course policy
...
@@ -39,8 +33,6 @@ Feature: Advanced (manual) course policy
And
I reload the page
And
I reload the page
Then
it is displayed as formatted
Then
it is displayed as formatted
# Skipped because Ubuntu ChromeDriver cannot edit CodeMirror input
@skip
Scenario
:
Test automatic quoting of non-JSON values
Scenario
:
Test automatic quoting of non-JSON values
Given
I am on the Advanced Course Settings page in Studio
Given
I am on the Advanced Course Settings page in Studio
When
I create a non-JSON value not in quotes
When
I create a non-JSON value not in quotes
...
...
cms/djangoapps/contentstore/features/advanced-settings.py
View file @
b312944d
...
@@ -42,8 +42,9 @@ def edit_the_value_of_a_policy_key(step):
...
@@ -42,8 +42,9 @@ def edit_the_value_of_a_policy_key(step):
It is hard to figure out how to get into the CodeMirror
It is hard to figure out how to get into the CodeMirror
area, so cheat and do it from the policy key field :)
area, so cheat and do it from the policy key field :)
"""
"""
e
=
world
.
css_find
(
KEY_CSS
)[
get_index_of
(
DISPLAY_NAME_KEY
)]
world
.
css_find
(
".CodeMirror"
)[
get_index_of
(
DISPLAY_NAME_KEY
)]
.
click
()
e
.
_element
.
send_keys
(
Keys
.
TAB
,
Keys
.
END
,
Keys
.
ARROW_LEFT
,
' '
,
'X'
)
g
=
world
.
css_find
(
"div.CodeMirror.CodeMirror-focused > div > textarea"
)
g
.
_element
.
send_keys
(
Keys
.
ARROW_LEFT
,
' '
,
'X'
)
@step
(
u'I edit the value of a policy key and save$'
)
@step
(
u'I edit the value of a policy key and save$'
)
...
@@ -123,10 +124,12 @@ def get_display_name_value():
...
@@ -123,10 +124,12 @@ def get_display_name_value():
def
change_display_name_value
(
step
,
new_value
):
def
change_display_name_value
(
step
,
new_value
):
e
=
world
.
css_find
(
KEY_CSS
)[
get_index_of
(
DISPLAY_NAME_KEY
)]
world
.
css_find
(
".CodeMirror"
)[
get_index_of
(
DISPLAY_NAME_KEY
)]
.
click
()
g
=
world
.
css_find
(
"div.CodeMirror.CodeMirror-focused > div > textarea"
)
display_name
=
get_display_name_value
()
display_name
=
get_display_name_value
()
for
count
in
range
(
len
(
display_name
)):
for
count
in
range
(
len
(
display_name
)):
e
.
_element
.
send_keys
(
Keys
.
TAB
,
Keys
.
END
,
Keys
.
BACK_SPACE
)
g
.
_element
.
send_keys
(
Keys
.
END
,
Keys
.
BACK_SPACE
)
# Must delete "" before typing the JSON value
# Must delete "" before typing the JSON value
e
.
_element
.
send_keys
(
Keys
.
TAB
,
Keys
.
END
,
Keys
.
BACK_SPACE
,
Keys
.
BACK_SPACE
,
new_value
)
g
.
_element
.
send_keys
(
Keys
.
END
,
Keys
.
BACK_SPACE
,
Keys
.
BACK_SPACE
,
new_value
)
press_the_notification_button
(
step
,
"Save"
)
press_the_notification_button
(
step
,
"Save"
)
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