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
0bf8266b
Commit
0bf8266b
authored
Apr 28, 2016
by
Muddasser
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Conversion of two lettuce test to bokchoy from advanced_settings.feature
parent
91d3b0bd
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
70 additions
and
20 deletions
+70
-20
cms/djangoapps/contentstore/features/advanced_settings.feature
+0
-19
common/test/acceptance/pages/studio/settings_advanced.py
+7
-0
common/test/acceptance/tests/studio/test_studio_settings.py
+63
-1
No files found.
cms/djangoapps/contentstore/features/advanced_settings.feature
View file @
0bf8266b
...
...
@@ -15,25 +15,6 @@ Feature: CMS.Advanced (manual) course policy
# Sauce labs does not play nicely with CodeMirror
@skip_sauce
Scenario
:
Test cancel editing key value
Given
I am on the Advanced Course Settings page in Studio
When
I edit the value of a policy key
And
I press the
"Cancel"
notification button
Then
the policy key value is unchanged
And
I reload the page
Then
the policy key value is unchanged
# Sauce labs does not play nicely with CodeMirror
@skip_sauce
Scenario
:
Test editing key value
Given
I am on the Advanced Course Settings page in Studio
When
I edit the value of a policy key and save
Then
the policy key value is changed
And
I reload the page
Then
the policy key value is changed
# Sauce labs does not play nicely with CodeMirror
@skip_sauce
Scenario
:
Test how multi-line input appears
Given
I am on the Advanced Course Settings page in Studio
When
I create a JSON object as a value for
"Discussion Topic Mapping"
...
...
common/test/acceptance/pages/studio/settings_advanced.py
View file @
0bf8266b
...
...
@@ -118,6 +118,13 @@ class AdvancedSettingsPage(CoursePage):
type_in_codemirror
(
self
,
index
,
new_value
)
self
.
save
()
def
set_value_without_saving
(
self
,
key
,
new_value
):
"""
Set value without saving it.
"""
index
=
self
.
_get_index_of
(
key
)
type_in_codemirror
(
self
,
index
,
new_value
)
def
get
(
self
,
key
):
index
=
self
.
_get_index_of
(
key
)
return
get_codemirror_value
(
self
,
index
)
...
...
common/test/acceptance/tests/studio/test_studio_settings.py
View file @
0bf8266b
...
...
@@ -15,6 +15,7 @@ from ...pages.studio.settings_advanced import AdvancedSettingsPage
from
...pages.studio.settings_group_configurations
import
GroupConfigurationsPage
from
...pages.lms.courseware
import
CoursewarePage
from
textwrap
import
dedent
import
re
from
xmodule.partitions.partitions
import
Group
...
...
@@ -256,7 +257,6 @@ class AdvancedSettingsValidationTest(StudioCourseTest):
Test that advanced settings don't save if there's a single wrong input,
and that it shows the correct error message in the modal.
"""
# Feed an integer value for String field.
# .set method saves automatically after setting a value
course_display_name
=
self
.
advanced_settings
.
get
(
'Course Display Name'
)
...
...
@@ -508,3 +508,65 @@ class StudioSettingsA11yTest(StudioCourseTest):
})
self
.
settings_page
.
a11y_audit
.
check_for_accessibility_errors
()
class
AdvancedSettingsTest
(
StudioCourseTest
):
"""
Tests for Advanced Settings tab in studio.
"""
def
setUp
(
self
):
# pylint: disable=arguments-differ
super
(
AdvancedSettingsTest
,
self
)
.
setUp
()
self
.
advanced_settings
=
AdvancedSettingsPage
(
self
.
browser
,
self
.
course_info
[
'org'
],
self
.
course_info
[
'number'
],
self
.
course_info
[
'run'
]
)
self
.
type_fields
=
[
'Course Display Name'
,
'Advanced Module List'
,
'Discussion Topic Mapping'
,
'Maximum Attempts'
,
'Course Announcement Date'
]
# Before every test, make sure to visit the page first
self
.
advanced_settings
.
visit
()
self
.
assertTrue
(
self
.
advanced_settings
.
is_browser_on_page
())
def
test_cancel_edit_key_value
(
self
):
"""
Scenario: Test cancel editing key value
Given I am on the Advanced Course Settings page in Studio
When I edit the value of a policy key
And I press the "Cancel" notification button
Then the policy key value is unchanged
And I reload the page
Then the policy key value is unchanged
"""
default_course_name
=
self
.
advanced_settings
.
get
(
'Course Display Name'
)
# Change the value of 'Course Display Name'.
self
.
advanced_settings
.
set_value_without_saving
(
'Course Display Name'
,
1
)
# Cancel and don't save the value when asked in notification.
self
.
advanced_settings
.
cancel
()
self
.
assertEquals
(
self
.
advanced_settings
.
get
(
'Course Display Name'
),
default_course_name
)
# Refresh the page
self
.
advanced_settings
.
refresh_and_wait_for_load
()
# 'Course Display Name' should be same as before.
self
.
assertEquals
(
self
.
advanced_settings
.
get
(
'Course Display Name'
),
default_course_name
)
def
test_edit_key_value
(
self
):
"""
Scenario: Test editing key value
Given I am on the Advanced Course Settings page in Studio
When I edit the value of a policy key and save
Then the policy key value is changed
And I reload the page
Then the policy key value is changed
"""
course_name_to_set
=
"New Course Name"
# Change the value of 'Course Display Name' and save it.
self
.
advanced_settings
.
set
(
'Course Display Name'
,
course_name_to_set
)
new_course_name
=
re
.
sub
(
'["]'
,
''
,
self
.
advanced_settings
.
get
(
'Course Display Name'
))
self
.
assertEquals
(
new_course_name
,
course_name_to_set
)
# Refresh the page
self
.
advanced_settings
.
refresh_and_wait_for_load
()
new_course_name
=
re
.
sub
(
'["]'
,
''
,
self
.
advanced_settings
.
get
(
'Course Display Name'
))
# 'Course Display Name' should be changed now.
self
.
assertEquals
(
new_course_name
,
course_name_to_set
)
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