How to get attribute value of an element in JS-Nightwatch?

How can I get attribute value of an element in JS-Nightwatch?

Hello Russell,

You can use the below code to get attribute value of an element in JS-Nightwatch:

this.demoTest = function (client) {
  client.getAttribute("#main ul li a.first", "href", function(result) {
    this.assert.equal(typeof result, "object");
    this.assert.equal(result.status, 0);
    this.assert.equal(result.value, "#home");
  });
};

Reference: getAttribute | API Reference | Nightwatch.js