dequelabs / axe-webdriverjs

Provides a chainable axe API for Selenium's WebDriverJS and automatically injects into all frames.
Mozilla Public License 2.0
130 stars 46 forks source link

axe-webdriverjs deprecated #146

Open mgifford opened 4 years ago

mgifford commented 4 years ago

I was trying to run axe-reports & got this error: axe-webdriverjs deprecated Error must be handled as the first argument of axe.analyze.

Am I doing something wrong, is this a node issue or what?

Thanks!

straker commented 4 years ago

I believe you need to pass error and results to the callback function of axeBuilder.analyze:

AxeBuilder(driver).analyze(function(err, results) {
  if (err) {
    // Handle error somehow
  }
  console.log(results);
});

Seems the old code may have allowed just results.

manoj9788 commented 4 years ago

As @straker mentioned, you just need to add the error part to the callback function of Analyze

stephenmathieson commented 4 years ago

Just a heads up - we're removing support for the deprecated callback signature soon.


This will no longer work:

AxeBuilder(driver).analyze(function(results) {
  // ...
})

Instead, you must handle the error:

AxeBuilder(driver).analyze(function(err, results) {
  // ...
})