How to get cookies from a Browser Test in NightwatchJS?

How to get cookies from a Browser Test in NightwatchJS?

Hi Dipen,

Add the below code to get cookies from a Browser Test in NightwatchJS:

this.demoTest = function(browser) {
  browser.getCookie(name, function callback(result) {
    this.assert.equal(result.value, '123456');
    this.assert.equals(result.name, 'test_cookie');
  });
}

Ref: getCookie | API Reference | Nightwatch.js