I tried using Persistent context approach from playwright website but its not working From the multi-factor-authentication docs
const { chromium } = require('playwright');
const userDataDir = '/path/to/directory';
const context = await chromium.launchPersistentContext(userDataDir
, { headless: false });
// Execute login steps manually in the browser window
I used this code
describe("Learn Playwright", () => {
test('basic test', async () => {
const browser = await chromium.launch(
{ args: ['--disable-web-security',]
,headless: false
});
const userDataDir = 'user/data/dir';
const context = await chromium.launchPersistentContext(userDataDir
, { headless: false });
// Create a new page inside context.
const page = await context.newPage();
context.close
})
});
but the file is not getting updated inside dir directory. If anyone can elaborate what is wrong here? It will be really helpful.