class CourseEnrollmentDemographicsAgeTests(CoursePageTestsMixin, WebAppTest): """ A test for the accessibility of the CourseEnrollmentDemographicsAgePage. """ def setUp(self): super(CourseEnrollmentDemographicsAgeTests, self).setUp() self.page = CourseEnrollmentDemographicsAgePage(self.browser) def test_a11y(self): # Log in and navigate to page self.login() self.page.visit() self.page.a11y_audit.config.set_rules({ "ignore": [ 'color-contrast', # TODO: AN-6010, AN-6011 'skip-link', # TODO: AN-6185 'link-href', # TODO: AN-6186 'icon-aria-hidden', # TODO: AN-6187 ], }) # Check the page for accessibility errors report = self.page.a11y_audit.check_for_accessibility_errors()
class CourseEnrollmentDemographicsAgeTests(CoursePageTestsMixin, WebAppTest): """ A test for the accessibility of the CourseEnrollmentDemographicsAgePage. """ def setUp(self): super(CourseEnrollmentDemographicsAgeTests, self).setUp() self.page = CourseEnrollmentDemographicsAgePage(self.browser) def test_a11y(self): # Log in and navigate to page self.login() self.page.visit() self.page.a11y_audit.config.set_rules({ "ignore": [ 'color-contrast', # TODO: AN-6010, AN-6011 'skip-link', # TODO: AN-6185 'link-href', # TODO: AN-6186 'icon-aria-hidden', # TODO: AN-6187 ], }) # Wait for the datatable to finish loading ready_promise = EmptyPromise( lambda: 'Loading' not in self.page.q(css='div.section-data-table').text, "Page finished loading" ).fulfill() # Check the page for accessibility errors report = self.page.a11y_audit.check_for_accessibility_errors()
class CourseEnrollmentDemographicsAgeTests(CoursePageTestsMixin, WebAppTest): """ A test for the accessibility of the CourseEnrollmentDemographicsAgePage. """ def setUp(self): super(CourseEnrollmentDemographicsAgeTests, self).setUp() self.page = CourseEnrollmentDemographicsAgePage(self.browser) def test_axs(self): # Log in and navigate to page self.login() self.page.visit() # TODO: AN-6010 # TODO: AN-6011 self.page.a11y_audit.config.set_rules({ "ignore": ['color-contrast'], }) # Check the page for accessibility errors report = self.page.a11y_audit.check_for_accessibility_errors()
class CourseEnrollmentDemographicsAgeTests(CoursePageTestsMixin, WebAppTest): """ A test for the accessibility of the CourseEnrollmentDemographicsAgePage. """ def setUp(self): super(CourseEnrollmentDemographicsAgeTests, self).setUp() self.page = CourseEnrollmentDemographicsAgePage(self.browser) def test_axs(self): # Log in and navigate to page self.login() self.page.visit() # Generate accessibillity report report = self.page.do_axs_audit() # Check that there was one page reviewed in this report 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) )