Merge pull request #18661 from edx/mroytman/bok-choy-tests-course-outline

bok choy tests for course outline status section
This commit is contained in:
Michael Roytman
2018-07-31 13:08:31 -04:00
committed by GitHub
4 changed files with 103 additions and 0 deletions

View File

@@ -0,0 +1,18 @@
"""
Course Checklists page.
"""
from common.test.acceptance.pages.studio.course_page import CoursePage
class CourseChecklistsPage(CoursePage):
"""
Course Checklists page.
"""
url_path = "checklists"
def is_browser_on_page(self):
# SFE and SFE-wrapper classes come from studio-frontend and
# wrap content provided by the studio-frontend package
return self.q(css='.SFE .SFE-wrapper').visible

View File

@@ -498,6 +498,12 @@ class CourseOutlinePage(CoursePage, CourseOutlineContainer):
self.q(css='div.ui-loading.is-hidden').present
])
def click_course_status_section_start_date_link(self):
self.course_start_date_link.click()
def click_course_status_section_checklists_link(self):
self.course_checklists_link.click()
def view_live(self):
"""
Clicks the "View Live" link and switches to the new tab
@@ -762,6 +768,20 @@ class CourseOutlinePage(CoursePage, CourseOutlineContainer):
# The Prerequisites dropdown is visible
return self.q(css="#prereq_min_score").visible
@property
def has_course_status_section(self):
# SFE and SFE-wrapper classes come from studio-frontend and
# wrap content provided by the studio-frontend package
return self.q(css='.course-status .SFE .SFE-wrapper').is_present()
@property
def course_start_date_link(self):
return self.q(css='.status-link').first
@property
def course_checklists_link(self):
return self.q(css='.status-link').nth(1)
@property
def bottom_add_section_button(self):
"""

View File

@@ -19,6 +19,8 @@ from common.test.acceptance.pages.lms.courseware import CoursewarePage
from common.test.acceptance.pages.lms.progress import ProgressPage
from common.test.acceptance.pages.lms.staff_view import StaffCoursewarePage
from common.test.acceptance.pages.studio.overview import ContainerPage, CourseOutlinePage, ExpandCollapseLinkState
from common.test.acceptance.pages.studio.settings import SettingsPage
from common.test.acceptance.pages.studio.checklists import CourseChecklistsPage
from common.test.acceptance.pages.studio.settings_advanced import AdvancedSettingsPage
from common.test.acceptance.pages.studio.settings_group_configurations import GroupConfigurationsPage
from common.test.acceptance.pages.studio.utils import add_discussion, drag, verify_ordering
@@ -1865,3 +1867,49 @@ class SelfPacedOutlineTest(CourseOutlineTest):
modal = subsection.edit()
self.assertFalse(modal.has_release_date())
self.assertFalse(modal.has_due_date())
class CourseStatusOutlineTest(CourseOutlineTest):
"""Test the course outline status section."""
def setUp(self):
super(CourseStatusOutlineTest, self).setUp()
self.schedule_and_details_settings = SettingsPage(
self.browser,
self.course_info['org'],
self.course_info['number'],
self.course_info['run']
)
self.checklists = CourseChecklistsPage(
self.browser,
self.course_info['org'],
self.course_info['number'],
self.course_info['run']
)
def test_course_status_section(self):
"""
Ensure that the course status section appears in the course outline.
"""
self.course_outline_page.visit()
self.assertTrue(self.course_outline_page.has_course_status_section)
def test_course_status_section_start_date_link(self):
"""
Ensure that the course start date link in the course status section in
the course outline links to the "Schedule and Details" page.
"""
self.course_outline_page.visit()
self.course_outline_page.click_course_status_section_start_date_link()
self.schedule_and_details_settings.wait_for_page()
def test_course_status_section_checklists_link(self):
"""
Ensure that the course checklists link in the course status section in
the course outline links to the "Checklists" page.
"""
self.course_outline_page.visit()
self.course_outline_page.click_course_status_section_checklists_link()
self.checklists.wait_for_page()

View File

@@ -38,5 +38,22 @@
"name": "course_experience.gdpr",
"everyone": false
}
},
{
"pk": 4,
"model": "waffle.switch",
"fields": {
"name": "studio.enable_checklists_page",
"active": true
}
},
{
"pk": 5,
"model": "waffle.flag",
"fields": {
"name": "studio.enable_checklists_quality",
"staff": true,
"superusers": true
}
}
]