LibreChat/e2e/specs/landing.spec.js
Danny Avila 5964b71e14
Setup tests with new user system (#344)
* chore(.gitignore): add auth.json to gitignore
test(landing.spec.js): remove commented out code and add check for landing page title
test(login.spec.js): add test for login page title
feat(package.json): add e2e:auth script to generate auth.json storage file for e2e tests

* test(landing.spec.js): add beforeEach hook to create a new browser context with auth.json storage state
test(landing.spec.js): change test name from 'landing page' to 'Landing title'
fix(package.json): change e2e:auth script to save auth.json in e2e directory
2023-05-20 09:00:45 -04:00

18 lines
496 B
JavaScript

import { expect, test } from '@playwright/test';
test.describe('Landing suite', () => {
let myBrowser;
test.beforeEach(async ({ browser }) => {
myBrowser = await browser.newContext({
storageState: 'e2e/auth.json',
});
});
test('Landing title', async () => {
const page = await myBrowser.newPage();
await page.goto('http://localhost:3080/');
const pageTitle = await page.textContent('#landing-title')
expect(pageTitle.length).toBeGreaterThan(0);
});
});