How to Upgrade hermione to Version 5.x
If your project uses hermione version earlier than 4.x, please read “How to Upgrade hermione to Version 4.x” before upgrading to version 5.x.
We recommend upgrading hermione in stages, ensuring at each stage that all project tests run correctly.
What Has Changed?
New Default Configurations
The first thing to note during the upgrade is the change in default values for some configuration options. All changes aim to speed up test execution with basic hermione setup and provide more information about tests after execution.
Parameter | Old | New | Description |
antialiasingTolerance | 0 | 4 | Sets the sensitivity for detecting antialiasing, which will be ignored when comparing screenshots. |
compositeImage | false | true | Allows testing elements that do not fit into the viewport height. |
saveHistory | false | true | Save the history of all executed commands. |
takeScreenshotOnFails.assertViewFail | false | true | Determines whether to take a page screenshot on test failure, including on assertView command failure. |
takeScreenshotOnFailsMode | "viewport" | "fullpage" | Screenshot mode on test failure. Available values: viewport and fullpage. |
takeScreenshotOnFailsTimeout | 90000 | 5000 | Timeout for taking a page screenshot on test failure, in ms. |
httpTimeout | 90000 | 30000 | Timeout for any requests to the Selenium server, in ms. |
pageLoadTimeout | 300000 | 20000 | Timeout for full page loading, in ms. |
sessionQuitTimeout | 90000 | 5000 | Timeout for session termination, in ms. |
Additionally, the screenshotOnReject
and screenshotOnRejectTimeout
options, previously marked as deprecated, have been removed.
You can read more about these options here. If the new values suit you and there are no apparent reasons to override them, you can skip this section during the migration.
CLI Reporters
This section discusses CLI reporters that come out of the box and not the html-reporter.
- The teamcity reporter has been removed, as it seemed out of place within hermione. If you still use such a report, you can use the hermione-teamcity-reporter plugin.
- The
-r
option, which previously allowed specifying the reporter type, no longer does this. It is more often used for the--require
option. Many users found this confusing, so we decided to fix it. You can still specify the reporter using the--reporter
option. - If you want to add your own reporter, it must have a
create
method for initialization.
So, if you did not use the teamcity reporter or did not write new reporters, you can skip this section during migration.
testParserAPI
The testParser object, which could be obtained by subscribing to the BEFORE_FILE_READ event, is no longer an instance of EventEmitter
. This means that you can no longer use it to subscribe to the SUITE_BEGIN and TEST_BEGIN events.
To be fair, this initially did not work correctly, and no one used it. Therefore, this functionality was removed. You can read about all available events here.
Support
If you encounter any issues during the migration to the new version or have any questions, visit github issues — we will definitely help you!