量角器 - 辅助功能测试结果 - 分析结果

时间:2015-05-28 16:08:05

标签: accessibility protractor angularjs-e2e

我正在使用Accessibility Plugin + Protractor。

如下所示,我在运行一些冒烟测试后看到一些可访问性错误,我不确定,如果在E2E测试期间在每个网页中实际执行了辅助功能审核。

由于我是新手,请在E2E测试期间导航到新网页后,建议是否有任何方法可以触发辅助功能审核。

  

e2e-tests $ grunt量角器:websiteSmokeTests   --website = “https://开头测试网站/”

     

运行“量角器:websiteSmokeTests”(量角器)任务使用   http://localhost:4444/wd/hub [launcher]运行1的selenium服务器   WebDriver的实例

     

网站首页功能
    主页 - 检查无效搜索返回0结果 - 通过
      检查网站站长工具 - BingSiteAuth和Google - 通过
      WebMaster工具 - 检查Robots.txt - 传递

     

网站页面反馈功能
       检查文章的页面反馈 - 给予否 - 通过

     

完成28.875秒8次测试,101次断言,0次失败

     

插件:0(拆解)       Chrome A11Y - 此元素不支持ARIA角色,状态和属性       如果DOM中隐含所有权,则不应使用Chrome A11Y - aria-owned       Chrome A11Y - 具有ARIA角色的元素必须在正确的范围内       Chrome A11Y - 音频元素应该有控件       Chrome A11Y - 此元素具有无效的ARIA属性       Chrome A11Y - ARIA状态和属性值必须有效

    2 elements failed:
    <div id="cookie-notice" class="notification" aria-describedby="cookieinfo">
    <div class="cont ... " id="close-cookie-notification" class="close-notification">Close</button>
    </div>
</div>
    <div id="decommissioned-site-notice" class="notification strong hidden" aria-describedby="decommissi ... -site-notification"
     

类= “关闭通知” &GT;关闭                  

    https://github.com/GoogleChrome/accessibility-developer-tools/wiki/Audit-Rules#ax_aria_04
Chrome A11Y - Elements with ARIA roles must use a valid, non-abstract ARIA role
Chrome A11Y - Controls and media elements should have labels
Chrome A11Y - An element's ID must be unique in the DOM
Chrome A11Y - (WARNING) These elements are focusable but either invisible or obscured by another element (10 elements failed)
Chrome A11Y - The web page should have the content's human language indicated in the markup
Chrome A11Y - Images should have an alt attribute
Chrome A11Y - (WARNING) The purpose of each link should be clear from the link text (3 elements failed)
Chrome A11Y - (WARNING) Text elements should have a reasonable contrast ratio (4 elements failed)
Chrome A11Y - role=main should only appear on significant elements
Chrome A11Y - Meaningful images should not be used in element backgrounds
Chrome A11Y - An element's ID must not be present in more that one aria-owns attribute at any time
Chrome A11Y - ARIA attributes which refer to other elements by ID should refer to elements which exist in the DOM

    2 elements failed:
    <div id="cookie-notice" class="notification" aria-describedby="cookieinfo">
    <div class="cont ... " id="close-cookie-notification" class="close-notification">Close</button>
    </div>
</div>
    <div id="decommissioned-site-notice" class="notification strong hidden" aria-describedby="decommissi ... -site-notification"
     

类= “关闭通知” &GT;关闭                  

    https://github.com/GoogleChrome/accessibility-developer-tools/wiki/Audit-Rules#ax_aria_02

Chrome A11Y - This element has an unsupported ARIA attribute

    2 elements failed:
    <div id="cookie-notice" class="notification" aria-describedby="cookieinfo">
    <div class="cont ... " id="close-cookie-notification" class="close-notification">Close</button>
    </div>
</div>
    <div id="decommissioned-site-notice" class="notification strong hidden" aria-describedby="decommissi ... -site-notification"
     

类= “关闭通知” &GT;关闭                  

    https://github.com/GoogleChrome/accessibility-developer-tools/wiki/Audit-Rules#ax_aria_10
Chrome A11Y - Video elements should use <track> elements to provide captions [launcher] 0 instance(s) of WebDriver still running
     

[启动器] chrome#1失败4次测试[发射器]整体:4次失败   spec(s)[launcher]进程已退出,错误代码为1

     

测试失败,但保持grunt进程活着。

     

完成,没有错误。

4 个答案:

答案 0 :(得分:1)

激活后,辅助功能插件会与您现有的量角器测试一起运行,并会对您的测试命中的每个完整页面进行审核。即使您的测试登陆页面只是为了导航到另一个页面而且在此过程中没有执行任何功能。

旁注:我无法获得ngHint plugin to run on my tests。任何帮助将不胜感激。

答案 1 :(得分:0)

触发审核的方法是编写Accessibility插件可以搭载的测试...它不会抓取您的网站以进行审核。

答案 2 :(得分:0)

我遇到了同样的问题,所以写了一个量角器-accessibility-plugin的衍生物:protractor-axe-report-plugin。它只使用ax引擎生成报告,但可以在测试中运行多个页面。

答案 3 :(得分:0)

如果您愿意自己动手​​而不使用遇到麻烦的可访问性插件,webaccessibility.com提供了一个免费的“量角器连续体”实现示例,可能是入门的好地方;您可以使用它将自动辅助功能测试集成到现有的量角器测试中,或轻松编写新的。 Here's some more information(如果您有兴趣)。

相关问题