enso/app/gui/integration-test/dashboard
Adam Obuchowicz 736134e491
Add traces to integration tests + suppress one flaky assertion. (#11595)
Fixes #11604

Most issues were caused by a problem with Project List flooding the network with its requests - this was fixed on develop.
But one assertion was flaky - it assumed we will see the "real" run result on `write` node, but sometimes it is immediately overwritten by dry run.

But the most important part of this PR is adding traces to Electron packages - it's should be much easier now to debug E2E test failures.

Also renamed the previously misnamed "E2E tests" to "[GUI] integration tests".
2024-11-27 14:09:59 +00:00
..
actions Add traces to integration tests + suppress one flaky assertion. (#11595) 2024-11-27 14:09:59 +00:00
mock Add traces to integration tests + suppress one flaky assertion. (#11595) 2024-11-27 14:09:59 +00:00
api.ts Add traces to integration tests + suppress one flaky assertion. (#11595) 2024-11-27 14:09:59 +00:00
assetPanel.spec.ts Add traces to integration tests + suppress one flaky assertion. (#11595) 2024-11-27 14:09:59 +00:00
assetSearchBar.spec.ts Add traces to integration tests + suppress one flaky assertion. (#11595) 2024-11-27 14:09:59 +00:00
assetsTableFeatures.spec.ts Add traces to integration tests + suppress one flaky assertion. (#11595) 2024-11-27 14:09:59 +00:00
auth.setup.ts Add traces to integration tests + suppress one flaky assertion. (#11595) 2024-11-27 14:09:59 +00:00
authPreserveEmail.spec.ts Add traces to integration tests + suppress one flaky assertion. (#11595) 2024-11-27 14:09:59 +00:00
copy.spec.ts Add traces to integration tests + suppress one flaky assertion. (#11595) 2024-11-27 14:09:59 +00:00
createAsset.spec.ts Add traces to integration tests + suppress one flaky assertion. (#11595) 2024-11-27 14:09:59 +00:00
dataLinkEditor.spec.ts Add traces to integration tests + suppress one flaky assertion. (#11595) 2024-11-27 14:09:59 +00:00
delete.spec.ts Add traces to integration tests + suppress one flaky assertion. (#11595) 2024-11-27 14:09:59 +00:00
driveView.spec.ts Add traces to integration tests + suppress one flaky assertion. (#11595) 2024-11-27 14:09:59 +00:00
editAssetName.spec.ts Add traces to integration tests + suppress one flaky assertion. (#11595) 2024-11-27 14:09:59 +00:00
labels.spec.ts Add traces to integration tests + suppress one flaky assertion. (#11595) 2024-11-27 14:09:59 +00:00
labelsPanel.spec.ts Add traces to integration tests + suppress one flaky assertion. (#11595) 2024-11-27 14:09:59 +00:00
latestGithubReleases.json Add traces to integration tests + suppress one flaky assertion. (#11595) 2024-11-27 14:09:59 +00:00
loginLogout.spec.ts Add traces to integration tests + suppress one flaky assertion. (#11595) 2024-11-27 14:09:59 +00:00
loginScreen.spec.ts Add traces to integration tests + suppress one flaky assertion. (#11595) 2024-11-27 14:09:59 +00:00
organizationSettings.spec.ts Add traces to integration tests + suppress one flaky assertion. (#11595) 2024-11-27 14:09:59 +00:00
pageSwitcher.spec.ts Add traces to integration tests + suppress one flaky assertion. (#11595) 2024-11-27 14:09:59 +00:00
README.md Add traces to integration tests + suppress one flaky assertion. (#11595) 2024-11-27 14:09:59 +00:00
setup.spec.ts Add traces to integration tests + suppress one flaky assertion. (#11595) 2024-11-27 14:09:59 +00:00
signUp.spec.ts Add traces to integration tests + suppress one flaky assertion. (#11595) 2024-11-27 14:09:59 +00:00
sort.spec.ts Add traces to integration tests + suppress one flaky assertion. (#11595) 2024-11-27 14:09:59 +00:00
startModal.spec.ts Add traces to integration tests + suppress one flaky assertion. (#11595) 2024-11-27 14:09:59 +00:00
userMenu.spec.ts Add traces to integration tests + suppress one flaky assertion. (#11595) 2024-11-27 14:09:59 +00:00
userSettings.spec.ts Add traces to integration tests + suppress one flaky assertion. (#11595) 2024-11-27 14:09:59 +00:00

Integration tests

Running tests

Execute all commands from the parent directory.

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