Пример #1
0
def pa11ycrawler(options):
    """
    Runs pa11ycrawler against the demo-test-course to generates accessibility
    reports. (See https://github.com/edx/demo-test-course)

    Note: Like the bok-choy tests, this can be used with the `serversonly`
    flag to get an environment running. The setup for this is the same as
    for bok-choy tests, only test course is imported as well.
    """
    opts = parse_bokchoy_opts(options)
    opts['report_dir'] = Env.PA11YCRAWLER_REPORT_DIR
    opts['coveragerc'] = Env.PA11YCRAWLER_COVERAGERC
    opts['should_fetch_course'] = getattr(options, 'should_fetch_course', None)
    opts['course_key'] = getattr(options, 'course-key', None)
    test_suite = Pa11yCrawler('a11y_crawler', **opts)
    test_suite.run()

    if getattr(options, 'with_html', False):
        test_suite.generate_html_reports()
Пример #2
0
def pa11ycrawler(options, passthrough_options):
    """
    Runs pa11ycrawler against the demo-test-course to generates accessibility
    reports. (See https://github.com/edx/demo-test-course)

    Note: Like the bok-choy tests, this can be used with the `serversonly`
    flag to get an environment running. The setup for this is the same as
    for bok-choy tests, only test course is imported as well.
    """
    # Modify the options object directly, so that any subsequently called tasks
    # that share with this task get the modified options
    options.pa11ycrawler.report_dir = Env.PA11YCRAWLER_REPORT_DIR
    options.pa11ycrawler.coveragerc = options.get('coveragerc', None)
    options.pa11ycrawler.should_fetch_course = getattr(
        options, 'should_fetch_course', not options.get('fasttest'))
    options.pa11ycrawler.course_key = getattr(options, 'course-key',
                                              "course-v1:edX+Test101+course")
    test_suite = Pa11yCrawler('pa11ycrawler',
                              passthrough_options=passthrough_options,
                              **options.pa11ycrawler)
    test_suite.run()

    if getattr(options, 'with_html', False):
        test_suite.generate_html_reports()