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
79c5137a
Commit
79c5137a
authored
May 30, 2017
by
cahrens
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bok choy tests for division scheme.
EDUCATOR-424
parent
c23c0b99
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
44 additions
and
45 deletions
+44
-45
common/test/acceptance/pages/lms/instructor_dashboard.py
+25
-5
common/test/acceptance/tests/discussion/helpers.py
+12
-8
common/test/acceptance/tests/discussion/test_cohorts.py
+1
-0
common/test/acceptance/tests/discussion/test_discussion_management.py
+0
-0
common/test/acceptance/tests/lms/test_lms_cohorted_courseware_search.py
+2
-11
common/test/acceptance/tests/lms/test_lms_help.py
+2
-10
common/test/acceptance/tests/test_cohorted_courseware.py
+2
-11
No files found.
common/test/acceptance/pages/lms/instructor_dashboard.py
View file @
79c5137a
...
...
@@ -263,10 +263,6 @@ class CohortManagementSection(PageObject):
no_content_group_button_css
=
'.cohort-management-details-association-course input.radio-no'
select_content_group_button_css
=
'.cohort-management-details-association-course input.radio-yes'
assignment_type_buttons_css
=
'.cohort-management-assignment-type-settings input'
discussion_form_selectors
=
{
'course-wide'
:
'.cohort-course-wide-discussions-form'
,
'inline'
:
'.cohort-inline-discussions-form'
}
def
get_cohort_help_element_and_click_help
(
self
):
"""
...
...
@@ -689,9 +685,14 @@ class DiscussionManagementSection(PageObject):
discussion_form_selectors
=
{
'course-wide'
:
'.cohort-course-wide-discussions-form'
,
'inline'
:
'.cohort-inline-discussions-form'
'inline'
:
'.cohort-inline-discussions-form'
,
'scheme'
:
'.division-scheme-container'
,
}
NOT_DIVIDED_SCHEME
=
"none"
COHORT_SCHEME
=
"cohort"
ENROLLMENT_TRACK_SCHEME
=
"enrollment_track"
def
is_browser_on_page
(
self
):
return
self
.
q
(
css
=
self
.
discussion_form_selectors
[
'course-wide'
])
.
present
...
...
@@ -801,6 +802,25 @@ class DiscussionManagementSection(PageObject):
"""
return
self
.
q
(
css
=
self
.
_bounded_selector
(
'.check-discussion-category:checked'
))
.
is_present
()
def
get_selected_scheme
(
self
):
"""
Returns the ID of the selected discussion division scheme
("NOT_DIVIDED_SCHEME", "COHORT_SCHEME", or "ENROLLMENT_TRACK_SCHEME)".
"""
return
self
.
q
(
css
=
self
.
_bounded_selector
(
'.division-scheme:checked'
))
.
first
.
attrs
(
'id'
)[
0
]
def
select_division_scheme
(
self
,
scheme
):
"""
Selects the radio button associated with the specified division scheme.
"""
self
.
q
(
css
=
self
.
_bounded_selector
(
"input#
%
s"
%
scheme
))
.
first
.
click
()
def
division_scheme_visible
(
self
,
scheme
):
"""
Returns whether or not the specified scheme is visible as an option.
"""
return
self
.
q
(
css
=
self
.
_bounded_selector
(
"input#
%
s"
%
scheme
))
.
visible
class
MembershipPageAutoEnrollSection
(
PageObject
):
"""
...
...
common/test/acceptance/tests/discussion/helpers.py
View file @
79c5137a
...
...
@@ -76,22 +76,26 @@ class CohortTestMixin(object):
def
enable_cohorting
(
self
,
course_fixture
):
"""
enables cohorts and always_divide_inline_discussions for the current
course fixture.
Enables cohorting for the specified
course fixture.
"""
url
=
LMS_BASE_URL
+
"/courses/"
+
course_fixture
.
_course_key
+
'/cohorts/settings'
# pylint: disable=protected-access
discussions_url
=
LMS_BASE_URL
+
"/courses/"
+
course_fixture
.
_course_key
+
'/discussions/settings'
# pylint: disable=protected-access
url
=
LMS_BASE_URL
+
"/courses/"
+
course_fixture
.
_course_key
+
'/cohorts/settings'
data
=
json
.
dumps
({
'is_cohorted'
:
True
})
discussions_data
=
json
.
dumps
({
'always_divide_inline_discussions'
:
True
})
response
=
course_fixture
.
session
.
patch
(
url
,
data
=
data
,
headers
=
course_fixture
.
headers
)
self
.
assertTrue
(
response
.
ok
,
"Failed to enable cohorts"
)
def
enable_always_divide_inline_discussions
(
self
,
course_fixture
):
"""
Enables "always_divide_inline_discussions" (but does not enabling cohorting).
"""
discussions_url
=
LMS_BASE_URL
+
"/courses/"
+
course_fixture
.
_course_key
+
'/discussions/settings'
discussions_data
=
json
.
dumps
({
'always_divide_inline_discussions'
:
True
})
course_fixture
.
session
.
patch
(
discussions_url
,
data
=
discussions_data
,
headers
=
course_fixture
.
headers
)
def
disable_cohorting
(
self
,
course_fixture
):
"""
Disables cohorting for the
current
course fixture.
Disables cohorting for the
specified
course fixture.
"""
url
=
LMS_BASE_URL
+
"/courses/"
+
course_fixture
.
_course_key
+
'/cohorts/settings'
# pylint: disable=protected-access
url
=
LMS_BASE_URL
+
"/courses/"
+
course_fixture
.
_course_key
+
'/cohorts/settings'
data
=
json
.
dumps
({
'is_cohorted'
:
False
})
response
=
course_fixture
.
session
.
patch
(
url
,
data
=
data
,
headers
=
course_fixture
.
headers
)
self
.
assertTrue
(
response
.
ok
,
"Failed to disable cohorts"
)
...
...
common/test/acceptance/tests/discussion/test_cohorts.py
View file @
79c5137a
...
...
@@ -47,6 +47,7 @@ class CohortedDiscussionTestMixin(BaseDiscussionMixin, CohortTestMixin):
# Enable cohorts and verify that the post shows to cohort only.
self
.
enable_cohorting
(
self
.
course_fixture
)
self
.
enable_always_divide_inline_discussions
(
self
.
course_fixture
)
self
.
refresh_thread_page
(
self
.
thread_id
)
self
.
assertEquals
(
self
.
thread_page
.
get_group_visibility_label
(),
...
...
common/test/acceptance/tests/discussion/test_discussion_management.py
View file @
79c5137a
This diff is collapsed.
Click to expand it.
common/test/acceptance/tests/lms/test_lms_cohorted_courseware_search.py
View file @
79c5137a
...
...
@@ -7,7 +7,6 @@ import uuid
from
nose.plugins.attrib
import
attr
from
common.test.acceptance.fixtures
import
LMS_BASE_URL
from
common.test.acceptance.fixtures.course
import
XBlockFixtureDesc
from
common.test.acceptance.pages.common.auto_auth
import
AutoAuthPage
from
common.test.acceptance.pages.common.logout
import
LogoutPage
...
...
@@ -19,10 +18,11 @@ from common.test.acceptance.pages.studio.overview import CourseOutlinePage as St
from
common.test.acceptance.pages.studio.settings_group_configurations
import
GroupConfigurationsPage
from
common.test.acceptance.tests.helpers
import
remove_file
from
common.test.acceptance.tests.studio.base_studio_test
import
ContainerBase
from
common.test.acceptance.tests.discussion.helpers
import
CohortTestMixin
@attr
(
shard
=
1
)
class
CoursewareSearchCohortTest
(
ContainerBase
):
class
CoursewareSearchCohortTest
(
ContainerBase
,
CohortTestMixin
):
"""
Test courseware search.
"""
...
...
@@ -132,15 +132,6 @@ class CoursewareSearchCohortTest(ContainerBase):
)
)
def
enable_cohorting
(
self
,
course_fixture
):
"""
Enables cohorting for the current course.
"""
url
=
LMS_BASE_URL
+
"/courses/"
+
course_fixture
.
_course_key
+
'/cohorts/settings'
# pylint: disable=protected-access
data
=
json
.
dumps
({
'is_cohorted'
:
True
})
response
=
course_fixture
.
session
.
patch
(
url
,
data
=
data
,
headers
=
course_fixture
.
headers
)
self
.
assertTrue
(
response
.
ok
,
"Failed to enable cohorts"
)
def
create_content_groups
(
self
):
"""
Creates two content groups in Studio Group Configurations Settings.
...
...
common/test/acceptance/tests/lms/test_lms_help.py
View file @
79c5137a
...
...
@@ -10,9 +10,10 @@ from common.test.acceptance.pages.lms.instructor_dashboard import InstructorDash
from
common.test.acceptance.tests.helpers
import
assert_opened_help_link_is_correct
,
url_for_help
from
common.test.acceptance.tests.lms.test_lms_instructor_dashboard
import
BaseInstructorDashboardTest
from
common.test.acceptance.tests.studio.base_studio_test
import
ContainerBase
from
common.test.acceptance.tests.discussion.helpers
import
CohortTestMixin
class
TestCohortHelp
(
ContainerBase
):
class
TestCohortHelp
(
ContainerBase
,
CohortTestMixin
):
"""
Tests help links in Cohort page
"""
...
...
@@ -74,15 +75,6 @@ class TestCohortHelp(ContainerBase):
)
self
.
verify_help_link
(
href
)
def
enable_cohorting
(
self
,
course_fixture
):
"""
Enables cohorting for the current course.
"""
url
=
LMS_BASE_URL
+
"/courses/"
+
course_fixture
.
_course_key
+
'/cohorts/settings'
# pylint: disable=protected-access
data
=
json
.
dumps
({
'is_cohorted'
:
True
})
response
=
course_fixture
.
session
.
patch
(
url
,
data
=
data
,
headers
=
course_fixture
.
headers
)
self
.
assertTrue
(
response
.
ok
,
"Failed to enable cohorts"
)
class
InstructorDashboardHelp
(
BaseInstructorDashboardTest
):
"""
...
...
common/test/acceptance/tests/test_cohorted_courseware.py
View file @
79c5137a
...
...
@@ -7,7 +7,6 @@ import json
from
bok_choy.page_object
import
XSS_INJECTION
from
nose.plugins.attrib
import
attr
from
common.test.acceptance.fixtures
import
LMS_BASE_URL
from
common.test.acceptance.fixtures.course
import
XBlockFixtureDesc
from
common.test.acceptance.pages.common.auto_auth
import
AutoAuthPage
from
common.test.acceptance.pages.common.utils
import
add_enrollment_course_modes
,
enroll_user_track
...
...
@@ -16,6 +15,7 @@ from common.test.acceptance.pages.lms.instructor_dashboard import InstructorDash
from
common.test.acceptance.pages.studio.component_editor
import
ComponentVisibilityEditorView
from
common.test.acceptance.pages.studio.settings_group_configurations
import
GroupConfigurationsPage
from
common.test.acceptance.tests.lms.test_lms_user_preview
import
verify_expected_problem_visibility
from
common.test.acceptance.tests.discussion.helpers
import
CohortTestMixin
from
studio.base_studio_test
import
ContainerBase
AUDIT_TRACK
=
"Audit"
...
...
@@ -23,7 +23,7 @@ VERIFIED_TRACK = "Verified"
@attr
(
shard
=
5
)
class
EndToEndCohortedCoursewareTest
(
ContainerBase
):
class
EndToEndCohortedCoursewareTest
(
ContainerBase
,
CohortTestMixin
):
"""
End-to-end of cohorted courseware.
"""
...
...
@@ -113,15 +113,6 @@ class EndToEndCohortedCoursewareTest(ContainerBase):
)
)
def
enable_cohorting
(
self
,
course_fixture
):
"""
Enables cohorting for the current course.
"""
url
=
LMS_BASE_URL
+
"/courses/"
+
course_fixture
.
_course_key
+
'/cohorts/settings'
# pylint: disable=protected-access
data
=
json
.
dumps
({
'is_cohorted'
:
True
})
response
=
course_fixture
.
session
.
patch
(
url
,
data
=
data
,
headers
=
course_fixture
.
headers
)
self
.
assertTrue
(
response
.
ok
,
"Failed to enable cohorts"
)
def
create_content_groups
(
self
):
"""
Creates two content groups in Studio Group Configurations Settings.
...
...
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