mirror of
https://github.com/enso-org/enso.git
synced 2024-12-22 12:31:44 +03:00
1a8888d562
- Close https://github.com/enso-org/cloud-v2/issues/1616 - Remove `listVersions` from backend # Important Notes None |
||
---|---|---|
.. | ||
actions | ||
mock | ||
assetPanel.spec.ts | ||
assetSearchBar.spec.ts | ||
assetsTableFeatures.spec.ts | ||
auth.setup.ts | ||
authPreserveEmail.spec.ts | ||
contextMenus.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 | ||
loginLogout.spec.ts | ||
loginScreen.spec.ts | ||
organizationSettings.spec.ts | ||
pageSwitcher.spec.ts | ||
README.md | ||
setup.spec.ts | ||
signUp.spec.ts | ||
sort.spec.ts | ||
startModal.spec.ts | ||
userMenu.spec.ts | ||
userSettings.spec.ts |
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
thePageActions
class - for example inindex.ts
there isawait new StartModalActions().close()
.
- In some rare exceptions, it is fine as long as you
- 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 aPageActions
.
- In general, avoid exposing any method that returns a