enso/app/dashboard/e2e
somebody1234 5bc873178a
Fixes (including downloading Local projects from nested directories) (#10585)
- Address part of https://github.com/enso-org/cloud-v2/issues/1350
- Turns out the reason downloads were broken were (I assume) the query string was getting lost - so the Electron server never passed the correct parent directory to the backend.
- Fix "Escape" key using old project ID and navigating to a nonexistent tab
- Fix validation for tab names (previously all strings were passing validation due to an incorrect custom predicate being passed to `zod`)
- Add clip path to entire tab bar so that the bottoms of tabs are cut off on hover if they are next to the currently selected tab.
- Add s-shaped curve to hovered tabs, so that their edges match the edges of the currently selected tab.
- Avoid navigating back to "Data Catalog" page when closing a project tab, when the project tab is not the currently open page.
- Fix size of paywall icons in "Shared With" column (16px to be consistent with all other icons)

# Important Notes
None
2024-07-22 09:40:14 +00:00
..
actions Fixes (including downloading Local projects from nested directories) (#10585) 2024-07-22 09:40:14 +00:00
actions.ts Inline modules in app/ide-desktop/ (#10305) 2024-07-17 09:10:42 +00:00
api.ts Inline modules in app/ide-desktop/ (#10305) 2024-07-17 09:10:42 +00:00
assetPanel.spec.ts Inline modules in app/ide-desktop/ (#10305) 2024-07-17 09:10:42 +00:00
assetSearchBar.spec.ts Inline modules in app/ide-desktop/ (#10305) 2024-07-17 09:10:42 +00:00
assetsTableFeatures.spec.ts Inline modules in app/ide-desktop/ (#10305) 2024-07-17 09:10:42 +00:00
copy.spec.ts Fixes (including downloading Local projects from nested directories) (#10585) 2024-07-22 09:40:14 +00:00
createAsset.spec.ts Inline modules in app/ide-desktop/ (#10305) 2024-07-17 09:10:42 +00:00
dataLinkEditor.spec.ts Inline modules in app/ide-desktop/ (#10305) 2024-07-17 09:10:42 +00:00
delete.spec.ts Inline modules in app/ide-desktop/ (#10305) 2024-07-17 09:10:42 +00:00
driveView.spec.ts Inline modules in app/ide-desktop/ (#10305) 2024-07-17 09:10:42 +00:00
editAssetName.spec.ts Inline modules in app/ide-desktop/ (#10305) 2024-07-17 09:10:42 +00:00
labels.spec.ts Inline modules in app/ide-desktop/ (#10305) 2024-07-17 09:10:42 +00:00
labelsPanel.spec.ts Inline modules in app/ide-desktop/ (#10305) 2024-07-17 09:10:42 +00:00
loginLogout.spec.ts Inline modules in app/ide-desktop/ (#10305) 2024-07-17 09:10:42 +00:00
loginScreen.spec.ts Inline modules in app/ide-desktop/ (#10305) 2024-07-17 09:10:42 +00:00
membersSettings.spec.ts Inline modules in app/ide-desktop/ (#10305) 2024-07-17 09:10:42 +00:00
organizationSettings.spec.ts Inline modules in app/ide-desktop/ (#10305) 2024-07-17 09:10:42 +00:00
pageSwitcher.spec.ts Inline modules in app/ide-desktop/ (#10305) 2024-07-17 09:10:42 +00:00
README.md Inline modules in app/ide-desktop/ (#10305) 2024-07-17 09:10:42 +00:00
signUp.spec.ts Inline modules in app/ide-desktop/ (#10305) 2024-07-17 09:10:42 +00:00
sort.spec.ts Inline modules in app/ide-desktop/ (#10305) 2024-07-17 09:10:42 +00:00
startModal.spec.ts Inline modules in app/ide-desktop/ (#10305) 2024-07-17 09:10:42 +00:00
userMenu.spec.ts Inline modules in app/ide-desktop/ (#10305) 2024-07-17 09:10:42 +00:00
userSettings.spec.ts Inline modules in app/ide-desktop/ (#10305) 2024-07-17 09:10:42 +00:00

End-to-end tests

Running tests

Execute all commands from the parent directory.

# Run tests normally
npm run test:e2e
# Open UI to run tests
npm run test:e2e:debug
# Run tests in a specific file only
npm run test:e2e -- e2e/file-name-here.spec.ts
npm 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 npm run test:e2e
PROD=1 npm run test:e2e:debug
PROD=1 npm run test:e2e -- e2e/file-name-here.spec.ts
PROD=1 npm 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");
      }),
  ),
);