{"id":931,"date":"2020-05-01T12:11:00","date_gmt":"2020-05-01T12:11:00","guid":{"rendered":"http:\/\/thinkcolorful.org\/?p=931"},"modified":"2024-12-13T19:36:50","modified_gmt":"2024-12-13T19:36:50","slug":"automating-accessibility-checks-in-mediawiki","status":"publish","type":"post","link":"https:\/\/thinkcolorful.org\/?p=931","title":{"rendered":"Automating Accessibility Checks in Mediawiki"},"content":{"rendered":"\n<p>I did this a little while ago, but thought it was neat so I wanted to write about it. I found that <a href=\"https:\/\/www.deque.com\/axe\/\">Duque&#8217;s Axe tool<\/a> was available as an <a href=\"https:\/\/www.npmjs.com\/package\/wdio-axe\">npm module<\/a> so I decided to integrate into Mediawiki&#8217;s Growth Experiments extension as an <a href=\"https:\/\/gerrit.wikimedia.org\/r\/c\/mediawiki\/extensions\/GrowthExperiments\/+\/593868\">example for how these sorts of checks can be implemented.<\/a><\/p>\n\n\n\n<!--more-->\n\n\n\n<pre class=\"wp-block-code\"><code>var assert = require( 'assert' ),\n\tHomepagePage = require( '..\/pageobjects\/homepage.page' ),\n\tLoginPage = require( 'wdio-mediawiki\/LoginPage' ),\n\tApi = require( 'wdio-mediawiki\/Api' ),\n\tUtil = require( 'wdio-mediawiki\/Util' ),\n\taXe = require( 'wdio-axe' );\n\ndescribe( 'Homepage', function () {\n\tlet password, username, bot;\n\n\tbefore( async () => {\n\t\tbot = await Api.bot();\n\t} );\n\n\tbeforeEach( function () {\n\t\tusername = Util.getTestString( 'NewUser-' );\n\t\tpassword = Util.getTestString();\n\t\tbrowser.call( async () => {\n\t\t\tawait Api.createAccount( bot, username, password );\n\t\t} );\n\t\tLoginPage.login( username, password );\n\t} );\n\n\tit( 'has no accessibility violations', function () {\n\n\t\tHomepagePage.open();\n\n\t\tconst result = aXe.getViolations();\n\t\tconsole.log( result );\n\t\tassert( HomepagePage.homepage.isExisting() );\n\t\tassert.strictEqual( result.violations&#91; 0 ].result, 'No Violations found in this page' );\n\n\t} );\n\n} );<\/code><\/pre>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>I did this a little while ago, but thought it was neat so I wanted to write about it.&#46;&#46;&#46;<\/p>\n","protected":false},"author":1,"featured_media":1322,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[214,10,216],"tags":[],"class_list":["post-931","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-javascript","category-programming","category-qa"],"_links":{"self":[{"href":"https:\/\/thinkcolorful.org\/index.php?rest_route=\/wp\/v2\/posts\/931","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/thinkcolorful.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/thinkcolorful.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/thinkcolorful.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/thinkcolorful.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=931"}],"version-history":[{"count":4,"href":"https:\/\/thinkcolorful.org\/index.php?rest_route=\/wp\/v2\/posts\/931\/revisions"}],"predecessor-version":[{"id":1063,"href":"https:\/\/thinkcolorful.org\/index.php?rest_route=\/wp\/v2\/posts\/931\/revisions\/1063"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/thinkcolorful.org\/index.php?rest_route=\/wp\/v2\/media\/1322"}],"wp:attachment":[{"href":"https:\/\/thinkcolorful.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=931"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/thinkcolorful.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=931"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/thinkcolorful.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=931"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}