Browse Source

feat(testing): Local storage is maintained after page reload

pull/3848/head
Muhammed Mustafa 2 years ago
parent
commit
5845745fd5
  1. 7
      scripts/playwright/setup/index.ts

7
scripts/playwright/setup/index.ts

@ -24,7 +24,14 @@ const setup = async ({page}: {page: Page}): Promise<NcContext> => {
await page.addInitScript(async ({token}) => {
try {
let initialLocalStorage = {};
try {
initialLocalStorage = JSON.parse(localStorage.getItem('nocodb-gui-v2') || '{}');
} catch(e) {
console.error('Failed to parse local storage', e);
}
window.localStorage.setItem('nocodb-gui-v2', JSON.stringify({
...initialLocalStorage,
token: token,
}));
} catch (e) {

Loading…
Cancel
Save