diff --git a/runtime/helpers.js b/runtime/helpers.js index dd83cae..127ef94 100755 --- a/runtime/helpers.js +++ b/runtime/helpers.js @@ -335,6 +335,18 @@ module.exports = { return driver.executeScript(getAfterContentValue, cssSelector); }, + /** + * Get local storage + * @returns {Promise} executes .then with value + * @example + * helpers.getLocalStorage().then(function(localStorage) { + * console.log(localStorage['token']); + * }); + */ + getLocalStorage: function() { + return driver.executeScript(`return window.localStorage`); + }, + clearCookies: function() { return driver.manage().deleteAllCookies(); },