Merge pull request #12542 from edx/diana/discussion-a11y
Add accessibility tests for discussion forums.
This commit is contained in:
@@ -203,6 +203,16 @@ class DiscussionHomePageTest(UniqueCourseTest):
|
||||
self.page.click_new_post_button()
|
||||
self.assertIsNotNone(self.page.new_post_form)
|
||||
|
||||
def test_page_accessibility(self):
|
||||
self.page.a11y_audit.config.set_rules({
|
||||
"ignore": [
|
||||
'color-contrast', # TNL-4635
|
||||
'link-href', # TNL-4636
|
||||
'icon-aria-hidden', # TNL-4637
|
||||
]
|
||||
})
|
||||
self.page.a11y_audit.check_for_accessibility_errors()
|
||||
|
||||
|
||||
@attr('shard_2')
|
||||
class DiscussionTabSingleThreadTest(BaseDiscussionTestCase, DiscussionResponsePaginationTestMixin):
|
||||
@@ -331,6 +341,29 @@ class DiscussionTabMultipleThreadTest(BaseDiscussionTestCase):
|
||||
# Verify that the focus is changed
|
||||
self.thread_page_2.check_focus_is_set(selector=".discussion-article")
|
||||
|
||||
def test_page_accessibility(self):
|
||||
self.thread_page_1.a11y_audit.config.set_rules({
|
||||
"ignore": [
|
||||
'aria-valid-attr-value', # TNL-4638
|
||||
'color-contrast', # TNL-4639
|
||||
'link-href', # TNL-4640
|
||||
'icon-aria-hidden', # TNL-4641
|
||||
]
|
||||
})
|
||||
|
||||
self.thread_page_1.a11y_audit.check_for_accessibility_errors()
|
||||
|
||||
self.thread_page_2.a11y_audit.config.set_rules({
|
||||
"ignore": [
|
||||
'aria-valid-attr-value', # TNL-4638
|
||||
'color-contrast', # TNL-4639
|
||||
'link-href', # TNL-4640
|
||||
'icon-aria-hidden', # TNL-4641
|
||||
]
|
||||
})
|
||||
|
||||
self.thread_page_2.a11y_audit.check_for_accessibility_errors()
|
||||
|
||||
|
||||
@attr('shard_2')
|
||||
class DiscussionOpenClosedThreadTest(BaseDiscussionTestCase):
|
||||
@@ -380,6 +413,29 @@ class DiscussionOpenClosedThreadTest(BaseDiscussionTestCase):
|
||||
self.assertTrue(page._is_element_visible('.response_response1 .action-vote'))
|
||||
self.assertFalse(page._is_element_visible('.response_response1 .display-vote'))
|
||||
|
||||
def test_page_accessibility(self):
|
||||
page = self.setup_openclosed_thread_page()
|
||||
page.a11y_audit.config.set_rules({
|
||||
'ignore': [
|
||||
'aria-valid-attr-value', # TNL-4643
|
||||
'color-contrast', # TNL-4644
|
||||
'link-href', # TNL-4640
|
||||
'icon-aria-hidden', # TNL-4645
|
||||
]
|
||||
})
|
||||
page.a11y_audit.check_for_accessibility_errors()
|
||||
|
||||
page = self.setup_openclosed_thread_page(True)
|
||||
page.a11y_audit.config.set_rules({
|
||||
'ignore': [
|
||||
'aria-valid-attr-value', # TNL-4643
|
||||
'color-contrast', # TNL-4644
|
||||
'link-href', # TNL-4640
|
||||
'icon-aria-hidden', # TNL-4645
|
||||
]
|
||||
})
|
||||
page.a11y_audit.check_for_accessibility_errors()
|
||||
|
||||
|
||||
@attr('shard_2')
|
||||
class DiscussionCommentDeletionTest(BaseDiscussionTestCase):
|
||||
@@ -653,6 +709,22 @@ class DiscussionResponseEditTest(BaseDiscussionTestCase):
|
||||
page.endorse_response('response_self_author')
|
||||
page.endorse_response('response_other_author')
|
||||
|
||||
def test_page_accessibility(self):
|
||||
self.setup_user()
|
||||
self.setup_view()
|
||||
page = self.create_single_thread_page("response_edit_test_thread")
|
||||
page.a11y_audit.config.set_rules({
|
||||
'ignore': [
|
||||
'aria-valid-attr-value', # TNL-4638
|
||||
'color-contrast', # TNL-4644
|
||||
'link-href', # TNL-4640
|
||||
'icon-aria-hidden', # TNL-4645
|
||||
'duplicate-id', # TNL-4647
|
||||
]
|
||||
})
|
||||
page.visit()
|
||||
page.a11y_audit.check_for_accessibility_errors()
|
||||
|
||||
|
||||
@attr('shard_2')
|
||||
class DiscussionCommentEditTest(BaseDiscussionTestCase):
|
||||
@@ -736,6 +808,21 @@ class DiscussionCommentEditTest(BaseDiscussionTestCase):
|
||||
self.assertFalse(page.is_comment_editor_visible("comment_self_author"))
|
||||
self.assertTrue(page.is_add_comment_visible("response1"))
|
||||
|
||||
def test_page_accessibility(self):
|
||||
self.setup_user()
|
||||
self.setup_view()
|
||||
page = self.create_single_thread_page("comment_edit_test_thread")
|
||||
page.visit()
|
||||
page.a11y_audit.config.set_rules({
|
||||
'ignore': [
|
||||
'aria-valid-attr-value', # TNL-4643
|
||||
'color-contrast', # TNL-4644
|
||||
'link-href', # TNL-4640
|
||||
'icon-aria-hidden', # TNL-4645
|
||||
]
|
||||
})
|
||||
page.a11y_audit.check_for_accessibility_errors()
|
||||
|
||||
|
||||
@attr('shard_2')
|
||||
class InlineDiscussionTest(UniqueCourseTest, DiscussionResponsePaginationTestMixin):
|
||||
@@ -1098,6 +1185,16 @@ class DiscussionSearchAlertTest(UniqueCourseTest):
|
||||
self.SEARCHED_USERNAME
|
||||
).wait_for_page()
|
||||
|
||||
def test_page_accessibility(self):
|
||||
self.page.a11y_audit.config.set_rules({
|
||||
'ignore': [
|
||||
'color-contrast', # TNL-4639
|
||||
'link-href', # TNL-4640
|
||||
'icon-aria-hidden', # TNL-4641
|
||||
]
|
||||
})
|
||||
self.page.a11y_audit.check_for_accessibility_errors()
|
||||
|
||||
|
||||
@attr('shard_2')
|
||||
class DiscussionSortPreferenceTest(UniqueCourseTest):
|
||||
|
||||
Reference in New Issue
Block a user