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
2c8148c7
Commit
2c8148c7
authored
Feb 24, 2016
by
Jesse Zoldak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Convert tests for adding advanced problem components from lettuce to bok-choy
TE-1201
parent
bfdd1883
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
77 additions
and
20 deletions
+77
-20
cms/djangoapps/contentstore/features/component.feature
+0
-18
common/test/acceptance/pages/studio/utils.py
+8
-2
common/test/acceptance/tests/studio/test_studio_components.py
+69
-0
No files found.
cms/djangoapps/contentstore/features/component.feature
View file @
2c8148c7
...
@@ -57,24 +57,6 @@ Feature: CMS.Component Adding
...
@@ -57,24 +57,6 @@ Feature: CMS.Component Adding
|
Numerical
Input
|
|
Numerical
Input
|
|
Text
Input
|
|
Text
Input
|
Scenario Outline
:
I
can add Advanced Problem components
Given
I am in Studio editing a new unit
When
I add a
"<Component>"
"Advanced Problem"
component
Then
I see a
"<Component>"
Problem component
# Flush out the database before the next example executes
And
I reset the database
Examples
:
|
Component
|
|
Blank
Advanced
Problem
|
|
Circuit
Schematic
Builder
|
|
Custom
Python-Evaluated
Input
|
|
Drag
and
Drop
|
|
Image
Mapped
Input
|
|
Math
Expression
Input
|
|
Problem
with
Adaptive
Hint
|
# Disabled 1/21/14 due to flakiness seen in master
# Disabled 1/21/14 due to flakiness seen in master
# Scenario: I can add Advanced Latex Problem components
# Scenario: I can add Advanced Latex Problem components
# Given I am in Studio editing a new unit
# Given I am in Studio editing a new unit
...
...
common/test/acceptance/pages/studio/utils.py
View file @
2c8148c7
...
@@ -61,7 +61,7 @@ def add_advanced_component(page, menu_index, name):
...
@@ -61,7 +61,7 @@ def add_advanced_component(page, menu_index, name):
click_css
(
page
,
component_css
,
0
)
click_css
(
page
,
component_css
,
0
)
def
add_component
(
page
,
item_type
,
specific_type
):
def
add_component
(
page
,
item_type
,
specific_type
,
is_advanced_problem
=
False
):
"""
"""
Click one of the "Add New Component" buttons.
Click one of the "Add New Component" buttons.
...
@@ -81,8 +81,14 @@ def add_component(page, item_type, specific_type):
...
@@ -81,8 +81,14 @@ def add_component(page, item_type, specific_type):
'Wait for the add component menu to disappear'
'Wait for the add component menu to disappear'
)
)
# "Common Problem Types" are shown by default.
# For advanced problem types you must first select the "Advanced" tab.
if
is_advanced_problem
:
advanced_tab
=
page
.
q
(
css
=
'.problem-type-tabs a'
)
.
filter
(
text
=
'Advanced'
)
.
first
advanced_tab
.
click
()
all_options
=
page
.
q
(
css
=
'.new-component-{} ul.new-component-template li button span'
.
format
(
item_type
))
all_options
=
page
.
q
(
css
=
'.new-component-{} ul.new-component-template li button span'
.
format
(
item_type
))
chosen_option
=
all_options
.
filter
(
lambda
el
:
el
.
text
==
specific_type
)
.
first
chosen_option
=
all_options
.
filter
(
text
=
specific_type
)
.
first
chosen_option
.
click
()
chosen_option
.
click
()
wait_for_notification
(
page
)
wait_for_notification
(
page
)
page
.
wait_for_ajax
()
page
.
wait_for_ajax
()
...
...
common/test/acceptance/tests/studio/test_studio_components.py
0 → 100644
View file @
2c8148c7
"""
Acceptance tests for adding components in Studio.
"""
import
ddt
from
.base_studio_test
import
ContainerBase
from
...fixtures.course
import
XBlockFixtureDesc
from
...pages.studio.container
import
ContainerPage
from
...pages.studio.utils
import
add_component
@ddt.ddt
class
AdvancedProblemComponentTest
(
ContainerBase
):
"""
Feature: CMS.Component Adding
As a course author, I want to be able to add a wide variety of components
"""
__test__
=
True
def
setUp
(
self
,
is_staff
=
True
):
"""
Create a course with a section, subsection, and unit to which to add the component.
"""
super
(
AdvancedProblemComponentTest
,
self
)
.
setUp
(
is_staff
=
is_staff
)
def
populate_course_fixture
(
self
,
course_fixture
):
course_fixture
.
add_advanced_settings
(
{
u"advanced_modules"
:
{
"value"
:
[
"split_test"
]}}
)
course_fixture
.
add_children
(
XBlockFixtureDesc
(
'chapter'
,
'Test Section'
)
.
add_children
(
XBlockFixtureDesc
(
'sequential'
,
'Test Subsection'
)
.
add_children
(
XBlockFixtureDesc
(
'vertical'
,
'Test Unit'
)
)
)
)
@ddt.data
(
'Blank Advanced Problem'
,
'Circuit Schematic Builder'
,
'Custom Python-Evaluated Input'
,
'Drag and Drop'
,
'Image Mapped Input'
,
'Math Expression Input'
,
'Problem with Adaptive Hint'
,
)
def
test_add_advanced_problem
(
self
,
component
):
"""
Scenario Outline: I can add Advanced Problem components
Given I am in Studio editing a new unit
When I add a "<Component>" "Advanced Problem" component
Then I see a "<Component>" Problem component
Examples:
| Component |
| Blank Advanced Problem |
| Circuit Schematic Builder |
| Custom Python-Evaluated Input |
| Drag and Drop |
| Image Mapped Input |
| Math Expression Input |
| Problem with Adaptive Hint |
"""
self
.
go_to_unit_page
()
page
=
ContainerPage
(
self
.
browser
,
None
)
add_component
(
page
,
'problem'
,
component
,
is_advanced_problem
=
True
)
problem
=
page
.
xblocks
[
1
]
self
.
assertEqual
(
problem
.
name
,
component
)
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