197 Commits
Author SHA1 Message Date
Ali Waseem 4acc0c599c chore: updated queries to use SQL API rather than table clicks (#42561)
## I have read the
[CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md)
file.

YES

## What kind of change does this PR introduce?

Use the API to create tables rather than the SQL editor in the dashboard

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **Tests**
* Refactored end-to-end test database utilities to improve
maintainability and reduce code duplication.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-02-06 15:04:16 +00:00
Charis 76b767c5e1 test(studio): add db utils for checking database state (#42533)
Test utilities

## What is the current behavior?

E2E tests that need to verify database state go through the SQL Editor,
which is unnecessarily slow and prone to future breakage.

## What is the new behavior?

Adds shared db utils for checking database state in Studio E2E tests by
querying the database directly. Refactors API access tests to use the
new utilities.

## Summary by CodeRabbit

* **Tests**
* Refactored API access privilege verification to use direct database
queries instead of SQL editor interaction.
* Added database utility functions for e2e tests to query table
existence and access privileges.
  * Updated test signatures to simplify privilege verification calls.
2026-02-05 17:46:33 -05:00
Joshen LimandAli Waseem 883bfb8ac1 Chore/fix connect sheet and dialog (#42512)
## Context

Connect dialog no longer shows up for local / self-host as we changed it
a bit to do some testing with a new UI

PR here fixes it + add some e2e tests to ensure that either the connect
sheet or dialog opens when clicking on the connect button

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **Bug Fixes**
* Fixed a display issue where the Connect feature was not appearing in
certain application states. The feature now displays properly when
expected.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Ali Waseem <waseema393@gmail.com>
2026-02-05 16:51:15 +00:00
Ali Waseem a185879625 chore: e2e test for table operations (#42475)
## I have read the
[CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md)
file.

YES

## What kind of change does this PR introduce?

E2E for table operations because the logic can be very hard to test
manually

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **Tests**
* Added a comprehensive end-to-end test suite validating queue-based
table workflows: edits, inserts, batch actions, deletions, keyboard
shortcuts, pending-change tracking, save/cancel flows, persistence
across tables, and cleanup.

* **Chores**
  * Updated .gitignore to exclude Playwright MCP artifacts.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-02-05 08:23:28 -07:00
Joshen Lim ea8649b1a1 Validate against empty name in FileExplorerRowEditing.tsx (#42093)
* Validate against empty name in FileExplorerRowEditing.tsx

* Update test

* Fix

* Opt to revert changes if saving empty string

* Nit

* Attempt to write tests with claude

* Trim whitespace in FileExplorerRowEditing when saving
2026-01-26 13:24:29 +08:00
Ali WaseemandJoshen Lim 78e0f19d6a fix: add description of column on header name (#42082)
* fix: add description of column on header name

* Simplify

* Attempt to fix test

---------

Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
2026-01-23 07:23:07 -07:00
Charis d27bb74258 test(studio): add tests for data api toggles (#42051)
* test(studio): add tests for data api toggles
2026-01-22 12:46:54 -05:00
Charis d34cc65e30 fix(studio): handle large cron.job_run_details table gracefully (#41992)
* fix(studio): check job_run_details size in cron display

When cron.job_run_details grows too large (200k+ rows), loading the
cron jobs overview can timeout and affect other queries by pulling
excessive data into shared buffers.

This change:
- Estimates table size using pg_stat before fetching cron jobs data
- Shows a cleanup notice when the table exceeds the threshold
- Provides batched deletion using ctid ranges to avoid buffer pollution
- Allows scheduling an automated daily cleanup cron job
- Handles timeout errors gracefully with a "suspected overflow" state

The useCronJobsData hook now returns a discriminated union status that
tracks loading, estimate-error, overflow-confirmed, overflow-suspected,
and ready states, allowing the UI to respond appropriately to each case.

* fix(studio): use index when querying cron.job_run_details

cron.job_run_details is only indexed by runid, not by start_time. Change
the query to use the runid index (which gives the same result, since
runid is auto-incrementing).
2026-01-22 11:17:49 -05:00
Ivan Vasilov 8bb82bb3a5 chore: Add test for creating and removing foreign keys (#41262)
Add test for creating and removing foreign keys.
2026-01-20 10:17:26 -07:00
Ali Waseem d512338cab fix: settings for storage to not show up on self hosted as they are not supported (#41936)
* fixed settings for storage to not show up

* updated tests and settings for storage bucket
2026-01-19 09:16:49 -07:00
kemal.earth 605de42f49 feat(studio): remove warnings dropdown in favour of index advisor toggle filter (#41873)
* feat: remove warnings dropdown in favour of index advisor toggle fitler

* fix: tests for index advisor
2026-01-14 08:27:08 +00:00
Saxon FletcherandAlaister Young 1bcecb1c42 Table list entity api badge copy (#41547)
* api badge copy

* ts

* test

* API badge policy row (#41548)

api badge policy row

* refine

* fix tiny nits

---------

Co-authored-by: Alaister Young <a@alaisteryoung.com>
2026-01-06 08:04:40 +10:00
Joshen Lim a88c88fa36 Hide RLS disabled CTA in table editor header if no lints (#41517)
* Hide RLS disabled CTA in table editor header if no lints

* Clean

* Update e2e tests

* INvlidate lints when creating tbale

* Revert

* Invalidate lints when duplicating table
2026-01-05 12:14:19 +07:00
Ali Waseem e07a3e2838 feature: login w/ Github for production E2E tests (#41495)
* updated github script for login

* refactored and cleans up github login

* wip

* updated github script

* removed context dir for page access

* updated auth script

* updated the login methods

* updated README

* updated minor bugs

* added error handling
2025-12-19 10:48:27 -07:00
Ali Waseem 61520cb111 fix: remove toast based verification for deleted auth users (#41360)
remove toast based verification for deleted auth users
2025-12-15 13:10:51 -07:00
3fdacb2cca chore(studio): delete Confirm Modal component (#41295)
* docs

* naming

* docs

* mini fix

* update policies component

* use destructured prop

* rls policies dialogs

* custom domain dialogs

* restart server dialog

* remove ConfirmDialog (aka ConfirmModal)

* remove unrelated changes

* delete unrelated file

* language

* Update apps/studio/components/interfaces/Storage/StoragePolicies/StoragePolicies.tsx

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* fixed broken test

---------

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: Ali Waseem <waseema393@gmail.com>
2025-12-12 17:23:24 +08:00
Ali Waseem 5c685cceba Fix flaky auth test (#41287)
fix flaky test
2025-12-12 11:20:45 +08:00
Ali Waseem fef1f043ad chore: added tests for users and minor refactor (#41279)
* added tests for users and minor refactor

* fix helpers

* addressed PR feedback

* remove before await

* missed the await
2025-12-11 13:31:43 -07:00
kemal.earthandAli Waseem aea06d674b e2e(studio): index advisor tests (#41246)
* feat: initial index advisor one shot setup with cursor

* feat: more tests to check against

* fix: few selector and await checks

* fix: no flaky me likey

* fix: no type errors me likely

* chore: remove tests for index advisor banner

---------

Co-authored-by: Ali Waseem <waseema393@gmail.com>
2025-12-11 08:45:31 -07:00
Ali Waseem 913371ca34 fix: remove flakiness with launch options and default timeouts (#41245)
* attempt to make table editor tests less flaky

* updated race conditions for table editor

* updated playwright config with optimized launch options

* reduce workers

* updated timeouts for tests

* updated config to have a global timeout of 20 seconds

* updated to be visible
2025-12-10 13:02:00 -07:00
Ivan Vasilov 581ae07120 fix: Hide favourites and share snippets on self-hosted variant (#41227)
* Hide favorite and share actions for self-hosted version.

* Rename the query on save only on platform.

* Simplify useCheckOpenAiKeyQuery.

* Rename with AI now depends if the OPENAI_API_KEY is set.

* Minor fixes.

* Fix the tests to use .skip for skipping tests. Remove extra port params.

* Make the test for favourites work only on platform variant.
2025-12-10 10:12:15 -07:00
Ivan Vasilov f01deddb49 fix: Fix minor issue in the foreign key selector (#41235)
Change the isPending state to isLoading.
2025-12-10 15:27:58 +00:00
8e705ecdbc fix(export all rows): use cursor pagination if possible (#40536)
Exporting all rows (in CSV, SQL, or JSON format) currently uses offset pagination, which can cause performance problems if the table is large. There is also a correctness problem if the table is being actively updated as the export happens, because the relative row offsets could shift between queries.

Now that composite filters are available in postgres-meta, we can change to using cursor pagination on the primary key (or any non-null unique keys) wherever possible. Where this is not possible, the user will be shown a confirmation dialog explaining the possible performance impact.

---------

Co-authored-by: Ali Waseem <waseema393@gmail.com>
Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
2025-12-08 13:39:10 -05:00
Ali WaseemandCharis 22cfd2be14 feat: Run E2E tests aganist Platform Pt.1 (#41032)
* added packages for creating projects

* updated scripts

* remove ami version

* cleaned up common

* updated tests

* refactored helpers

* updated env

* updated config

* updated to reference env

* updated global setup

* updated type logic and scripts

* added mocking of hcaptcha

* added log statements

* updated local env

* update env file

* updated env vars

* updated logging

* updated to remove check

* updated print and project names

* updated helpers

* updated url

* updated setup

* updated storage helpers to account for listing files

* updated setup and tests

* updated timeout only for setup

* updated helper to account for different api response

* added ignores for tests

* updated lock file

* updated database spec to add exact

* updated timeouts

* removed check for table grid footer

* updated test runner

* updated is_platform

* updated playwright config

* updated worker settings

* removed dotenvx

* updated README

* updated to remove comment

* Update e2e/studio/scripts/common/retriedFetch.ts

Co-authored-by: Charis <26616127+charislam@users.noreply.github.com>

---------

Co-authored-by: Charis <26616127+charislam@users.noreply.github.com>
2025-12-05 10:50:16 -07:00
Ali Waseem 2c2a62ae6c fix: updated api waiting for database tests and add default timeout (#41072)
updated api waiting for database tests and add default timeout
2025-12-04 09:00:14 -07:00
Charis 73c834001c feat(storage): use pagination for storage bucket list (#40695)
The bucket list endpoint now accepts pagination options. Adapting the
storage buckets table UI to paginate in pages of 100 buckets at a time,
with infinite loading/scrolling.
2025-12-03 13:16:40 -05:00
Ali Waseem f863af9e25 chore: added boolean table editor tests (#40954)
added boolean table editor tests
2025-12-01 09:20:03 -07:00
Ali Waseem f5791c36ee fix: copy first row due to failed falsey check (#40909)
* updated because of zero falsey value not copying

* test: add E2E test for copying first and second row values

Adds regression test to verify that users can copy cell values from
the first row (index 0) and second row. This prevents the bug where
falsy index checks would prevent copying from row 0.

Addresses FE-2178
2025-11-30 09:21:58 -03:30
Ali Waseem e23175f00b Feat: E2E tests for AI assistant and log drains (#40844)
* updated commands and expose ai key locally

* added tests for AI assistant

* added OPEN_API_KEY for e2e test suite

* updated log drain options

* updated README
2025-11-27 15:27:50 +00:00
Ali Waseem 2023b2632a Chore: added RLS tests (#40689)
* added RLS tests

* removed index clicking for label and added unrestricted tests

* updated PR feedback
2025-11-21 20:10:47 +00:00
Ali WaseemandIvan Vasilov 3f6f8aa906 Fix: Use storage API for downloading files in the Dashboard (#40592)
* added ability to download files from storage api directly

* updated to rechange size

* updated test methods

* updated test suite

* updated tests

* updated to remove loops

* removed AI slop

* Updated to use single API key in mem

* Fix the memoization of the getOrRefreshTempApiKey function.

* updated imports

* updated imports

* updated to use import meta

---------

Co-authored-by: Ivan Vasilov <vasilov.ivan@gmail.com>
2025-11-19 11:56:04 -07:00
CharisandAli Waseem 044a575552 test: parallelize table editor tests (#40404)
Table editor tests were being run serially because they would otherwise
stomp all over each other in setup. But this made them really slow. This
PR changes them to run in parallel, and makes sure the setup step runs
only once by using a file lock.

Also cleans up miscellaneous other sources of flakiness in tests.

Co-authored-by: Ali Waseem <waseema393@gmail.com>
2025-11-19 07:14:13 -07:00
Ali WaseemandCharis 7898abe06c Fix: Make self hosted tests more reliable locally and in CI (#40479)
* added ui studio command

* added SKIP ASSET UPLOAD option

* updated failing tests

* updated e2e scripts to include CI instructions

* removed unused envs and slack messages

* updated timeouts and max retries on CI

* updated generated local env

* updated env

* updated env generation for e2e tests

* remove vercel preview

* updated tests and trying junit report on PR

* update test comment

* updated commit hash for reporter

* updated file path

* updated runner to blacksmith

* update test file for reporting

* Update .github/workflows/studio-e2e-test.yml

Co-authored-by: Charis <26616127+charislam@users.noreply.github.com>

* Update package.json

Co-authored-by: Charis <26616127+charislam@users.noreply.github.com>

* Update e2e/studio/playwright.config.ts

Co-authored-by: Charis <26616127+charislam@users.noreply.github.com>

* updated to skip comment on forks

---------

Co-authored-by: Charis <26616127+charislam@users.noreply.github.com>
2025-11-17 15:00:31 -07:00
Ali Waseem c76723c909 Fix: Update e2e command to run webserver rather than asking devs to manaully start it (#40398)
* removed e2e scripts that are not being used

* updated tests to use local configs

* updated README test

* updated to only run web server locally
2025-11-14 07:30:45 -07:00
Charis e08d1f7561 test: fix flaky table editor tests (#40323) 2025-11-11 16:05:39 -05:00
Ali Waseem ac6db41662 Fix: Make the FK editor faster when loading tables (#40259)
* updated selector code to be more efficient

* updated styling to show a cleaner table loader

* updated format assignment

* disable selector when loading

* updated request to fetch tables

* updated key rendering
2025-11-10 14:59:43 -05:00
Jordi Enric a9482faed0 fix e2e test: switch schema (#40122)
* fix

* remove unnecessary step
2025-11-04 13:33:50 +01:00
Jordi Enric 4c151ec01d e2e fixes (#39845)
* only require approval on forks

* update readme

* update example

* update readme
2025-10-24 16:24:55 +02:00
Jordi Enric 25abebc32e a new hope (#38893)
* a new hope

* run tests in ci against cli mode

* summary

* try vercel action to run e2e against studio self hosted preview

* believe

* debug

* gh pages artifact

* test

* rm pages step

* fix automation bypass missing

* continue on error

* only install necessary deps for CI

* fix bypass

* remove

* fail job if test fails

* disable customer query if is_platform false

* vercel check

* fix var name, make comment update instead

* check bypass on runtime

* add env var

* fix tests going to project ref instead of default

* fix

* better dates in comment

* Update E2E test workflow to include flaky test detection and improve summary output

* fix

* fix dumb mistake
2025-09-23 12:02:23 +02:00
Michael Ong 312e9fdb34 chore: add additional playwright tests for table editor (#37972) 2025-08-22 10:15:07 +02:00
Michael Ong ab2b33ba09 chore: add additional sql editor playwright test (#37768) 2025-08-07 19:46:22 +02:00
Michael Ong 30afd85f6d chore: minor fix to reduce flakiness of database playwright tests (#37709) 2025-08-07 18:58:49 +02:00
Michael Ong 61dedfa76f Chore/add e2e test for database (#37452)
* chore: add tests for database

* chore: add final tests and some refactoring

* chore: update playwright config
2025-08-05 12:33:32 +02:00
Michael OngandJordi Enric 7b91d64b7e chore: add final e2e tests for table-editor and sql-editor (#36917)
* chore: add final e2e tests for table-editor and sql-editor

* chore: update tests to run in staging

* chore: minor updates

* chore: fix PR feedback

---------

Co-authored-by: Jordi Enric <37541088+jordienr@users.noreply.github.com>
2025-07-19 10:58:25 +00:00
Michael OngandTerry Sutton a259c0b9dc chore: add e2e test for sql editor snippets (#36293)
* chore: add e2e test for sql editor snippets

* trigger build

* chore: fix failing test and add rls

---------

Co-authored-by: Terry Sutton <saltcod@gmail.com>
2025-07-01 14:16:54 +02:00
Joshen Lim 327cab053a Clean up tabs interface feature flags (#36441)
* Clean up tabs interface feature flags

* Update SQL e2e test
2025-06-23 11:16:24 +08:00
55c3fdb49a E2E Testing Setup Consolidation (#35080)
* add new e2e folder

* add local supabase and confitional storage

* fix e2e selfhosted

* update actions

* add correct e2e folder

* fix e2e actions

* fix action project ids

* fix permissions

* fix script

* fix playwright install

* playwright root

* pnpm i

* fix api rul

* add env docs

* update run script

* only install deps for e2e

* use same dep

* only install deps for tests

* upd lockfile

* use official vercel integration

* use vercel cli

* remove old folder

* fix script

* rm filter

* rename e2e studio package

* fix install browsers

* add polling for vercel build

* use vercel-preview-url package

* undo actions

* rename ci env to ci

* chore:add rls check and make playwright test less flakey (#35348)

* update ci action

* fix paths

* fix browser install

* run ci against staging

* try caching builds

* fix envs

* fix env check

* fix sign in

* fix sign in url

* fix envs and url

* fix caching

* fix race condition in sign in page

* fix race condition in sign in page

* add check to see if being redirected

* fix caching, check IS_PLATFORM var

* log is_platform

* try vercel build

* fix vercel project id

* fix path

* add temp vercel.json file

* fix paths

* undo project id stuff

* rm cwd

* fix path

* fix paths again

* fix path

* fix base url

* try different fix

* fix config base url

* fix base studio url issues

* retain video on fails

* Update e2e/studio/README.md

Co-authored-by: Copple <10214025+kiwicopple@users.noreply.github.com>

* Update e2e/studio/README.md

Co-authored-by: Copple <10214025+kiwicopple@users.noreply.github.com>

* fix env file naming

* undo caching

* rm old tests folder

* fix readme scripts

* rm vercel deploy for now, just run build locally

* fix url

* fix build script

* fix is_platform

* fix stuck studio start

* fix env vars

* retain network and logs on fail for better debugging

* add apiurl env

* back to vercel

* disable catpcha

* fix test

* update environment configuration to remove default URLs for CI and streamline API base URL handling

* fix typeerr

* fix urls in home.spec

* fix urls in logs.spec

* fix urls in sqleditor spec

* fix table editor spec

* add tourl util

* use staging api in ci

* re add base url env var

* fix url in projects page

* fix url in sql editor spec

* fix sign in not waiting for cookies omfg

* fix env var name

* fix sql-editor test

* simplify table removal

* add opt out telemetry step

* fix logs tests

* fix table editor spec

* remove flaky steps from table editor tests

* use vercel deployment events instead of build

* add studio check

* fix condition

* debug event

* rm if

* trigger deploy

* undo ac

* make opt out button step optional, some envs dont hav eit

* use testid for sql run button

* use id instaed of timestamp in logs tests

* empty

* rm retries

* up glbal timeout

* chore: fix failing sql-editor playwright test (#35767)

* chore: fix failing sql-editor playwright test

* chore: minor fixes

* Chore/update playwright config (#35826)

chore: update playwright config

* rm supabase project from e2e tests

* refactor and simplify environments

* fix sql editor test

* fix ci env vars

* fix

* fix on windows

* update readme

* add playwright install script to readme

* rm turbopack trace flag

* npm to pnpm for scripts

* delete ivan lines

---------

Co-authored-by: Michael Ong <minghao_3728@hotmail.com>
Co-authored-by: Copple <10214025+kiwicopple@users.noreply.github.com>
2025-06-03 17:37:39 +02:00