Tips & tricks
Tips & tricks¶
-
ui5-test-runner
is regularly tested with the latest versions ofpuppeteer
,selenium-webdriver
and other packages. If you face troubles with one of these and you are not using the latest version (the runner will generate a warning), try upgrading. -
Because of the asynchronous nature of
sap.ui.define
andsap.ui.require
, tests are usually loaded after the QUnit framework. It is recommended to executeQUnit.config.autostart = false;
as soon as possible to ensure the test framework waits for the tests to be loaded and then callQUnit.start();
. If not done properly, theui5-test-runner
is capable of running the tests and updates itself while the tests are being loaded. However, it might happen that the QUnit framework fails to handle the tests, which may also fail the runner. -
By default QUnit randomizes the unit tests order (not within OPA): use
QUnit.config.reorder = false;
to prevent this behavior. NOTE: this does not work if theautostart
configuration is not done properly. -
The runner takes a screenshot for every OPA assertion (
Opa5.assert.ok
) : disabling screenshots will speed up the tests. Yet, if a test fails, a screenshot is captured after the error. -
To benefit from parallelization, use the option
--split-opa
(available from version4.5.0
) : it automatically splits the OPA journeys into different test pages. -
ui5-test-runner
runs in Business Application Studio provided the instance is created with theHeadless Testing Framework
extension. Then configure the runner to use thewebdriverio
browser combined with thefirefox
setting. For instance :ui5-test-runner --browser $/webdriverio.js -- --browser firefox
.