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

Setup tests with new user system #344

Merged
merged 2 commits into from
May 20, 2023
Merged

Setup tests with new user system #344

merged 2 commits into from
May 20, 2023

Conversation

danny-avila
Copy link
Owner

@danny-avila danny-avila commented May 20, 2023

To start writing frontend tests:

  1. Run npx install playwright from the root directory
  2. Start the App and make sure it is accessible via the default Url: http://localhost:3080/
  3. Run npm run e2e:auth from the root directory
    • This will open a browser for you to save an authenticated state
    • Signup with a new account, for testing purposes (social logins will not work for testing)
    • Login, then Close the browser
    • You will now have the authenticated state saved in e2e/auth.json
  4. Confirm tests run by running npm run e2e
  5. Begin writing tests. Use the tests in e2e/specs as reference

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
…ntext 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
@danny-avila danny-avila merged commit 5964b71 into main May 20, 2023
@danny-avila danny-avila deleted the setup-tests branch May 20, 2023 13:00
danorlando pushed a commit to danorlando/librechat that referenced this pull request Jun 1, 2023
* 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
cnkang pushed a commit to cnkang/LibreChat that referenced this pull request Feb 6, 2024
* 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
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

Successfully merging this pull request may close these issues.

1 participant