Skip to content

Latest commit

 

History

History
96 lines (62 loc) · 2.76 KB

README.md

File metadata and controls

96 lines (62 loc) · 2.76 KB

Clearance UI

An interface for assigning and managing clearances.

Environment Variables

Name (Required *) Description Example
VITE_GOOGLE_IDENTITY_CLIENT_ID* This ID is required to identify the application with Google Identity Services. token.apps.googleusercontent.com
VITE_AUTH_SERVICE_URL* The URL for the Auth Service API. https://auth.services.edu
VITE_CLEARANCE_SERVICE_URL* The URL for the Clearance Service API. https://clearance.services.edu
E2E_REFRESH_TOKEN A refresh token for use by the E2E tests. Required only for E2E tests. somerandomtoken

Other Requirements

The application must be served on a URL registered with Google Identity Services. For example, if it should be accessed on localhost:3000, then that full URL should be registered with Google in the Cloud Console -> API's & Services -> Credentials as an authorized JavaScript origin.

Running on your Local Machine

  1. Install dependencies.
npm install
  1. Run the app.
npm run dev

Running in Production

  1. Install dependencies.
npm install

  1. Build the production application.
npm run build
  1. Run the production application.
npm run serve

Running with Docker

The Dockerfile builds a production image. That image is not meant to be used for development.

  1. Build the image.
docker build -t clearance-ui .
  1. Run the image.
docker run -p 3000:3000 --env-file .env clearance-ui

Running E2E Tests

End-to-End tests must be ran with all environment variables present, with the exception of the Google Client ID.

Using VSCode

  • Required: Install the Playwright VSCode extension.
  • Required: E2E_REFRESH_TOKEN is a required env var for authentication in the E2E tests.
    • Either set it in your .env file or in your VSCode settings.

Click the Beaker icon on the sidebar in VSCode to view all of the tests. You can set breakpoints, toggle the browser, or run individual tests with 1 click. It's pretty cool.

image

Manually

E2E_REFRESH_TOKEN=<ask_for_e2e_jwt> npm run e2e
# npm run e2e:report # gives a nice HTML report
# npm run e2e ./path/to/test.spec.ts # run a specific test

You can run the tests in debug mode to see the browser window:

PWDEBUG=console npx playwright test