enso/app/ide-desktop/lib/dashboard/e2e
somebody1234 cf9d757457
Even more dashboard fixes (#10541)
- Fix https://github.com/enso-org/cloud-v2/issues/1383
- Fix file download - both on Electron, and in browser
- Refresh versions list when uploading neww file version
- Fix app crashing when asset is opened in asset panel while switching to Local Backend
- Don't show asset id when asset is opened in asset panel, but user is on the Local backend, resulting in the internal Asset ID being shown
- Fix drag-n-drop
- ⚠️ `npm run dev` is NOT fixed in this PR - however it should already be fixed in another PR which has already been merged. This needs testing to confirm whether it is fixed though.

Other changes:
- Add support for "duplicate project" endpoint on Local Backend
- Fix downloading project from nested directory on Local Backend (not working)
- Refactor more E2E tests to use the "new" architecture
- Simplify "new" E2E architecture to minimize boilerplate

# Important Notes
- When testing downloads, both Electron and browser should be tested as they use completely separate implementations for how files are downloaded.
2024-07-16 09:55:45 +00:00
..
actions Even more dashboard fixes (#10541) 2024-07-16 09:55:45 +00:00
actions.ts Even more dashboard fixes (#10541) 2024-07-16 09:55:45 +00:00
api.ts Even more dashboard fixes (#10541) 2024-07-16 09:55:45 +00:00
assetPanel.spec.ts Even more dashboard fixes (#10541) 2024-07-16 09:55:45 +00:00
assetSearchBar.spec.ts Even more dashboard fixes (#10541) 2024-07-16 09:55:45 +00:00
assetsTableFeatures.spec.ts Even more dashboard fixes (#10541) 2024-07-16 09:55:45 +00:00
copy.spec.ts Even more dashboard fixes (#10541) 2024-07-16 09:55:45 +00:00
createAsset.spec.ts Even more dashboard fixes (#10541) 2024-07-16 09:55:45 +00:00
dataLinkEditor.spec.ts Even more dashboard fixes (#10541) 2024-07-16 09:55:45 +00:00
delete.spec.ts Even more dashboard fixes (#10541) 2024-07-16 09:55:45 +00:00
driveView.spec.ts Even more dashboard fixes (#10541) 2024-07-16 09:55:45 +00:00
editAssetName.spec.ts Don't cache errored requests for /user/me endpoint (#10360) 2024-06-25 16:56:14 +00:00
labels.spec.ts Even more dashboard fixes (#10541) 2024-07-16 09:55:45 +00:00
labelsPanel.spec.ts Don't cache errored requests for /user/me endpoint (#10360) 2024-06-25 16:56:14 +00:00
loginLogout.spec.ts Even more dashboard fixes (#10541) 2024-07-16 09:55:45 +00:00
loginScreen.spec.ts Don't cache errored requests for /user/me endpoint (#10360) 2024-06-25 16:56:14 +00:00
membersSettings.spec.ts Even more dashboard fixes (#10541) 2024-07-16 09:55:45 +00:00
organizationSettings.spec.ts Even more dashboard fixes (#10541) 2024-07-16 09:55:45 +00:00
pageSwitcher.spec.ts Even more dashboard fixes (#10541) 2024-07-16 09:55:45 +00:00
README.md Offline Mode Support (#10317) 2024-06-21 07:14:40 +00:00
signUp.spec.ts Even more dashboard fixes (#10541) 2024-07-16 09:55:45 +00:00
sort.spec.ts Even more dashboard fixes (#10541) 2024-07-16 09:55:45 +00:00
startModal.spec.ts Even more dashboard fixes (#10541) 2024-07-16 09:55:45 +00:00
userMenu.spec.ts Even more dashboard fixes (#10541) 2024-07-16 09:55:45 +00:00
userSettings.spec.ts Even more dashboard fixes (#10541) 2024-07-16 09:55:45 +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");
      }),
  ),
);