![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
taiko-storage
Advanced tools
A taiko plugin to interact with browser storages (local and session)
A taiko plugin to interact with browser storages (localStorage and sessionStorage).
npm install taiko-storage --save
const { openBrowser, closeBrowser, click, storage: { localStorage, sessionStorage} } = require('taiko');
/*
OR
const { openBrowser, closeBrowser, click, storage } = require('taiko');
const {localStorage, sessionStorage} = storage;
*/
(async () => {
try {
await openBrowser();
await localStorage.setItem("Key", "Value");
let value = await localStorage.getItem("Key");
// more actions
// ...
} finally {
await closeBrowser();
}
})();
The plugin exposes two variables localStorage
and sessionStorage
which represents to the respective storages.
The APIs for both the storage are same and try to very close the the native storage apis.
setItem(key, value)
set the given key value to storage
await localStorage.setItem(key, value);
// or
await sessionStorage.setItem(key, value);
getItem(key)
featch the value for given key from storage
await localStorage.getItem(key);
// or
await sessionStorage.getItem(key);
hasItem(key)
validate if the given key exists in storage.
await localStorage.hasItem(key);
// or
await sessionStorage.hasItem(key);
removeItem(key)
remove the item with given key from the storage.
await localStorage.removeItem(key);
// or
await sessionStorage.removeItem(key);
clear()
clear the stoarage
await localStorage.clear();
// or
await sessionStorage.clear();
length()
tell the no of items in storage.
await localStorage.length();
// or
await sessionStorage.length();
options
which will be passed to taiko's evaluate
API (used internally in storage APIs)Example:
await localStorage.setItem(key, value, { waitForNavigation: false });
To launch the REPL type taiko --plugin taiko-storage
in your favorite terminal application. This will launch the Taiko Prompt.
e.g
Version: 0.7.0 (Chromium:74.0.3723.0) Type .api for help and .exit to quit
You should now have full access to localStorage and sessionStorage apis in the taiko REPL window
FAQs
A taiko plugin to interact with browser storages (local and session)
The npm package taiko-storage receives a total of 774 weekly downloads. As such, taiko-storage popularity was classified as not popular.
We found that taiko-storage demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.