paypal / AATT

Automated Accessibility Testing Tool
BSD 3-Clause "New" or "Revised" License
602 stars 106 forks source link

Error: spawn ENAMETOOLONG when evaluating long documents via 'Test HTML' tab #20

Closed usabilitykitty closed 7 years ago

usabilitykitty commented 7 years ago

I had originally posted about this issue over on the nemo-accessibility issue list, but as @nikulkarni pointed out on that thread, it actually seems to be an AATT issue, so I am reposting over here.

My team would like to use AATT to automate our accessibility testing. I am trying to evaluate some markup using the 'Test HTML' tab on AATT. From what I understand, nemo-accessibility sends the source code to the API this way (according to @mpnkhan on https://github.com/paypal/nemo-accessibility/issues/13#issuecomment-287695048), so I'll need to resolve this issue before I can move on to using nemo-accessibility to automate the testing. I've pulled down the latest (which seemed to include an upgrade to HTMLCS), but I'm unfortunately still having issues.

If I copy the source of a short page such as https://github.com/about and paste it in the Test HTML tab, it works fine with all of the engines (Axe, Chrome, HTML Code Sniffer). If I try to test source code from a slightly longer page such as https://github.com/features it returns the following error:

Error: spawn ENAMETOOLONG
    at exports._errnoException (util.js:1026:11)
    at ChildProcess.spawn (internal/child_process.js:313:11)
    at exports.spawn (child_process.js:380:9)
    at Object.exports.execFile (child_process.js:143:15)
    at C:\Users\mswithen\Documents\AATT\app.js:149:17
    at Layer.handle [as handle_request] (C:\Users\mswithen\Documents\AATT\node_m
odules\express\lib\router\layer.js:82:5)
    at next (C:\Users\mswithen\Documents\AATT\node_modules\express\lib\router\ro
ute.js:100:13)
    at Route.dispatch (C:\Users\mswithen\Documents\AATT\node_modules\express\lib
\router\route.js:81:3)
    at Layer.handle [as handle_request] (C:\Users\mswithen\Documents\AATT\node_m
odules\express\lib\router\layer.js:82:5)
    at C:\Users\mswithen\Documents\AATT\node_modules\express\lib\router\index.js
:233:24

This error displays with long pages for all engines I have tried on the 'Test HTML' tab -- Axe, Chrome, and HTML Code Sniffer. On the 'Page URL' tab, using the HTML Code Sniffer, longer pages process fine (however, Axe and Chrome return "undefined" with the same page on the 'Page URL' tab).

I would greatly appreciate your assistance. Thank you.

mpnkhan commented 7 years ago

Could you pull the latest? Chrome engine with the recent upgrade breaks. Others should work fine.

Also have added a shorter version which doesn't use PhantomJS for quick testing localhost/test/ should be good for quick testing.

JordanKnott commented 7 years ago

I'm having this issue as well. I'm running the latest master version (SHA: 36c7f90).

RangerDanger94 commented 7 years ago

I am experiencing the same issue as @mswithenbank with the latest package as of this date. I am running the AATT application and using the examples from the nemo-accessibility repo for testing (also the latest version). With the given paypal url http://www.paypal.com/ I get successful output through the application when using the 'Page URL' method. I get no results and a 500 (Internal Server Error) response when I instead copy the html source from http://www.paypal.com/ and use the 'Test HTML' method. This result is identical accross Axe, Chrome & Htmlcs.

I also tried it using the nemo-accessibility example. My code for that is as follows:

var Nemo = require('nemo');
var fs = require('fs');
var nemo =  Nemo(process.cwd()+'/example',function(err){
  if(!err) {
    nemo.driver.get('http://www.paypal.com/');
    console.log('Nemo initialized successfully');
    var options = {
      'engine': 'htmlcs',
      'output': 'html',
      'level': 'WCAG2AA'
    };

    nemo.accessibility.scan(options).then(function (result) {
      var file = process.cwd() + '/example/report/phantom.json';
      fs.writeFile(file, result, function (err) {
        if (err) {
          throw err;
        }
        console.log('Successfully wrote the file ' + file);
      });
    });
    nemo.driver.quit();
  } else {
    console.log(err);
  }
});

Both approaches produce the same ENAMETOOLONG exception. image

If I change the link to a smaller page, like this thread for example then it works fine.

Would appreciate any assistance on the matter. Thanks :)

mpnkhan commented 7 years ago

Could you pull in the latest and check if this works?

RangerDanger94 commented 7 years ago

Thank you for the quick response.

Just pulled the latest and ran the same set of tests again. The 'test html' functionality now works as expected and returns a result using all three engines.

When using it with the nemo-accessibility library however I get the same error as before.

usabilitykitty commented 7 years ago

Thank you for the updates. I pulled the latest and am also experiencing the same as @RangerDanger94. The Test HTML tab is now working with Axe, Chrome, and HTML Code Sniffer, but when running nemo-accessibility with paypal.com's index page, I get a 500 response code and ENAMETOOLONG, just as before (whereas short pages return results successfully).

Do we need to post a separate issue on the nemo-accessibility repository now that the Test HTML tab is working correctly in AATT?

mpnkhan commented 7 years ago

Fixed that part too. nemo-accessibility should work now.