move existing a11y tests to bokchoy test folder
This commit is contained in:
@@ -1,28 +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_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()
|
||||
@@ -1,30 +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_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()
|
||||
@@ -3,6 +3,7 @@
|
||||
End-to-end tests for the main LMS Dashboard (aka, Student Dashboard).
|
||||
"""
|
||||
import datetime
|
||||
from nose.plugins.attrib import attr
|
||||
|
||||
from ..helpers import UniqueCourseTest
|
||||
from ...fixtures.course import CourseFixture
|
||||
@@ -217,3 +218,25 @@ class LmsDashboardPageTest(BaseLmsDashboardTest):
|
||||
# Test that proper course date with 'starts' message is displayed if a course is about to start in future,
|
||||
# and course starts within 5 days
|
||||
self.assertEqual(course_date, expected_course_date)
|
||||
|
||||
|
||||
@attr('a11y')
|
||||
class LmsDashboardA11yTest(BaseLmsDashboardTest):
|
||||
"""
|
||||
Class to test lms student dashboard accessibility.
|
||||
"""
|
||||
|
||||
def test_dashboard_course_listings_a11y(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()
|
||||
|
||||
@@ -637,3 +637,26 @@ class LibraryUsersPageTest(StudioLibraryTest):
|
||||
self.assertEqual(len(self.page.users), 1)
|
||||
user = self.page.users[0]
|
||||
self.assertTrue(user.is_current_user)
|
||||
|
||||
|
||||
@attr('a11y')
|
||||
class StudioLibraryA11yTest(StudioLibraryTest):
|
||||
"""
|
||||
Class to test Studio pages accessibility.
|
||||
"""
|
||||
|
||||
def test_lib_edit_page_a11y(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()
|
||||
|
||||
@@ -3,4 +3,4 @@ echo "Setting up for accessibility tests..."
|
||||
source scripts/jenkins-common.sh
|
||||
|
||||
echo "Running explicit accessibility tests..."
|
||||
SELENIUM_BROWSER=phantomjs paver test_bokchoy -d accessibility
|
||||
SELENIUM_BROWSER=phantomjs paver test_bokchoy --extra_args="-a 'a11y'"
|
||||
|
||||
@@ -173,7 +173,7 @@ END
|
||||
;;
|
||||
|
||||
"7")
|
||||
paver test_bokchoy --extra_args="-a shard_1=False,shard_2=False,shard_3=False,shard_4=False,shard_5=False,shard_6=False --with-flaky"
|
||||
paver test_bokchoy --extra_args="-a shard_1=False,shard_2=False,shard_3=False,shard_4=False,shard_5=False,shard_6=False,a11y=False --with-flaky"
|
||||
;;
|
||||
|
||||
# Default case because if we later define another bok-choy shard on Jenkins
|
||||
|
||||
Reference in New Issue
Block a user