fix(e2e): add support for setting localStorage before navigating to the page due to new Nav behavior (#579)

This commit is contained in:
Danny Avila 2023-07-03 16:37:23 -04:00 committed by GitHub
parent 8e1473c3d8
commit 10c772c9f2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -19,6 +19,11 @@ async function authenticate(config: FullConfig, user: User) {
await login(page, user);
await page.locator('h1:has-text("LibreChat")').waitFor();
console.log('🤖: ✔️ user successfully authenticated');
// Set localStorage before navigating to the page
await page.context().addInitScript(() => {
localStorage.setItem('navVisible', 'true');
});
console.log('🤖: ✔️ localStorage: set Nav as Visible', storageState);
await page.context().storageState({path: storageState as string});
console.log('🤖: ✔️ authentication state successfully saved in', storageState);
await browser.close();