mirror of
https://github.com/enso-org/enso.git
synced 2024-12-21 03:12:01 +03:00
dc5fb1554a
- One of many PRs that should improve Dashboard performance. - `useMutationState` seems to be taking quite a bit of time (224ms out of 1199ms) in this trace on Firefox: - However, I haven't really noticed any real difference, although I haven't tried too hard to find a differene - That said, this also vastly simplifies the code in `backendHooks.ts` (by removing the vast majority of the methods) - As a downside, well, we will no longer have optimistic updates - but I guess we are preferring a stale-while-revalidate approach anyway (React Query) when it doesn't degrade UX ![image](https://github.com/user-attachments/assets/61899313-7aaf-4158-b382-0a293a97bb71) ![image](https://github.com/user-attachments/assets/f025dd7d-7755-4000-81cd-f57efce4c4bc) # Important Notes None |
||
---|---|---|
.. | ||
actions | ||
actions.ts | ||
api.ts | ||
assetPanel.spec.ts | ||
assetSearchBar.spec.ts | ||
assetsTableFeatures.spec.ts | ||
authPreserveEmail.spec.ts | ||
copy.spec.ts | ||
createAsset.spec.ts | ||
dataLinkEditor.spec.ts | ||
delete.spec.ts | ||
driveView.spec.ts | ||
editAssetName.spec.ts | ||
labels.spec.ts | ||
labelsPanel.spec.ts | ||
latestGithubReleases.json | ||
loginLogout.spec.ts | ||
loginScreen.spec.ts | ||
membersSettings.spec.ts | ||
organizationSettings.spec.ts | ||
pageSwitcher.spec.ts | ||
README.md | ||
signUp.spec.ts | ||
sort.spec.ts | ||
startModal.spec.ts | ||
userMenu.spec.ts | ||
userSettings.spec.ts |
End-to-end tests
Running tests
Execute all commands from the parent directory.
# Run tests normally
pnpm run test:e2e
# Open UI to run tests
pnpm run test:e2e:debug
# Run tests in a specific file only
pnpm run test:e2e -- e2e/file-name-here.spec.ts
pnpm run test:e2e:debug -- e2e/file-name-here.spec.ts
# Compile the entire app before running the tests.
# DOES NOT hot reload the tests.
# Prefer not using this when you are trying to fix a test;
# prefer using this when you just want to know which tests are failing (if any).
PROD=1 pnpm run test:e2e
PROD=1 pnpm run test:e2e:debug
PROD=1 pnpm run test:e2e -- e2e/file-name-here.spec.ts
PROD=1 pnpm run test:e2e:debug -- e2e/file-name-here.spec.ts
Getting started
test.test('test name here', ({ page }) =>
actions.mockAllAndLogin({ page }).then(
// ONLY chain methods from `pageActions`.
// Using methods not in `pageActions` is UNDEFINED BEHAVIOR.
// If it is absolutely necessary though, please remember to `await` the method chain.
// Note that the `async`/`await` pair is REQUIRED, as `Actions` subclasses are `PromiseLike`s,
// not `Promise`s, which causes Playwright to output a type error.
async ({ pageActions }) => await pageActions.goTo.drive(),
),
)
Perform arbitrary actions (e.g. actions on the API)
test.test('test name here', ({ page }) =>
actions.mockAllAndLogin({ page }).then(
async ({ pageActions, api }) =>
await pageActions.do(() => {
api.foo()
api.bar()
test.expect(api.baz()?.quux).toEqual('bar')
}),
),
)