ECOM-4215 adding setup for new program details page
This commit is contained in:
@@ -5,16 +5,15 @@ from ...fixtures.programs import FakeProgram, ProgramsFixture, ProgramsConfigMix
|
||||
from ...fixtures.course import CourseFixture
|
||||
from ..helpers import UniqueCourseTest
|
||||
from ...pages.lms.auto_auth import AutoAuthPage
|
||||
from ...pages.lms.programs import ProgramListingPage
|
||||
from ...pages.lms.programs import ProgramListingPage, ProgramDetailsPage
|
||||
|
||||
|
||||
class ProgramListingPageBase(ProgramsConfigMixin, UniqueCourseTest):
|
||||
class ProgramPageBase(ProgramsConfigMixin, UniqueCourseTest):
|
||||
"""Base class used for program listing page tests."""
|
||||
def setUp(self):
|
||||
super(ProgramListingPageBase, self).setUp()
|
||||
super(ProgramPageBase, self).setUp()
|
||||
|
||||
self.set_programs_api_configuration(is_enabled=True)
|
||||
self.listing_page = ProgramListingPage(self.browser)
|
||||
|
||||
def stub_api(self, course_id=None):
|
||||
"""Stub out the programs API with fake data."""
|
||||
@@ -35,8 +34,13 @@ class ProgramListingPageBase(ProgramsConfigMixin, UniqueCourseTest):
|
||||
AutoAuthPage(self.browser, course_id=course_id).visit()
|
||||
|
||||
|
||||
class ProgramListingPageTest(ProgramListingPageBase):
|
||||
class ProgramListingPageTest(ProgramPageBase):
|
||||
"""Verify user-facing behavior of the program listing page."""
|
||||
def setUp(self):
|
||||
super(ProgramListingPageTest, self).setUp()
|
||||
|
||||
self.listing_page = ProgramListingPage(self.browser)
|
||||
|
||||
def test_no_enrollments(self):
|
||||
"""Verify that no cards appear when the user has no enrollments."""
|
||||
self.stub_api()
|
||||
@@ -76,8 +80,12 @@ class ProgramListingPageTest(ProgramListingPageBase):
|
||||
|
||||
|
||||
@attr('a11y')
|
||||
class ProgramListingPageA11yTest(ProgramListingPageBase):
|
||||
class ProgramListingPageA11yTest(ProgramPageBase):
|
||||
"""Test program listing page accessibility."""
|
||||
def setUp(self):
|
||||
super(ProgramListingPageA11yTest, self).setUp()
|
||||
|
||||
self.listing_page = ProgramListingPage(self.browser)
|
||||
|
||||
def test_empty_a11y(self):
|
||||
"""Test a11y of the page's empty state."""
|
||||
@@ -100,3 +108,19 @@ class ProgramListingPageA11yTest(ProgramListingPageBase):
|
||||
self.assertTrue(self.listing_page.are_cards_present)
|
||||
|
||||
self.listing_page.a11y_audit.check_for_accessibility_errors()
|
||||
|
||||
|
||||
@attr('a11y')
|
||||
class ProgramDetailsPageA11yTest(ProgramPageBase):
|
||||
"""Test program details page accessibility."""
|
||||
def setUp(self):
|
||||
super(ProgramDetailsPageA11yTest, self).setUp()
|
||||
|
||||
self.details_page = ProgramDetailsPage(self.browser)
|
||||
|
||||
def test_a11y(self):
|
||||
"""Test a11y of the page's state."""
|
||||
self.auth(enroll=False)
|
||||
self.details_page.visit()
|
||||
|
||||
self.details_page.a11y_audit.check_for_accessibility_errors()
|
||||
|
||||
Reference in New Issue
Block a user