mirror of
https://github.com/Significant-Gravitas/AutoGPT.git
synced 2026-01-09 15:17:59 -05:00
## Changes 🏗️ ### User creation tests Now, all tests use the users created via the platform signup in `global-setup.ts`. Their login details are on a `.auth/user-pool.json` file. I have the delete the logic that created tests users via Supabase directly. ### Build tests speed I have refactored the builder tests, so that, instead of adding 100s of blocks under a given test user session, a new test user logins and adds block for each letter: ``` Test user 1 - logins and adds blocks starting with "a" Test user 2 - logins and adds blocks starting with "b" ``` Given that we know the builder becomes slow once we have 30 or more blocks, in this way a test user never adds more than 10 blocks on a given test ( _without losing coverage_ ), so we don't need time-outs or artificially waiting due to the UI being slow. ### Readability test changes Refactor existing tests, using short-hand utilities, to be: - easier to write - clearer to read - easier to debug ```ts // Selectors getId("id") // --> page.getByTestId("id") getText("foo") // --> page.getByText("id") getButton("Run") // --> page.getByRole("button", {name: "Run"} ... // Assetions const btn = getButton("Save") isVisible(btn) // --> expect(btn).toBeVisible() ``` These utilities live under `selectors.ts` and `assertions.ts`. Their usage is optional but encouraged. ## Checklist 📋 ### For code changes: - [x] I have clearly listed my changes in the PR description - [x] I have made a test plan - [x] I have tested my changes according to the test plan: - [x] Refactored tests code looks good - [x] E2E tests are 🟢 on the CI ### For configuration changes: No config changes