当前位置: 首页 > 软件库 > 程序开发 > >

ember-accessibility

授权协议 MIT License
开发语言 JavaScript
所属分类 程序开发
软件类型 开源软件
地区 不详
投 递 者 伊温书
操作系统 跨平台
开源组织
适用人群 未知
 软件概览

ember-accessibility

An EmberJS addon to help identify accessibility violations.

This addon uses the axe-core libraryto audit your apps.

DEMO

Compatibility

  • Ember.js v2.18 or above
  • Ember CLI v2.13 or above
  • Node.js v8 or above

Installation

ember install @coyote-labs/ember-accessibility

Usage

  • In your application template, include the AccessibilityTester component.For example,

    <h1>Welcome to my app!</h1>
    <AccessibilityTester />
  • In your config/environment.js, provide an ember-accessibility object that hasthe following fields.

    isEnabled: Defaults to false. You can set it to environment === 'development'.This addon's code will be stripped unless this is set to true.

    axe: Allows configuring axe-core. Refer axe-core's documentation.

    // config/environment.js
    let ENV = {
      'ember-accessibility': {
        isEnabled: environment === 'development',
        axe: {
          restoreScroll: true
        }
      }
    };
  • Click on the Check Accessiblity button that appears when you visit the app.

  • If you want to change the default position of the toggle, pass top and left position values to the AccessibilityTester component.

    Note: Values are in pixels.

    For example,

    <h1>Welcome to my app!</h1>
    <AccessibilityTester @top="25" @left="750"/>
  • Fix the errors that are displayed and make your app accessible!

Using in engines

  • Make sure you add ember-accessibility to the engine's dependencies.
  • Add the accessibility-test service to your engine's dependencies in app.js.

Using in test

  • Import the auditAccessibility() helper from '@coyote-labs/ember-accessibility/test-support/audit'; and then invoke it where needed.

Note: The config passed in config/environment.js will be applied here as well.

Acceptance Tests
import auditAccessibility from '@coyote-labs/ember-accessibility/test-support/audit';

test('Checks accessibility violations', function(assert) {
  visit('/');
  assert.notOk(await auditAccessibility());
});

Or, you can pass any selector or element from the visited page.

import auditAccessibility from '@coyote-labs/ember-accessibility/test-support/audit';

test('Checks accessibility violations', function(assert) {
  visit('/');
  assert.notOk(await auditAccessibility('#someID'));
});
Integration / Unit Tests
import auditAccessibility from '@coyote-labs/ember-accessibility/test-support/audit';

test('Checks accessibility violations in component', function(assert) {
  await render(hbs`<AccessibilityTester />`);  
  assert.notOk(await auditAccessibility(this.element));
});

How is this different from ember-a11y-testing?

ember-a11y-testing is primarily geared towards testing as of now. While thiswill most definitely change, we wanted something that will provide contextualand meaningful feedback to developers during the development phase itself.

For example, here is how ember-a11y-testing looks in development currently.

Notice how all the errors are present on the console. This addon on the other handwill make it easier to comprehend those errors.

Another major reason that we wrote this addon is because our tests becameextremely slow when using ember-a11y-testing. This is a major pain point whenusing it on large projects. By doing a11y testing in development and reviewphases, we were able to avoid that.

Contributing

See the Contributing guide for details.

License

This project is licensed under the MIT License.

 相关资料
  • Ember检查器是一个浏览器插件,用于调试Ember应用程序。 灰烬检查员包括以下主题 - S.No. 灰烬检查员方式和描述 1 安装Inspector 您可以安装Ember检查器来调试您的应用程序。 2 Object Inspector Ember检查器允许与Ember对象进行交互。 3 The View Tree 视图树提供应用程序的当前状态。 4 检查路由,数据选项卡和库信息 您可以看到检查

  • 英文原文: http://emberjs.com/guides/getting-ember/index/ Ember构建 Ember的发布管理团队针对Ember和Ember Data维护了不同的发布方法。 频道 最新的Ember和Ember Data的 Release,Beta 和 Canary 构建可以在这里找到。每一个频道都提供了一个开发版、最小化版和生产版。更多关于不同频道的信息可以查看博客

  • ember-emojione ember-emojione is your emoji solution for Ember, based on the EmojiOne project. EmojiOne version 2 is used, which is free to use for everyone (CC BY-SA 4.0), you're only required to giv

  • Ember 3D Ember 3D is an Ember addon for using Three.js - an easy to use, lightweight, javascript 3D library. It is designed to: Prescribe a solid file structure to Three.js code using ES6 modules. Ena

  • Ember Table An addon to support large data set and a number of features around table. Ember Table canhandle over 100,000 rows without any rendering or performance issues. Ember Table 3.x supports: Emb

  • vscode-ember This is the VSCode extension to use the Ember Language Server. Features All features currently only work in Ember-CLI apps that use classic structure and are a rough first draft with a lo