Merge pull request #14830 from edx/christina/change-default-cohorting
Change default value for "always_cohort_inline_discussions" to False
This commit is contained in:
@@ -686,15 +686,15 @@ class CohortManagementSection(PageObject):
|
||||
|
||||
def always_inline_discussion_selected(self):
|
||||
"""
|
||||
Returns the checked always_cohort_inline_discussions radio button.
|
||||
Returns true if always_cohort_inline_discussions radio button is selected.
|
||||
"""
|
||||
return self.q(css=self._bounded_selector(".check-all-inline-discussions:checked"))
|
||||
return len(self.q(css=self._bounded_selector(".check-all-inline-discussions:checked"))) > 0
|
||||
|
||||
def cohort_some_inline_discussion_selected(self):
|
||||
"""
|
||||
Returns the checked some_cohort_inline_discussions radio button.
|
||||
Returns true if some_cohort_inline_discussions radio button is selected.
|
||||
"""
|
||||
return self.q(css=self._bounded_selector(".check-cohort-inline-discussions:checked"))
|
||||
return len(self.q(css=self._bounded_selector(".check-cohort-inline-discussions:checked"))) > 0
|
||||
|
||||
def select_cohort_some_inline_discussion(self):
|
||||
"""
|
||||
|
||||
@@ -824,36 +824,45 @@ class CohortDiscussionTopicsTest(UniqueCourseTest, CohortTestMixin):
|
||||
Scenario: Select the always_cohort_inline_topics radio button
|
||||
|
||||
Given I have a course with a cohort defined,
|
||||
And a inline discussion topic with disabled Save button.
|
||||
And an inline discussion topic with disabled Save button.
|
||||
When I click on always_cohort_inline_topics
|
||||
Then I see enabled save button
|
||||
And I see disabled inline discussion topics
|
||||
When I reload the page
|
||||
Then I see the option enabled
|
||||
When I save the change
|
||||
And I reload the page
|
||||
Then I see the always_cohort_inline_topics option enabled
|
||||
"""
|
||||
self.cohort_discussion_topics_are_visible()
|
||||
|
||||
# enable always inline discussion topics.
|
||||
# enable always inline discussion topics and save the change
|
||||
self.cohort_management_page.select_always_inline_discussion()
|
||||
|
||||
self.assertFalse(self.cohort_management_page.is_save_button_disabled(self.inline_key))
|
||||
self.assertTrue(self.cohort_management_page.inline_discussion_topics_disabled())
|
||||
self.cohort_management_page.save_discussion_topics(key=self.inline_key)
|
||||
|
||||
self.reload_page()
|
||||
self.assertIsNotNone(self.cohort_management_page.always_inline_discussion_selected())
|
||||
self.assertTrue(self.cohort_management_page.always_inline_discussion_selected())
|
||||
|
||||
def test_cohort_some_inline_topics_enabled(self):
|
||||
"""
|
||||
Scenario: Select the cohort_some_inline_topics radio button
|
||||
|
||||
Given I have a course with a cohort defined,
|
||||
And a inline discussion topic with disabled Save button.
|
||||
Given I have a course with a cohort defined and always_cohort_inline_topics set to True
|
||||
And an inline discussion topic with disabled Save button.
|
||||
When I click on cohort_some_inline_topics
|
||||
Then I see enabled save button
|
||||
And I see enabled inline discussion topics
|
||||
When I reload the page
|
||||
Then I see the option enabled
|
||||
When I save the change
|
||||
And I reload the page
|
||||
Then I see the cohort_some_inline_topics option enabled
|
||||
"""
|
||||
self.cohort_discussion_topics_are_visible()
|
||||
# By default always inline discussion topics is False. Enable it (and reload the page).
|
||||
self.assertFalse(self.cohort_management_page.always_inline_discussion_selected())
|
||||
self.cohort_management_page.select_always_inline_discussion()
|
||||
self.cohort_management_page.save_discussion_topics(key=self.inline_key)
|
||||
self.reload_page()
|
||||
self.assertFalse(self.cohort_management_page.cohort_some_inline_discussion_selected())
|
||||
|
||||
# enable some inline discussion topic radio button.
|
||||
self.cohort_management_page.select_cohort_some_inline_discussion()
|
||||
@@ -861,18 +870,17 @@ class CohortDiscussionTopicsTest(UniqueCourseTest, CohortTestMixin):
|
||||
self.assertFalse(self.cohort_management_page.is_save_button_disabled(self.inline_key))
|
||||
# I see that inline discussion topics are enabled
|
||||
self.assertFalse(self.cohort_management_page.inline_discussion_topics_disabled())
|
||||
self.cohort_management_page.save_discussion_topics(key=self.inline_key)
|
||||
|
||||
self.reload_page()
|
||||
self.assertIsNotNone(self.cohort_management_page.cohort_some_inline_discussion_selected())
|
||||
self.assertTrue(self.cohort_management_page.cohort_some_inline_discussion_selected())
|
||||
|
||||
def test_cohort_inline_discussion_topic(self):
|
||||
"""
|
||||
Scenario: cohort inline discussion topic.
|
||||
|
||||
Given I have a course with a cohort defined,
|
||||
And a inline discussion topic with disabled Save button.
|
||||
When I click on cohort_some_inline_discussion_topics
|
||||
Then I see enabled saved button
|
||||
And a inline discussion topic with disabled Save button
|
||||
And When I click on inline discussion topic
|
||||
And I see enabled save button
|
||||
And When i click save button
|
||||
@@ -882,9 +890,6 @@ class CohortDiscussionTopicsTest(UniqueCourseTest, CohortTestMixin):
|
||||
"""
|
||||
self.cohort_discussion_topics_are_visible()
|
||||
|
||||
# select some inline discussion topics radio button.
|
||||
self.cohort_management_page.select_cohort_some_inline_discussion()
|
||||
|
||||
cohorted_topics_before = self.cohort_management_page.get_cohorted_topics_count(self.inline_key)
|
||||
# check the discussion topic.
|
||||
self.cohort_management_page.select_discussion_topic(self.inline_key)
|
||||
@@ -912,9 +917,6 @@ class CohortDiscussionTopicsTest(UniqueCourseTest, CohortTestMixin):
|
||||
"""
|
||||
self.cohort_discussion_topics_are_visible()
|
||||
|
||||
# enable some inline discussion topics.
|
||||
self.cohort_management_page.select_cohort_some_inline_discussion()
|
||||
|
||||
# category should not be selected.
|
||||
self.assertFalse(self.cohort_management_page.is_category_selected())
|
||||
|
||||
@@ -936,9 +938,6 @@ class CohortDiscussionTopicsTest(UniqueCourseTest, CohortTestMixin):
|
||||
"""
|
||||
self.cohort_discussion_topics_are_visible()
|
||||
|
||||
# enable some inline discussion topics.
|
||||
self.cohort_management_page.select_cohort_some_inline_discussion()
|
||||
|
||||
# category should not be selected.
|
||||
self.assertFalse(self.cohort_management_page.is_category_selected())
|
||||
|
||||
@@ -954,35 +953,6 @@ class CohortDiscussionTopicsTest(UniqueCourseTest, CohortTestMixin):
|
||||
# category should not be selected.
|
||||
self.assertFalse(self.cohort_management_page.is_category_selected())
|
||||
|
||||
def test_verify_that_correct_subset_of_category_being_selected_after_save(self):
|
||||
"""
|
||||
Scenario: Category should be selected on selecting final child.
|
||||
|
||||
Given I have a course with a cohort defined,
|
||||
And a inline discussion with disabled Save button.
|
||||
When I click on child topics
|
||||
Then I see enabled saved button
|
||||
When I select subset of category
|
||||
And I click on save button
|
||||
Then I see success message with
|
||||
same sub-category being selected
|
||||
"""
|
||||
self.cohort_discussion_topics_are_visible()
|
||||
|
||||
# enable some inline discussion topics.
|
||||
self.cohort_management_page.select_cohort_some_inline_discussion()
|
||||
|
||||
# category should not be selected.
|
||||
self.assertFalse(self.cohort_management_page.is_category_selected())
|
||||
|
||||
cohorted_topics_after = self.cohort_management_page.get_cohorted_topics_count(self.inline_key)
|
||||
|
||||
# verifies that changes saved successfully.
|
||||
self.save_and_verify_discussion_topics(key=self.inline_key)
|
||||
|
||||
# verify changes after reload.
|
||||
self.verify_discussion_topics_after_reload(self.inline_key, cohorted_topics_after)
|
||||
|
||||
|
||||
@attr(shard=6)
|
||||
class CohortContentGroupAssociationTest(UniqueCourseTest, CohortTestMixin):
|
||||
|
||||
Reference in New Issue
Block a user