Files
supabase/tests/studio-tests
Jordi EnricandJoshen Lim 8a340ae610 FE-1338: New UI for LogsDatePickers (FE-1512) (#33164)
* add more date range options to log previewer

* new ui for logs datepickers

* update logsquerypanel

* update previewfilterpanel

* fix some bugs and add copypasting date range support

* handle updating times in copypaste events

* add handlepaste to timesplitinput

* update warehouse datepicker

* update reports datepicker

* rm consolelog

* update logsquerypanel

* update tests

* fix reportsfilterbar

* update api-overview report

* rm consolelogs

* update storage report

* add large range wraning

* update large range max const

* fix default values and label

* fix tests

* add default value to logs previewer

* disable helpers fix

* rm last 7 days helper

* add test for disabled helpers

* add label test

* add helper label test

* reset state when closing without saving

* undo rm

* fm datefns, fix test class

* fix year format

* rm disabled from label

* fix type err in test

* fix test

* fix tests

* max 2 days for warning

* fix refresh not using latest timestamp end

* refactor log explorer to use new logs datepicker state hook

* Remove round to hour/day in helpers

* Use now instead of end of day for datepicker TO

* fix types

* update global timeout for e2e tests

* update test with new default

* fix test

* analytics container taking too long to return data so adding more timeout

* force ci

* fix first render issues

* Smol refactor

* Do not reset timestamp end when refreshing in LogsPreviewer

---------

Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
2025-04-18 14:28:47 +08:00
..
2025-02-20 12:02:41 +08:00
2025-02-20 12:02:41 +08:00
2025-02-20 12:02:41 +08:00

Studio E2E Tests

In an effort to make the local + hosted studio more stable, we've added tests which test features which are commonly used in local development. Built with Playwright.

How to run tests

Before running the tests, make sure you've done the following:

  • Run npm install in the root folder of this repo
  • docker or orbstack is currently running
  • supabase CLI is already installed
  • no other supabase local environment is running (infrastructure environment is ok)

You can run the tests by running npm run test in this folder.

When you run the command, it includes:

  1. Setting up the local environment using the supabase CLI
  2. Extracting the environment variables and saving them into a .env.test file in the studio app
  3. Running the studio app in dev mode (npm run dev)
  4. Running the tests
  5. Stopping the studio app and the local environment

If the environment does't stop for some reason, you'll see supabase start is already running on the next run. In this case, just run supabase stop between test runs.

How to write tests

Playwright has a nice Codegen tool which you can use to record your actions:

pnpm codegen:setup
# in a separate terminal
pnpm codegen

How to debug/fix tests

If you've run the tests locally and you want to see the results, Playwright has a UI mode which you can use to run and replay specific tests:

pnpm test -- --ui

It will also record any failing tests when running npm run test in this folder.