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
39acbdcb
Commit
39acbdcb
authored
Jan 09, 2015
by
cahrens
Committed by
Andy Armstrong
Jan 15, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
End-to-end bok choy test for cohorted courseware.
parent
8abec98c
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
47 additions
and
25 deletions
+47
-25
common/test/acceptance/pages/lms/courseware.py
+8
-1
common/test/acceptance/pages/lms/instructor_dashboard.py
+8
-1
common/test/acceptance/tests/lms/test_lms_user_preview.py
+29
-20
common/test/acceptance/tests/studio/base_studio_test.py
+2
-2
common/test/acceptance/tests/studio/test_studio_split_test.py
+0
-1
common/test/acceptance/tests/test_cohorted_courseware.py
+0
-0
No files found.
common/test/acceptance/pages/lms/courseware.py
View file @
39acbdcb
...
...
@@ -34,11 +34,18 @@ class CoursewarePage(CoursePage):
return
len
(
self
.
q
(
css
=
self
.
subsection_selector
))
@property
def
xblock_components
(
self
):
"""
Return the xblock components within the unit on the page.
"""
return
self
.
q
(
css
=
self
.
xblock_component_selector
)
@property
def
num_xblock_components
(
self
):
"""
Return the number of rendered xblocks within the unit on the page
"""
return
len
(
self
.
q
(
css
=
self
.
xblock_component_selector
)
)
return
len
(
self
.
xblock_components
)
def
xblock_component_type
(
self
,
index
=
0
):
"""
...
...
common/test/acceptance/pages/lms/instructor_dashboard.py
View file @
39acbdcb
...
...
@@ -133,6 +133,10 @@ class MembershipPageCohortManagementSection(PageObject):
"""
Returns the name of the selected cohort.
"""
EmptyPromise
(
lambda
:
len
(
self
.
_get_cohort_options
()
.
results
)
>
0
,
"Waiting for cohort selector to populate"
)
.
fulfill
()
return
self
.
_cohort_name
(
self
.
_get_cohort_options
()
.
filter
(
lambda
el
:
el
.
is_selected
())
.
first
.
text
[
0
]
)
...
...
@@ -163,7 +167,10 @@ class MembershipPageCohortManagementSection(PageObject):
Adds a new manual cohort with the specified name.
If a content group should also be associated, the name of the content group should be specified.
"""
self
.
q
(
css
=
self
.
_bounded_selector
(
"div.cohort-management-nav .action-create"
))
.
first
.
click
()
create_buttons
=
self
.
q
(
css
=
self
.
_bounded_selector
(
".action-create"
))
# There are 2 create buttons on the page. The second one is only present when no cohort yet exists
# (in which case the first is not visible). Click on the last present create button.
create_buttons
.
results
[
len
(
create_buttons
.
results
)
-
1
]
.
click
()
textinput
=
self
.
q
(
css
=
self
.
_bounded_selector
(
"#cohort-name"
))
.
results
[
0
]
textinput
.
send_keys
(
cohort_name
)
if
content_group
:
...
...
common/test/acceptance/tests/lms/test_lms_user_preview.py
View file @
39acbdcb
...
...
@@ -266,28 +266,26 @@ class CourseWithContentGroupsTest(StaffViewTest):
</problem>
"""
)
self
.
alpha_text
=
"VISIBLE TO ALPHA"
self
.
beta_text
=
"VISIBLE TO BETA"
self
.
everyone_text
=
"VISIBLE TO EVERYONE"
course_fixture
.
add_children
(
XBlockFixtureDesc
(
'chapter'
,
'Test Section'
)
.
add_children
(
XBlockFixtureDesc
(
'sequential'
,
'Test Subsection'
)
.
add_children
(
XBlockFixtureDesc
(
'problem'
,
'Visible to alpha'
,
data
=
problem_data
,
metadata
=
{
"group_access"
:
{
0
:
[
0
]}}
),
XBlockFixtureDesc
(
'problem'
,
'Visible to beta'
,
data
=
problem_data
,
metadata
=
{
"group_access"
:
{
0
:
[
1
]}}
),
XBlockFixtureDesc
(
'problem'
,
'Visible to everyone'
,
data
=
problem_data
)
XBlockFixtureDesc
(
'vertical'
,
'Test Unit'
)
.
add_children
(
XBlockFixtureDesc
(
'problem'
,
self
.
alpha_text
,
data
=
problem_data
,
metadata
=
{
"group_access"
:
{
0
:
[
0
]}}
),
XBlockFixtureDesc
(
'problem'
,
self
.
beta_text
,
data
=
problem_data
,
metadata
=
{
"group_access"
:
{
0
:
[
1
]}}
),
XBlockFixtureDesc
(
'problem'
,
self
.
everyone_text
,
data
=
problem_data
)
)
)
)
)
def
_verify_visible_problems
(
self
,
expected_items
):
"""
Verify that the expected problems are visible.
"""
course_nav
=
CourseNavPage
(
self
.
browser
)
actual_items
=
course_nav
.
sequence_items
self
.
assertItemsEqual
(
expected_items
,
actual_items
)
def
test_staff_sees_all_problems
(
self
):
"""
Scenario: Staff see all problems
...
...
@@ -296,8 +294,8 @@ class CourseWithContentGroupsTest(StaffViewTest):
When I view the courseware in the LMS with staff access
Then I see all the problems, regardless of their group_access property
"""
self
.
_goto_staff_page
()
self
.
_verify_visible_problems
([
'Visible to alpha'
,
'Visible to beta'
,
'Visible to everyone'
])
course_page
=
self
.
_goto_staff_page
()
verify_expected_problem_visibility
(
self
,
course_page
,
[
self
.
alpha_text
,
self
.
beta_text
,
self
.
everyone_text
])
def
test_student_not_in_content_group
(
self
):
"""
...
...
@@ -310,7 +308,7 @@ class CourseWithContentGroupsTest(StaffViewTest):
"""
course_page
=
self
.
_goto_staff_page
()
course_page
.
set_staff_view_mode
(
'Student'
)
self
.
_verify_visible_problems
([
'Visible to everyone'
])
verify_expected_problem_visibility
(
self
,
course_page
,
[
self
.
everyone_text
])
def
test_as_student_in_alpha
(
self
):
"""
...
...
@@ -323,7 +321,7 @@ class CourseWithContentGroupsTest(StaffViewTest):
"""
course_page
=
self
.
_goto_staff_page
()
course_page
.
set_staff_view_mode
(
'Student in alpha'
)
self
.
_verify_visible_problems
([
'Visible to alpha'
,
'Visible to everyone'
])
verify_expected_problem_visibility
(
self
,
course_page
,
[
self
.
alpha_text
,
self
.
everyone_text
])
def
test_as_student_in_beta
(
self
):
"""
...
...
@@ -336,4 +334,15 @@ class CourseWithContentGroupsTest(StaffViewTest):
"""
course_page
=
self
.
_goto_staff_page
()
course_page
.
set_staff_view_mode
(
'Student in beta'
)
self
.
_verify_visible_problems
([
'Visible to beta'
,
'Visible to everyone'
])
verify_expected_problem_visibility
(
self
,
course_page
,
[
self
.
beta_text
,
self
.
everyone_text
])
def
verify_expected_problem_visibility
(
test
,
courseware_page
,
expected_problems
):
"""
Helper method that checks that the expected problems are visible on the current page.
"""
test
.
assertEqual
(
len
(
expected_problems
),
courseware_page
.
num_xblock_components
,
"Incorrect number of visible problems"
)
for
index
,
expected_problem
in
enumerate
(
expected_problems
):
test
.
assertIn
(
expected_problem
,
courseware_page
.
xblock_components
[
index
]
.
text
)
common/test/acceptance/tests/studio/base_studio_test.py
View file @
39acbdcb
...
...
@@ -58,12 +58,12 @@ class ContainerBase(StudioCourseTest):
Base class for tests that do operations on the container page.
"""
def
setUp
(
self
):
def
setUp
(
self
,
is_staff
=
False
):
"""
Create a unique identifier for the course used in this test.
"""
# Ensure that the superclass sets up
super
(
ContainerBase
,
self
)
.
setUp
()
super
(
ContainerBase
,
self
)
.
setUp
(
is_staff
=
is_staff
)
self
.
outline
=
CourseOutlinePage
(
self
.
browser
,
...
...
common/test/acceptance/tests/studio/test_studio_split_test.py
View file @
39acbdcb
...
...
@@ -14,7 +14,6 @@ from bok_choy.promise import Promise, EmptyPromise
from
...fixtures.course
import
XBlockFixtureDesc
from
...pages.studio.component_editor
import
ComponentEditorView
from
...pages.studio.overview
import
CourseOutlinePage
,
CourseOutlineUnit
from
...pages.studio.settings_advanced
import
AdvancedSettingsPage
from
...pages.studio.container
import
ContainerPage
from
...pages.studio.settings_group_configurations
import
GroupConfigurationsPage
from
...pages.studio.utils
import
add_advanced_component
...
...
common/test/acceptance/tests/test_cohorted_courseware.py
0 → 100644
View file @
39acbdcb
This diff is collapsed.
Click to expand it.
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