Upgrade guide
Version 10
If you've used cypress and some of dhis2's cypress tools (which required the Cypress version to be 8), you'll have to make some modifications. The cypress team releases a migration guide for every new version. The guides can be found here.
Here's a short list of thing that need to be updated:
- Uninstall
@dhis2/cli-utils-cypress
if you're still using it - In case you've used
d2-utils-cypress open
, you now have to use cypress directly. Thepackage.json
of the Aggregate Data Entry app is a good example. - Upgrade cypress to the lastest version (must be
>=12.7.0
) - Cypress now uses
cypress.config.js
instead ofcypress.json
- If you're using cucumber, the
cypress-cucumber-preprocessor
package has to be replaced with@badeball/cypress-cucumber-preprocessor
- This also means that you'll have to change the module import in the files
with step definitions, e.g.
import from 'cypress-cucumber-preprocessor/steps' -> import from '@badeball/cypress-cucumber-preprocessor'
- The plugin provided by
@dhis2/cypress-plugins
has to be called in thesetupNodeEvents
function in cypress' config file. Make sure it's the first call in the file as otherwise it won't work! (For more information, see the "Using cucumber with feature files" guide)
- This also means that you'll have to change the module import in the files
with step definitions, e.g.
- Plugins have to be configues in the configuration file instead of
cypress/plugins/index.js
. - The old plugins file and folder can be deleted
- The
cypress/integration
folder has been renamed tocypress/e2e
(in case you were doing end-to-end tests; For component testing, please refer to the official documentation) - The
cypress/support/index.js
should be renamed tocypress/support/e2e.js
- In case you are using Cypress GitHub Action, make sure you are on version 5 or newer.