Files
supabase/tests/local-studio-tests/README.md
9d534c9f5a fix: response error codes (#30581)
* fix: response error codes

* upgrade docs

* remove request url modification middleware

* move api routes for self-hosted to platform folder

* remove some lib/common/fetch usage

* docs: use middleware for openapi-fetch (#30600)

Get rid of the unauthedAllowedPost function (I don't think there's any harm in letting any requests that require authentication to just 403, they should be disabled at the React Query level and if not they will fail gracefully enough...)

* fix local count query

* add default values for clone mutation

* fix ts and codegen

* add missing lodash dep to playwright tests

* Fix the playwright tests to match the new folder structure for selfhosted variant.

* remove unused import

* Remove unused state

* remove unused sql debug mutation

* remove unused export

* fix notifications query

* fix jwt updating status

* fix typescript

* save sql snippet after renaming

* update codegen & fix ts error

* override array querySerializer

---------

Co-authored-by: Charis <26616127+charislam@users.noreply.github.com>
Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
Co-authored-by: Ivan Vasilov <vasilov.ivan@gmail.com>
2025-01-20 11:27:38 +08:00

1.7 KiB

Local studio tests

In an effort to make the local 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.