Closed o-az closed 4 years ago
Apologies that I haven’t responded yet—did you still need assistance?
I've been able to achieve what I needed, but thank you. Basically what I wanted is to provide a list of tags such as wcag2aa
or section508
and have axe only writes the violations that have those tags to the json
file. I converted both my tags and the aXe report tags to sets and compared:
# tags I provide
tags = [ 'wcag2aa', 'section508' ]
# loop through violations and only get ones that have
# one or more of the tags I provided
report = [violation for violation in results['violations']
if bool(set(violation['tags']) & set(tags))]
axe.write_results(report, 'a11y.json')
I'm not sure if there's another way that's built into 'axe-selenium-python' but this ought to do for now.
Hi, Is there any better way to get violations with provided tags? Or just this workaround? Kind regards!
How do I specify only
wcag2aa
for example? I don't want to test against all a11y violation standards. My current code: