Update Momentic version

Make sure momentic is installed as a devDependency in the root of your repository.

npm update momentic

Update CI scripts, package.json, Makefiles, and any other files in your codebase that reference momentic to the latest 2.x version.

Run the migration wizard

This command will update your momentic.config.yaml to include feature flags, Git branch configuration, and AI agent settings.

npx momentic migrate v1-v2

Run checks for duplicate IDs

Momentic will fail if it detects duplicate command or step IDs. Duplicate IDs are caused by manually modifying tests outside of the Momentic editor, and can lead to test flakiness.

To check whether your existing repository has duplicate IDs, run the following command. Problems can be automatically fixed by adding the --fix flag.

npx momentic check duplicate-ids

Update CI scripts to install browsers

In Momentic 2.0, browsers must be explicitly installed.

If your CI scripts do not already invoke the install-browsers command, add this command before any tests are executed.

You can determine which browsers to install by searching your codebase for the browserType string. See the install-browsers command for more information.

Update CI scripts to upload results

momentic run now saves all test results to a local directory called test-results by default.

For the results to be available on Momentic Cloud, add a step to run the momentic results upload <folder> command, supplying the path to the directory containing the local test results.

npx momentic results upload test-results

See the results command for more information and details on merging results for sharding setups.

Update deprecated commands and flags

  • The --report and --no-report flags are no longer supported.
  • Using CI=true to upload results is no longer necessary and can be removed from CI scripts.
  • momentic import-from-cloud is deprecated and replaced with momentic import.
  • momentic check-config is deprecated and replaced with momentic check config.

Update tests relying on automatic tab switching

Use Switch Tab steps instead of relying on automatic tab switching.

In Momentic 2.0, switching to newly opened tabs no longer occurs automatically, as this behavior is inherently racy and flaky.

If you want to continue using automatic tab switching, you can enable it by adding the following to your momentic.config.yaml file:

momentic.config.yaml
browser:
  autoFollowNewTabs: true