Referencia de API de axe-devtools-robot
Not for use with personal data
Esta biblioteca permite que axe DevTools pruebe la accesibilidad mediante robot.
Uso
Primero, importe la biblioteca en la sección de configuración
*** Settings ***
Library axe_devtools_robot.AxeRobot
AxeRobot
extiende el paquete robot SeleniumLibrary
, por lo que todos los métodos disponibles para SeleniumLibrary
están disponibles para AxeRobot
.
Se proporcionan las siguientes palabras clave:
def analyze(self):
"""Run axe on the page. Fail the test if there are any violations."""
def audit_for_accessibility(self):
"""Run axe on the page. Save the results to `axe-reports directory`. Never fails."
def within(self, *selectors):
"""Specify part of the page to run axe on
Args:
selector: List of CSS selectors for elements
"""
def excluding(self, *selectors):
"""Specify part of the page to exclude when runing axe.
Args:
selector: List of CSS selectors for elements
"""
def according_to(self, *tags):
"""Specify rules (by tag) to use when running axe.
List of tags here: https://www.deque.com/axe/core-documentation/api-documentation/#axe-core-tags
Args:
tags: List of tags of rules
"""
def according_to_ruleset(self, ruleset, enable_best_practices = False):
"""Use a specific ruleset (i.e. wcag2.1, 508)
Args:
ruleset_id: id of the ruleset to use
enable_best_practices: Whether or not to turn on rules tagged `best-practice`. Default off
"""
def checking_only(self, *rules):
"""Specify rules (by id) to use when running axe.
List of rules available here: https://dequeuniversity.com/rules/axe/4.1
Args:
rules: List of ids of rules
"""
def skipping(self, *rules):
"""Disable some rules when running axe.
List of rules available here: https://dequeuniversity.com/rules/axe/4.1
Args:
rules: List of ids of rules
"""
Sobre el uso de selectores 'id' de CSS
Robot Framework trata el carácter #
como especial. A menos que escapes tus #
s, Robot interpretará el resto de la línea como un comentario.
En la práctica, esto significa que tendrás que utilizar \#
en lugar de sólo #
.
Consulte la documentación del robot para obtener más detalles.