From b84f35349a61c95ce4d78cd2773a855a4afb031f Mon Sep 17 00:00:00 2001 From: Christine Lytwynec Date: Tue, 22 Sep 2015 11:31:08 -0400 Subject: [PATCH] update bok-choy version to v0.4.5 --- .../accessibility/test_lms_dashboard_a11y.py | 28 ++++++++++++++ .../accessibility/test_lms_dashboard_axs.py | 36 ------------------ .../accessibility/test_studio_library_a11y.py | 30 +++++++++++++++ .../accessibility/test_studio_library_axs.py | 37 ------------------- requirements/edx/base.txt | 2 +- 5 files changed, 59 insertions(+), 74 deletions(-) create mode 100644 common/test/acceptance/accessibility/test_lms_dashboard_a11y.py delete mode 100644 common/test/acceptance/accessibility/test_lms_dashboard_axs.py create mode 100644 common/test/acceptance/accessibility/test_studio_library_a11y.py delete mode 100644 common/test/acceptance/accessibility/test_studio_library_axs.py diff --git a/common/test/acceptance/accessibility/test_lms_dashboard_a11y.py b/common/test/acceptance/accessibility/test_lms_dashboard_a11y.py new file mode 100644 index 0000000000..45304ae506 --- /dev/null +++ b/common/test/acceptance/accessibility/test_lms_dashboard_a11y.py @@ -0,0 +1,28 @@ +""" +Accessibility tests for LMS dashboard page. + +Run just this test with: +SELENIUM_BROWSER=phantomjs paver test_bokchoy -d accessibility -t test_lms_dashboard_a11y.py +""" +from ..tests.lms.test_lms_dashboard import BaseLmsDashboardTest + + +class LmsDashboardAxsTest(BaseLmsDashboardTest): + """ + Class to test lms student dashboard accessibility. + """ + + def test_dashboard_course_listings_axs(self): + """ + Test the accessibility of the course listings + """ + course_listings = self.dashboard_page.get_course_listings() + 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({ + "ignore": ['color-contrast'], + }) + + self.dashboard_page.a11y_audit.check_for_accessibility_errors() diff --git a/common/test/acceptance/accessibility/test_lms_dashboard_axs.py b/common/test/acceptance/accessibility/test_lms_dashboard_axs.py deleted file mode 100644 index f377d3b053..0000000000 --- a/common/test/acceptance/accessibility/test_lms_dashboard_axs.py +++ /dev/null @@ -1,36 +0,0 @@ -""" -Accessibility tests for LMS dashboard page. - -Run just this test with: -SELENIUM_BROWSER=phantomjs paver test_bokchoy -d accessibility -t test_lms_dashboard_axs.py -""" -from ..tests.lms.test_lms_dashboard import BaseLmsDashboardTest - - -class LmsDashboardAxsTest(BaseLmsDashboardTest): - """ - Class to test lms student dashboard accessibility. - """ - - def test_dashboard_course_listings_axs(self): - """ - Test the accessibility of the course listings - """ - course_listings = self.dashboard_page.get_course_listings() - self.assertEqual(len(course_listings), 1) - - report = self.dashboard_page.do_axs_audit() - - # There was one page in this session - self.assertEqual(1, len(report)) - - result = report[0] - # Verify that this page has no accessibility errors. - self.assertEqual(0, len(result.errors)) - # Verify that this page currently has 2 accessibility warnings. - self.assertEqual(2, len(result.warnings)) - # And that these are the warnings that the page currently gives. - for warning in result.warnings: - self.assertTrue( - warning.startswith(('Warning: AX_FOCUS_01', 'Warning: AX_COLOR_01',)), - msg="Unexpected warning: {}".format(warning)) diff --git a/common/test/acceptance/accessibility/test_studio_library_a11y.py b/common/test/acceptance/accessibility/test_studio_library_a11y.py new file mode 100644 index 0000000000..a4a86e1f43 --- /dev/null +++ b/common/test/acceptance/accessibility/test_studio_library_a11y.py @@ -0,0 +1,30 @@ +""" +Accessibility tests for Studio Library pages. + +Run just this test with: +SELENIUM_BROWSER=phantomjs paver test_bokchoy -d accessibility -t test_studio_library_a11y.py +""" +from ..tests.studio.base_studio_test import StudioLibraryTest +from ..pages.studio.library import LibraryEditPage + + +class StudioLibraryAxsTest(StudioLibraryTest): + """ + Class to test Studio pages accessibility. + """ + + def test_lib_edit_page_axs(self): + """ + Check accessibility of LibraryEditPage. + """ + lib_page = LibraryEditPage(self.browser, self.library_key) + lib_page.visit() + lib_page.wait_until_ready() + + # There are several existing color contrast errors on this page, + # we will ignore this error in the test until we fix them. + lib_page.a11y_audit.config.set_rules({ + "ignore": ['color-contrast'], + }) + + lib_page.a11y_audit.check_for_accessibility_errors() diff --git a/common/test/acceptance/accessibility/test_studio_library_axs.py b/common/test/acceptance/accessibility/test_studio_library_axs.py deleted file mode 100644 index 17d22ca29b..0000000000 --- a/common/test/acceptance/accessibility/test_studio_library_axs.py +++ /dev/null @@ -1,37 +0,0 @@ -""" -Accessibility tests for Studio Library pages. - -Run just this test with: -SELENIUM_BROWSER=phantomjs paver test_bokchoy -d accessibility -t test_studio_library_axs.py -""" -from ..tests.studio.base_studio_test import StudioLibraryTest -from ..pages.studio.library import LibraryEditPage - - -class StudioLibraryAxsTest(StudioLibraryTest): - """ - Class to test Studio pages accessibility. - """ - - def test_lib_edit_page_axs(self): - """ - Check accessibility of LibraryEditPage. - """ - lib_page = LibraryEditPage(self.browser, self.library_key) - lib_page.visit() - lib_page.wait_until_ready() - report = lib_page.do_axs_audit() - - # There was one page in this session - self.assertEqual(1, len(report)) - - result = report[0] - # Verify that this page has no accessibility errors. - self.assertEqual(0, len(result.errors)) - # Verify that this page currently has 3 accessibility warnings. - self.assertEqual(3, len(result.warnings)) - # And that these are the warnings that the page currently gives. - for warning in result.warnings: - self.assertTrue( - warning.startswith(('Warning: AX_FOCUS_01', 'Warning: AX_COLOR_01', 'Warning: AX_IMAGE_01',)), - msg="Unexpected warning: {}".format(warning)) diff --git a/requirements/edx/base.txt b/requirements/edx/base.txt index d7792b1024..1ddc16f6b1 100644 --- a/requirements/edx/base.txt +++ b/requirements/edx/base.txt @@ -119,7 +119,7 @@ django_debug_toolbar==1.3.2 # Used for testing astroid==1.3.8 -bok-choy==0.4.3 +bok-choy==0.4.5 chrono==1.0.2 coverage==4.0 ddt==0.8.0