<commit_before>from bok_choy.web_app_test import WebAppTest
from bok_choy.promise import EmptyPromise
from a11y_tests.pages import CourseEnrollmentDemographicsAgePage
from a11y_tests.mixins import CoursePageTestsMixin

_multiprocess_can_split_ = True


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.q(css='div.section-data-table').text,
            "Page finished loading"
        ).fulfill()

        # Check the page for accessibility errors<commit_msg>Fix bok-choy page query call<commit_after>from bok_choy.web_app_test import WebAppTest
from bok_choy.promise import EmptyPromise
from a11y_tests.pages import CourseEnrollmentDemographicsAgePage
from a11y_tests.mixins import CoursePageTestsMixin

_multiprocess_can_split_ = True


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
{'fraction_non_alphanumeric': 0.08803088803088803, 'fraction_numerical': 0.021621621621621623, 'mean_word_length': 2.5541838134430725, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5558664', 'n_tokens_mistral': 833, 'n_tokens_neox': 760, 'n_words': 171}