npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@thorsten-wolf-neptune/wdio-ui5-service-cordova

v0.8.13

Published

WebdriverIO plugin for testing UI5 browser-based apps

Downloads

110

Readme

wdio-ui5-service 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 like soerver or http-server.
  • node version >= 12.x (lts/erbium)
  • (optional) yarn during development, we rely on yarn’s workspace-features - that’s why we refer to yarn instead of npm in the docs, even though using npm as an equivalent shold be fine too

Installation

To keep the module lightweight, wdio-ui5-service has almost zero dependencies.
This means you have to setup WebdriverIO as a prerequisite as described in https://webdriver.io/docs/gettingstarted.html.

$> npm i --save-dev @wdio/cli
$> npx wdio config # do the config boogie - this will also install dependencies

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

{
  "dependencies": {
    "wdio-ui5-service": "^0.0.1"
  }
}

Then add the ui5-service to the standard wdio.conf.js:

...
services: [
    // other services like 'chromedriver'
    // ...
    'ui5'
]
...

Finally, pass in configuration options for wdi5 in your WebdriverIO-conf file:

wdi5: {
    screenshotPath: require('path').join('test', 'report', 'screenshots'), // [optional] using the project root
    screenshotsDisabled: false, // [optional] {Boolean}; if set to true screenshots won't be taken and not written to file system
    logLevel: 'verbose', // [optional] error | verbose | silent
    platform: 'browser', // [mandatory] browser | android | ios | electron
    url: 'index.html', // [mandatory, not empty] path to your bootstrap html file. If your server autoredirects to a 'domain:port/' like root url use empty string ''
    deviceType: 'web', // [mandatory] native | web
    skipInjectUI5OnStart: false, // [optional] true when UI5 is not on the start page, you need to later call <wdioUI5service>.injectUI5(); manually
    waitForUI5Timeout: 15000 // [optional] maximum waiting time while checking for UI5 availability
}

See test/wdio-ui5.conf.js for a sample configuration file for browser-scope testing.

Run the tests via the webdriver.io-cli:

$> npx wdio

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.

// require the service implementation and instantiate separately
const _ui5Service = require('wdio-ui5-service').default;
const wdioUI5Service = new _ui5Service();

await wdioUI5Service.injectUI5();

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
    await browser.goTo({sHash: '#/test'});
  • using the UI5 router navTo function
    await browser.goTo(
        oRoute: {
            sComponentId,
            sName,
            oParameters,
            oComponentTargetInfo,
            bReplace
        }
    )

License

see top-level LICENSE file