UI5 Service
wdio-ui5-service is a 3rd party package, for more information please see GitHub | npm
WebdriverIO-plugin for wdi5.
It provides the ui5-service to WebdriverIO, running tests in the browser.
Table of contents#
Prerequisites#
- UI5 app running in the browser, accessbile via
http(s)://host.ext:port. Recommended tooling for this is either the official UI5 tooling (ui5 serve) or some standalone http server likesoerverorhttp-server. - node version >=
12.x(lts/erbium) - (optional)
yarnduring development, we rely onyarn’s workspace-features - that’s why we refer toyarninstead ofnpmin the docs, even though usingnpmas an equivalent shold be fine too
Installation#
To keep the module lightweight, wdio-ui5-service has zero dependencies.
This means you have to setup WebdriverIO as a prerequisite as described in https://webdriver.io/docs/gettingstarted.html.
Add wdio-ui5-service as a (dev)dependency to your package.json via
$> npm install wdio-ui5-service --save-dev
or
$> yarn add -D wdio-ui5-service
Then add the ui5-service to the standard wdio.conf.js:
Finally, pass in configuration options for wdi5 in your WebdriverIO-conf file:
See test/wdio-ui5.conf.js for a sample configuration file for browser-scope testing.
Run the tests via the webdriver.io-cli:
Skip UI5/wdi5 initialization on startup#
In case the very first called page is non-UI5 (think SAP CP CloudFoundry login),
the config option skipInjectUI5OnStart can be set to true to postpone injecting wdi5 into the browser context.
Consequentially you have to do it later, as soon as the UI5 page to test is available. This can be done by calling injectUI5() on the wdio-ui5-service.
Check /wdio-ui5-service/test/ui5-late.test.js in conjunction with /wdio-ui5-service/test/wdio-ui5-late.conf.js for an example.
Usage#
Run-(Test-)Time usage of wdi5 is agnostic to its' test-scope (browser or native) and centers around the global browser-object, be it in the browser or on a real mobile device.
Please see the top-level README for API-methods and usage instructions.
Features specific to wdio-ui5-service (vs. wdi5)#
Navigation#
In the test, you can navigate the UI5 webapp via goTo(options) in one of two ways:
- updating the browser hash
- using the UI5 router navTo function