enso/app/gui/integration-test/dashboard
somebody1234 1a8888d562
Remove listVersions from Backend (#11849)
- Close https://github.com/enso-org/cloud-v2/issues/1616
- Remove `listVersions` from backend

# Important Notes
None
2024-12-12 13:06:50 +00:00
..
actions Remove listVersions from Backend (#11849) 2024-12-12 13:06:50 +00:00
mock Dashboard Issues (#11685) 2024-11-27 21:20:36 +00:00
assetPanel.spec.ts Clean up integration tests and add listeners for backend calls (#11847) 2024-12-12 09:49:58 +00:00
assetSearchBar.spec.ts Clean up integration tests and add listeners for backend calls (#11847) 2024-12-12 09:49:58 +00:00
assetsTableFeatures.spec.ts Clean up integration tests and add listeners for backend calls (#11847) 2024-12-12 09:49:58 +00:00
auth.setup.ts Clean up integration tests and add listeners for backend calls (#11847) 2024-12-12 09:49:58 +00:00
authPreserveEmail.spec.ts Clean up integration tests and add listeners for backend calls (#11847) 2024-12-12 09:49:58 +00:00
contextMenus.spec.ts Clean up integration tests and add listeners for backend calls (#11847) 2024-12-12 09:49:58 +00:00
copy.spec.ts Clean up integration tests and add listeners for backend calls (#11847) 2024-12-12 09:49:58 +00:00
createAsset.spec.ts Clean up integration tests and add listeners for backend calls (#11847) 2024-12-12 09:49:58 +00:00
dataLinkEditor.spec.ts Clean up integration tests and add listeners for backend calls (#11847) 2024-12-12 09:49:58 +00:00
delete.spec.ts Clean up integration tests and add listeners for backend calls (#11847) 2024-12-12 09:49:58 +00:00
driveView.spec.ts Clean up integration tests and add listeners for backend calls (#11847) 2024-12-12 09:49:58 +00:00
editAssetName.spec.ts Clean up integration tests and add listeners for backend calls (#11847) 2024-12-12 09:49:58 +00:00
labels.spec.ts Clean up integration tests and add listeners for backend calls (#11847) 2024-12-12 09:49:58 +00:00
labelsPanel.spec.ts Clean up integration tests and add listeners for backend calls (#11847) 2024-12-12 09:49:58 +00:00
loginLogout.spec.ts Clean up integration tests and add listeners for backend calls (#11847) 2024-12-12 09:49:58 +00:00
loginScreen.spec.ts Clean up integration tests and add listeners for backend calls (#11847) 2024-12-12 09:49:58 +00:00
organizationSettings.spec.ts Clean up integration tests and add listeners for backend calls (#11847) 2024-12-12 09:49:58 +00:00
pageSwitcher.spec.ts Clean up integration tests and add listeners for backend calls (#11847) 2024-12-12 09:49:58 +00:00
README.md Clean up integration tests and add listeners for backend calls (#11847) 2024-12-12 09:49:58 +00:00
setup.spec.ts Clean up integration tests and add listeners for backend calls (#11847) 2024-12-12 09:49:58 +00:00
signUp.spec.ts Clean up integration tests and add listeners for backend calls (#11847) 2024-12-12 09:49:58 +00:00
sort.spec.ts Clean up integration tests and add listeners for backend calls (#11847) 2024-12-12 09:49:58 +00:00
startModal.spec.ts Clean up integration tests and add listeners for backend calls (#11847) 2024-12-12 09:49:58 +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 Clean up integration tests and add listeners for backend calls (#11847) 2024-12-12 09:49:58 +00:00

Integration tests

Running tests

Execute all commands from the parent directory. Note that all options can be used in any combination.

# Run tests normally
pnpm playwright test
# Open UI to run tests
pnpm playwright test --ui
# Run tests in a specific file only
pnpm playwright test integration-test/dashboard/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=true pnpm playwright test

Getting started

// 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.
test('test name here', ({ page }) => mockAllAndLogin({ page }).goToPage.drive())

Perform arbitrary actions (e.g. actions on the API)

test('test name here', ({ page }) =>
  mockAllAndLogin({ page }).do((_page, { api }) => {
    api.foo()
    api.bar()
    expect(api.baz()?.quux).toEqual('bar')
  }))

Writing new classes extending BaseActions

  • Make sure that every method returns either the class itself (this) or .into(AnotherActionsClass<Context>).
  • Avoid constructing new AnotherActionsClass() - instead prefer .into(AnotherActionsClass<Context>) and optionally .into(ThisClass<Context>) if required.
  • Never construct an ActionsClass
    • In some rare exceptions, it is fine as long as you await the PageActions class - for example in index.ts there is await new StartModalActions().close().
  • Methods for locators are fine, but it is not recommended to expose them as it makes it easy to accidentally - i.e. it is fine as long as they are private.
    • In general, avoid exposing any method that returns a Promise rather than a PageActions.