.cookies.delete() Suggest edits
Delete the cookie with the given name. This command is a no-op if there is no such cookie visible to the current page.
Usage
.cookies.delete(cookieName, [callback])
Example
module.exports = {
'delete a cookie': function (browser) {
browser
.cookies.delete('test_cookie', function () {
console.log('cookie deleted successfully');
});
},
'delete a cookie with ES6 async/await': async function (browser) {
await browser.cookies.delete('test_cookie');
}
};
Parameters
Name | Type | description |
---|---|---|
cookieName |
string | The name of the cookie to delete. |
callback Optional |
function | Optional callback function to be called when the command finishes. |