Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Basic accessibility testing with HTML_CodeSniffer in Grunt's test phase #3487

Conversation

OwenEdwards
Copy link
Member

Description

Add automated accessibility (a11y) testing to Grunt's testing. Use HTML_CodeSniffer, which does fairly reliable in-browser testing, to check for any automatically-detectable violations in the video.js player core, using sandbox/descriptions.html.example (since that file has a fairly comprehensive set of additional tracks for accessibility).

Note that automated testing can only detect a fraction of potential accessibility issues, since accessibility is inherently a functional issue rather than purely technical - passing these tests should not be considered a thorough test of accessibility, but just a baseline verification. (Note, for example, that it did flag a11y violations with the Captions Settings Dialog before #3281)

Requirements Checklist

  • Feature implemented / Bug fixed
  • If necessary, more likely in a feature request than a bug fix
    • Unit Tests updated or fixed - N/A
    • Docs/guides updated
    • Example created - N/A
    • Reviewed by Two Core Contributors

@gkatsev gkatsev modified the milestone: 3.12 build-improvements Aug 3, 2016
@misteroneill misteroneill added the a11y This item might affect the accessibility of the player label Aug 3, 2016
@@ -190,6 +190,7 @@ module.exports = function(grunt) {
swf: { cwd: 'node_modules/videojs-swf/dist/', src: 'video-js.swf', dest: 'build/temp/', expand: true, filter: 'isFile' },
ie8: { cwd: 'node_modules/videojs-ie8/dist/', src: ['**/**'], dest: 'build/temp/ie8/', expand: true, filter: 'isFile' },
dist: { cwd: 'build/temp/', src: ['**/**', '!test*'], dest: 'dist/', expand: true, filter: 'isFile' },
a11y: { src: 'sandbox/descriptions.html.example', dest: 'sandbox/descriptions.test-a11y.html' }, // Can only test a file with a .html or .htm extension
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe build/temp is the directory we want to use?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The problem with that is that the js and css references from the example file(s) break, because they specifically point to ../build/temp/. Any suggestions?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe it's just time to remove .example suffixes from the examples?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That would make thinks a lot simpler! I don't understand why they're .example, although I guess it's something to do with git/GitHub? But yes, it means all sorts of things may misidentify those files.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's because if you force-add an ignored file, git will show it to you as changes when you edit that file.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Then why ignore html files in the sandbox? Why not let people try them out as they are, and edit them or add others, but not commit them? Or otherwise move the existing examples into an example directory, with the option to copy them into the sandbox where they'll be ignored. I'm missing something about the intention of the sandbox and the examples, I guess!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Everything inside of sandbox is ignored. The idea is that you can do whatever you want in there and it won't be accidentally checked in. The issue arrises if we have a index.html file inside of sandbox (without the .example), when you make changes to that file, even though git is supposed to ignore sandbox/ because index.html was previously checked in, it'll show up as modified. Then, if people were trying to make a PR, modified sandbox/index.html and committed by running git add -A the change to the sandbox/index.html would get added to the commit.

Maybe, we can move the .example files into something like build/examples and then have a grunt task that copies those files into the sandbox? We can even do it as a post-install (when you're doing npm install on a clone, for example).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess this is fine for now. Better to just have something than nothing.

@gkatsev
Copy link
Member

gkatsev commented Sep 30, 2016

Closed via 7d85f27

@gkatsev gkatsev closed this Sep 30, 2016
@OwenEdwards OwenEdwards deleted the enhancement/grunt-test-accessibility branch March 4, 2017 20:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a11y This item might affect the accessibility of the player
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants