Commit a40f286e by Christine Lytwynec

Updating a11y tests

parent 5d9dc325
...@@ -459,4 +459,10 @@ class AccountSettingsA11yTest(AccountSettingsTestMixin, WebAppTest): ...@@ -459,4 +459,10 @@ class AccountSettingsA11yTest(AccountSettingsTestMixin, WebAppTest):
""" """
self.log_in_as_unique_user() self.log_in_as_unique_user()
self.visit_account_settings_page() self.visit_account_settings_page()
self.account_settings_page.a11y_audit.config.set_rules({
'ignore': [
'link-href', # TODO: AC-233, AC-230
'skip-link', # TODO: AC-179
],
})
self.account_settings_page.a11y_audit.check_for_accessibility_errors() self.account_settings_page.a11y_audit.check_for_accessibility_errors()
...@@ -765,10 +765,12 @@ class LearnerProfileA11yTest(LearnerProfileTestMixin, WebAppTest): ...@@ -765,10 +765,12 @@ class LearnerProfileA11yTest(LearnerProfileTestMixin, WebAppTest):
username, _ = self.log_in_as_unique_user() username, _ = self.log_in_as_unique_user()
profile_page = self.visit_profile_page(username) profile_page = self.visit_profile_page(username)
# TODO: There are several existing color contrast errors on this page,
# we will ignore this error in the test until we fix them.
profile_page.a11y_audit.config.set_rules({ profile_page.a11y_audit.config.set_rules({
"ignore": ['color-contrast'], "ignore": [
'color-contrast', # TODO: AC-232
'skip-link', # TODO: AC-179
'link-href', # TODO: AC-231
],
}) })
profile_page.a11y_audit.check_for_accessibility_errors() profile_page.a11y_audit.check_for_accessibility_errors()
...@@ -791,4 +793,12 @@ class LearnerProfileA11yTest(LearnerProfileTestMixin, WebAppTest): ...@@ -791,4 +793,12 @@ class LearnerProfileA11yTest(LearnerProfileTestMixin, WebAppTest):
different_username, _ = self.initialize_different_user(privacy=self.PRIVACY_PUBLIC) different_username, _ = self.initialize_different_user(privacy=self.PRIVACY_PUBLIC)
self.log_in_as_unique_user() self.log_in_as_unique_user()
profile_page = self.visit_profile_page(different_username) profile_page = self.visit_profile_page(different_username)
profile_page.a11y_audit.config.set_rules({
"ignore": [
'skip-link', # TODO: AC-179
'link-href', # TODO: AC-231
],
})
profile_page.a11y_audit.check_for_accessibility_errors() profile_page.a11y_audit.check_for_accessibility_errors()
...@@ -233,10 +233,11 @@ class LmsDashboardA11yTest(BaseLmsDashboardTest): ...@@ -233,10 +233,11 @@ class LmsDashboardA11yTest(BaseLmsDashboardTest):
course_listings = self.dashboard_page.get_course_listings() course_listings = self.dashboard_page.get_course_listings()
self.assertEqual(len(course_listings), 1) self.assertEqual(len(course_listings), 1)
# There are several existing color contrast errors on this page,
# we will ignore this error in the test until we fix them.
self.dashboard_page.a11y_audit.config.set_rules({ self.dashboard_page.a11y_audit.config.set_rules({
"ignore": ['color-contrast'], "ignore": [
'skip-link', # TODO: AC-179
'link-href', # TODO: AC-230
],
}) })
self.dashboard_page.a11y_audit.check_for_accessibility_errors() self.dashboard_page.a11y_audit.check_for_accessibility_errors()
...@@ -656,7 +656,13 @@ class StudioLibraryA11yTest(StudioLibraryTest): ...@@ -656,7 +656,13 @@ class StudioLibraryA11yTest(StudioLibraryTest):
# There are several existing color contrast errors on this page, # There are several existing color contrast errors on this page,
# we will ignore this error in the test until we fix them. # we will ignore this error in the test until we fix them.
lib_page.a11y_audit.config.set_rules({ lib_page.a11y_audit.config.set_rules({
"ignore": ['color-contrast'], "ignore": [
'color-contrast', # TODO: AC-225
'link-href', # TODO: AC-226
'nav-aria-label', # TODO: AC-227
'skip-link', # TODO: AC-228
'icon-aria-hidden', # TODO: AC-229
],
}) })
lib_page.a11y_audit.check_for_accessibility_errors() lib_page.a11y_audit.check_for_accessibility_errors()
...@@ -344,6 +344,11 @@ class CMSVideoA11yTest(CMSVideoBaseTest): ...@@ -344,6 +344,11 @@ class CMSVideoA11yTest(CMSVideoBaseTest):
def test_video_player_a11y(self): def test_video_player_a11y(self):
# Limit the scope of the audit to the video player only. # Limit the scope of the audit to the video player only.
self.outline.a11y_audit.config.set_scope(include=["div.video"]) self.outline.a11y_audit.config.set_scope(include=["div.video"])
self.outline.a11y_audit.config.set_rules({
"ignore": [
'link-href', # TODO: AC-223
],
})
self._create_course_unit() self._create_course_unit()
self.outline.a11y_audit.check_for_accessibility_errors() self.outline.a11y_audit.check_for_accessibility_errors()
...@@ -3,6 +3,9 @@ ...@@ -3,6 +3,9 @@
""" """
Acceptance tests for Video. Acceptance tests for Video.
""" """
import os
from mock import patch
from nose.plugins.attrib import attr from nose.plugins.attrib import attr
from unittest import skipIf, skip from unittest import skipIf, skip
from ..helpers import UniqueCourseTest, is_youtube_available, YouTubeStubConfig from ..helpers import UniqueCourseTest, is_youtube_available, YouTubeStubConfig
...@@ -30,7 +33,6 @@ HTML5_SOURCES_INCORRECT = [ ...@@ -30,7 +33,6 @@ HTML5_SOURCES_INCORRECT = [
] ]
@attr('shard_4')
@skipIf(is_youtube_available() is False, 'YouTube is not available!') @skipIf(is_youtube_available() is False, 'YouTube is not available!')
class VideoBaseTest(UniqueCourseTest): class VideoBaseTest(UniqueCourseTest):
""" """
...@@ -192,6 +194,7 @@ class VideoBaseTest(UniqueCourseTest): ...@@ -192,6 +194,7 @@ class VideoBaseTest(UniqueCourseTest):
self.video.wait_for_video_player_render() self.video.wait_for_video_player_render()
@attr('shard_4')
class YouTubeVideoTest(VideoBaseTest): class YouTubeVideoTest(VideoBaseTest):
""" Test YouTube Video Player """ """ Test YouTube Video Player """
...@@ -849,6 +852,7 @@ class YouTubeVideoTest(VideoBaseTest): ...@@ -849,6 +852,7 @@ class YouTubeVideoTest(VideoBaseTest):
execute_video_steps(tab1_video_names) execute_video_steps(tab1_video_names)
@attr('shard_4')
class YouTubeHtml5VideoTest(VideoBaseTest): class YouTubeHtml5VideoTest(VideoBaseTest):
""" Test YouTube HTML5 Video Player """ """ Test YouTube HTML5 Video Player """
...@@ -870,6 +874,7 @@ class YouTubeHtml5VideoTest(VideoBaseTest): ...@@ -870,6 +874,7 @@ class YouTubeHtml5VideoTest(VideoBaseTest):
self.assertTrue(self.video.is_video_rendered('youtube')) self.assertTrue(self.video.is_video_rendered('youtube'))
@attr('shard_4')
class Html5VideoTest(VideoBaseTest): class Html5VideoTest(VideoBaseTest):
""" Test HTML5 Video Player """ """ Test HTML5 Video Player """
...@@ -1055,6 +1060,7 @@ class Html5VideoTest(VideoBaseTest): ...@@ -1055,6 +1060,7 @@ class Html5VideoTest(VideoBaseTest):
self.assertTrue(all([source in HTML5_SOURCES for source in self.video.sources])) self.assertTrue(all([source in HTML5_SOURCES for source in self.video.sources]))
@attr('shard_4')
class YouTubeQualityTest(VideoBaseTest): class YouTubeQualityTest(VideoBaseTest):
""" Test YouTube Video Quality Button """ """ Test YouTube Video Quality Button """
...@@ -1099,3 +1105,36 @@ class YouTubeQualityTest(VideoBaseTest): ...@@ -1099,3 +1105,36 @@ class YouTubeQualityTest(VideoBaseTest):
self.video.click_player_button('quality') self.video.click_player_button('quality')
self.assertTrue(self.video.is_quality_button_active) self.assertTrue(self.video.is_quality_button_active)
@attr('a11y')
class LMSVideoModuleA11yTest(VideoBaseTest):
"""
LMS Video Accessibility Test Class
"""
def setUp(self):
browser = os.environ.get('SELENIUM_BROWSER', 'firefox')
# the a11y tests run in CI under phantomjs which doesn't
# support html5 video or flash player, so the video tests
# don't work in it. We still want to be able to run these
# tests in CI, so override the browser setting if it is
# phantomjs.
if browser == 'phantomjs':
browser = 'firefox'
with patch.dict(os.environ, {'SELENIUM_BROWSER': browser}):
super(LMSVideoModuleA11yTest, self).setUp()
def test_video_player_a11y(self):
self.navigate_to_video()
# Limit the scope of the audit to the video player only.
self.video.a11y_audit.config.set_scope(include=["div.video"])
self.video.a11y_audit.config.set_rules({
"ignore": [
'link-href', # TODO: AC-223
],
})
self.video.a11y_audit.check_for_accessibility_errors()
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment