1.0.156 • Published 3 years ago

@uktrade/client-matrix-js v1.0.156

Weekly downloads
982
License
MIT
Repository
github
Last release
3 years ago

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)
1.0.156

3 years ago

1.0.149

3 years ago

1.0.142

3 years ago

1.0.135

3 years ago

1.0.128

3 years ago

1.0.127

3 years ago

1.0.107

3 years ago

1.0.88

4 years ago

1.0.78

4 years ago

1.0.70

4 years ago

1.0.67

4 years ago

1.0.62

5 years ago

1.0.58

5 years ago

1.0.54

5 years ago

1.0.50

5 years ago

1.0.46

5 years ago

1.0.42

5 years ago

1.0.38

5 years ago

1.0.34

5 years ago

1.0.3

5 years ago

1.0.0

5 years ago