Closed amiya-pattnaik closed 3 years ago
AATT will serve a API within your environment to evaluate. You need to use the API end point "https://your_nodejs_accessibility_server/evaluate" .
Example with webdrver.io
//scan
function scan(source) {
if (browser.sessionId){
console.log('S O U R C E', source);
var body = {
'source': '<input>', //set the source html here
'engine' : 'axe',
'output': 'json'
},
options = {
'headers': {
'Content-Type': 'application/json'
},
'url': 'http://localhost:3000/evaluate',
'method': 'POST',
'body': body,
'json': true,
'rejectUnauthorized': false
};
return new Promise(function(resolve, reject) {
let retStr ='';
request(options, function (err, response, responseBody) {
if (err) {
reject(err);
}
if (err || response.statusCode !== 200) {
reject('Error is ' + err + ' Response code is ' + (response && response.statusCode));
}
else{
// retStr = processResultsAxe(responseBody);
retStr = responseBody;
resolve(retStr);
}
});
}) //Promise
}
else{
reject('Session Id was not defined');
}
}
Yes you need to navigate.
Thanks Nawaz for the updates. Just help me with below silly question.
API endpoint "https://your_nodejs_accessibility_server/evaluate" . What does it mean? Do you mean that the actual endpoint of my application? for example, if I am testing the login functionality of my application then should I give the login endpoint URL here?
'url': 'http://localhost:3000/evaluate' in Options. What id does and what is its significance?
in the function scan(source) , what should be the source
? will it the page URL?
Wher can I navigate to a different page ? for example, in my webdriver.io with mocha spec, I have test cases in it() block where I navigate to the page using selenium. in that case, how can I use AATT?
Please advise. Thanks in advance. Amiya
Thanks, Nawaz for the updates. Its now clear to me. I have to start the express server locally in one instance and in another instance I have start my automation test. Now tests are running and I could see that How can I see the rules violations in the console (DEBUG=AATT* http_port=3000 node app.js).
I need your advice on how can I get the results in an .html file or the snapshot of the page with highlighted fields etc Please advise. I appreciate your help. Thanks
Hi Team, I saw this tool and I am impressed on this. Just few questions
Thanks in advance.