Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

setLocalStorageItem(key, value) Example #20

Open
cpeople2 opened this issue Nov 8, 2018 · 3 comments
Open

setLocalStorageItem(key, value) Example #20

cpeople2 opened this issue Nov 8, 2018 · 3 comments

Comments

@cpeople2
Copy link

cpeople2 commented Nov 8, 2018

Hello, can you please provide an example of how and where to setLocalStorageItem(key, value) within the code? I am unable to setLocalStorage with my token and have tried many different ways to no avail. Your response is very much appreciated. Thanks!

@rquellh
Copy link
Owner

rquellh commented Nov 8, 2018

I'm not that familiar with this function. A quick google search came up with this: DevExpress/testcafe#1325 . Hopefully this helps.

@vvedachalam
Copy link
Contributor

@cpeople2 Did u manage to get it work?

@maxharding4
Copy link

@cpeople2 Here is an example I have used.

Given(/^I set a key as true in localStorage$/, async () => {
  let setKey = ClientFunction(() => localStorage.setItem('localStorageKey', 'true')).with({ boundTestRun: testController });
  await setKey();
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants