New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

@uktrade/client-matrix-js

Package Overview
Dependencies
Maintainers
8
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@uktrade/client-matrix-js

Expose client capabilities for several frameworks when running UI tests against third party providers

latest
Source
npmnpm
Version
1.0.156
Version published
Maintainers
8
Created
Source

Client matrix

The intentation of this package is to provide client capabilities when running UI tests against third party providers like browserstack and saucelabs. This package provides capabilities in the format for both WebdriverIO and NightwatchJS.

Build status

CircleCI

Build and test package

Install dependencies:

$ npm install

Build locally:

$ npm run build

Run the tests:

$ npm run test

WebdriverIO config setup

In your wdio.conf.js file, after you have the list of browsers you would like to run your tests against, provide it in the capabilities key in the conf file:

// wdio.conf.js
const clientMatrix = require('@uktrade/client-matrix-js')
const clientMatrixList = clientMatrix.requestedClients(['chrome_latest', 'firefox_latest'])
export.config = {
// ...
  capabilities: [...clientMatrixList],
// ...
}

Usage

Add the package to your test suite using the following command:

npm install --save-dev @uktrade/client-matrix-js

Then import the function from the exposed module to have the ability to get a list of capabilities:

const clientMatrix = require('@uktrade/client-matrix-js')

To fetch capabilities for a given device or browser for your wdio test suite, simply provide the clients in a list, notice that the strings need to match the maintained client matrix:

clientMatrix.requestedClients(['chrome_latest', 'firefox_latest'])

To fetch capabilities for nightwatch, ensure the flag is set to true:

clientMatrix.requestedClients(['chrome_latest', 'firefox_latest'], true)

The package currently has its own browserstack maintaned client matrix, although you can maintain your own matrix (either browserstack, saucelabs or any other provider) and inject it to the function:

const sauceLabsMatrix = {
  FIREFOX: {
    BROWSER_NAME: 'firefox',
  },
  CHROME: {
    BROWSER_NAME: 'chrome',
  },
  CHROME_EMULATOR: {
    BROWSER_NAME: 'edge',
  },
}

// If you'd like nightwatch capabilities output
// ensure the flag is set to true
clientMatrix.requestedClients(['chrome', 'edge'], false, sauceLabsMatrix)

Keywords

nightwatch

FAQs

Package last updated on 20 Sep 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts