AC-520 fixing section ignores

This commit is contained in:
Chris Rodriguez
2016-06-30 10:02:10 -04:00
parent 39c2abdf28
commit 4cf0e19af2
26 changed files with 110 additions and 163 deletions

View File

@@ -22,7 +22,7 @@ class DashboardPage(PageObject):
url = "{base}/dashboard".format(base=BASE_URL)
def is_browser_on_page(self):
return self.q(css='section.my-courses').present
return self.q(css='.my-courses').present
@property
def current_courses_text(self):
@@ -31,7 +31,7 @@ class DashboardPage(PageObject):
shows all the courses that the student is enrolled in.
The string displayed is defined in lms/templates/dashboard.html.
"""
text_items = self.q(css='section#my-courses').text
text_items = self.q(css='#my-courses').text
if len(text_items) > 0:
return text_items[0]
else:

View File

@@ -113,7 +113,7 @@ class SettingsPage(CoursePage):
Property. Returns the text of the license type for the course
("All Rights Reserved" or "Creative Commons")
"""
license_types_css = "section.license ul.license-types li.license-type"
license_types_css = ".license ul.license-types li.license-type"
self.wait_for_element_presence(
license_types_css,
"license type buttons are present",
@@ -124,7 +124,7 @@ class SettingsPage(CoursePage):
# Look for the license text that will be displayed by default,
# if no button is yet explicitly selected
license_text = self.q(css='section.license span.license-text')
license_text = self.q(css='.license span.license-text')
if license_text.is_present():
return license_text.text[0]
return None
@@ -135,13 +135,13 @@ class SettingsPage(CoursePage):
Sets the course license to the given license_name
(str, "All Rights Reserved" or "Creative Commons")
"""
license_types_css = "section.license ul.license-types li.license-type"
license_types_css = ".license ul.license-types li.license-type"
self.wait_for_element_presence(
license_types_css,
"license type buttons are present",
)
button_xpath = (
"//section[contains(@class, 'license')]"
"//div[contains(@class, 'license')]"
"//ul[contains(@class, 'license-types')]"
"//li[contains(@class, 'license-type')]"
"//button[contains(text(),'{license_name}')]"
@@ -151,7 +151,7 @@ class SettingsPage(CoursePage):
raise Exception("Invalid license name: {name}".format(name=license_name))
button.click()
pacing_css = 'section.pacing input[type=radio]'
pacing_css = '.pacing input[type=radio]'
@property
def checked_pacing_css(self):

View File

@@ -482,7 +482,6 @@ class AccountSettingsA11yTest(AccountSettingsTestMixin, WebAppTest):
self.visit_account_settings_page()
self.account_settings_page.a11y_audit.config.set_rules({
'ignore': [
'section', # TODO: AC-491
'link-href', # TODO: AC-233
],
})

View File

@@ -779,7 +779,6 @@ class LearnerProfileA11yTest(LearnerProfileTestMixin, WebAppTest):
profile_page.a11y_audit.config.set_rules({
"ignore": [
'section', # TODO: AC-491
'link-href', # TODO: AC-231
],
})
@@ -807,7 +806,6 @@ class LearnerProfileA11yTest(LearnerProfileTestMixin, WebAppTest):
profile_page.a11y_audit.config.set_rules({
"ignore": [
'section', # TODO: AC-491
'link-href', # TODO: AC-231
],
})
@@ -824,7 +822,6 @@ class LearnerProfileA11yTest(LearnerProfileTestMixin, WebAppTest):
profile_page.a11y_audit.config.set_rules({
"ignore": [
'section', # TODO: AC-491
'link-href', # TODO: AC-231
],
})

View File

@@ -1347,9 +1347,4 @@ class CourseInfoA11yTest(UniqueCourseTest):
def test_course_home_a11y(self):
self.course_info_page.visit()
self.course_info_page.a11y_audit.config.set_rules({
"ignore": [
'section', # TODO: AC-491
]
})
self.course_info_page.a11y_audit.check_for_accessibility_errors()

View File

@@ -648,11 +648,6 @@ class CoursewareMultipleVerticalsTest(UniqueCourseTest, EventsTestMixin):
# Set the scope to the sequence navigation
self.courseware_page.a11y_audit.config.set_scope(
include=['div.sequence-nav'])
self.courseware_page.a11y_audit.config.set_rules({
"ignore": [
'section', # TODO: AC-491
],
})
self.courseware_page.a11y_audit.check_for_accessibility_errors()

View File

@@ -232,9 +232,4 @@ class LmsDashboardA11yTest(BaseLmsDashboardTest):
"""
course_listings = self.dashboard_page.get_course_listings()
self.assertEqual(len(course_listings), 1)
self.dashboard_page.a11y_audit.config.set_rules({
"ignore": [
'section', # TODO: AC-491
]
})
self.dashboard_page.a11y_audit.check_for_accessibility_errors()

View File

@@ -122,12 +122,6 @@ class ProgramListingPageA11yTest(ProgramPageBase):
self.assertTrue(self.listing_page.is_sidebar_present)
self.assertFalse(self.listing_page.are_cards_present)
self.listing_page.a11y_audit.config.set_rules({
"ignore": [
'section', # TODO: AC-491
]
})
self.listing_page.a11y_audit.check_for_accessibility_errors()
def test_cards_a11y(self):
@@ -137,12 +131,6 @@ class ProgramListingPageA11yTest(ProgramPageBase):
self.assertTrue(self.listing_page.is_sidebar_present)
self.assertTrue(self.listing_page.are_cards_present)
self.listing_page.a11y_audit.config.set_rules({
"ignore": [
'section', # TODO: AC-491
]
})
self.listing_page.a11y_audit.check_for_accessibility_errors()
@@ -161,10 +149,4 @@ class ProgramDetailsPageA11yTest(ProgramPageBase):
"""Test the page's a11y compliance."""
self.auth()
self.details_page.visit()
self.details_page.a11y_audit.config.set_rules({
"ignore": [
'section', # TODO: AC-491
]
})
self.details_page.a11y_audit.check_for_accessibility_errors()

View File

@@ -656,7 +656,6 @@ class StudioLibraryA11yTest(StudioLibraryTest):
# we will ignore this error in the test until we fix them.
lib_page.a11y_audit.config.set_rules({
"ignore": [
'section', # TODO: AC-491
'color-contrast', # TODO: AC-225
'link-href', # TODO: AC-226
'nav-aria-label', # TODO: AC-227

View File

@@ -503,7 +503,6 @@ class StudioSettingsA11yTest(StudioCourseTest):
# we will ignore this error in the test until we fix them.
self.settings_page.a11y_audit.config.set_rules({
"ignore": [
'section', # TODO: AC-491
'color-contrast', # TODO: AC-225
'link-href', # TODO: AC-226
'nav-aria-label', # TODO: AC-227
@@ -580,11 +579,6 @@ class StudioSubsectionSettingsA11yTest(StudioCourseTest):
self.course_outline.a11y_audit.config.set_scope(
include=['section.edit-settings-timed-examination']
)
self.course_outline.a11y_audit.config.set_rules({
"ignore": [
'section', # TODO: AC-491
]
})
self.course_outline.a11y_audit.check_for_accessibility_errors()

View File

@@ -358,9 +358,4 @@ class CMSVideoA11yTest(CMSVideoBaseTest):
self.outline.a11y_audit.config.set_scope(
include=["div.video"]
)
self.outline.a11y_audit.config.set_rules({
"ignore": [
'section', # TODO: AC-491
]
})
self.outline.a11y_audit.check_for_accessibility_errors()

View File

@@ -1272,9 +1272,4 @@ class LMSVideoModuleA11yTest(VideoBaseTest):
self.video.a11y_audit.config.set_scope(
include=["div.video"]
)
self.video.a11y_audit.config.set_rules({
"ignore": [
'section', # TODO: AC-491
]
})
self.video.a11y_audit.check_for_accessibility_errors()