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.
Before running the tests, make sure you've done the following:
- Run
npm install
in the root folder of this repo docker
ororbstack
is currently runningsupabase
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:
- Setting up the local environment using the
supabase
CLI - Extracting the environment variables and saving them into a
.env.test
file in the studio app - Running the
studio
app in dev mode (npm run dev
) - Running the tests
- 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.
Playwright has a nice Codegen tool which you can use to record your actions:
npm run codegen:setup
# in a separate terminal
npm run codegen
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:
npm run test -- --ui
It will also record any failing tests when running npm run test
in this folder.