Retrieve all cookies visible to the current page.

The cookies are returned as an array of cookie JSON object, with properties as defined here.

Usage

                    .cookies.getAll([callback])
                

Example

module.exports = {
  'get all cookies': function (browser) {
    browser
      .cookies.getAll(function (result) {
        this.assert.equal(result.value.length, 1);
        this.assert.equal(result.value[0].name, 'test_cookie');
      });
  },

  'get all cookies with ES6 async/await': async function (browser) {
    const cookies = await browser.cookies.getAll();
    browser.assert.equal(cookies.length, 1);
    browser.assert.equal(cookies[0].name, 'test_cookie');
  }
};

Parameters

Name Type description
callback
Optional
function

Callback function which will receive the response as an argument.

Returns

Type description
Array.<object>

A list of cookie JSON objects, with properties as defined here.

See also