addyosmani/a11y

Not working for me on static local files.

constellates opened this issue · 6 comments

I'm trying to use a11y to audit a bunch of static source captures that were generated by using protractor (selenium) to crawl an AngularJs app and save the page source to file at various points. If I run "a11y google.com" I get an audit report back. However, if I try "a11y ./path/to/my/file.html" I get this error

Command failed: /usr/local/lib/node_modules/a11y/node_modules/phantomjs/lib/phantom/bin/phantomjs /usr/local/lib/node_modules/a11y/audits.js {"delay":1,"url":"file:///full/path/to/my/file.html","width":1024,"height":768} --ignore-ssl-errors=true --ssl-protocol=tlsv1 --local-to-remote-url-access=true
Audit failed

I've tried installing phantomjs multiple ways and I'm already successfully using phantomjs for unit testing without issue. I'm running node v0.12.0. Any idea what's going on?

Something in the audits.js script fails with your HTML. Can you share a minimal testcase HTML file that fails?

I'm having trouble narrowing this down to something specific but here are a few minimal cases. The following markup throws the error mentioned above.

<!DOCTYPE html>
<html>
<head></head>
<body tabindex="0">

    <img src="http://placekitten.com/g/200/300">

</body>
</html>

However, both of the following examples work (either removing the tabindex or the image tag).

<!DOCTYPE html>
<html>
<head></head>
<body tabindex="0">

</body>
</html>

<!DOCTYPE html>
<html>
<head></head>
<body>

    <img src="http://placekitten.com/g/200/300">

</body>
</html>

Could you verify if this is still an issue with 0.3.3? If so, I'll set some time aside to continue digging into what's causing the error. I'll also look at whether there's something upstream in ADT that may be causing this.

It may be a day or two but I will re-test with 0.3.3 and get back to you with the results.

Yes I'm still seeing the same issue. I did a fresh global install with npm and verified in the package.json that it is 0.3.3. I recreated the above minimal html files and the same thing is happening. I did also test on a couple different versions of node and got different error logs.

On node 0.12.7 I see the original messages

Command failed: /usr/local/lib/node_modules/a11y/node_modules/phantomjs/lib/phantom/bin/phantomjs /usr/local/lib/node_modules/a11y/audits.js {"delay":1,"url":"file:///Users/zacharymichael/Desktop/test.html","width":1024,"height":768} --ignore-ssl-errors=true --ssl-protocol=tlsv1 --local-to-remote-url-access=true
Audit failed

and on node 0.10.3 I only get

Command failed: Audit failed

I get this error when I try to audit a template fragment with a .ms extension. If I rename the fragment to .html the error goes away and it works.

In short, I'll have a file called test.ms containing only <p>ohai</p> and if I run that past the a11y CLI I get the above error. If I then rename that file to test.html it works.

This is on Windows 7 Enterprise so it could very well not be related to a11y at all.

v0.3.3