Match browser manifests to a desired set of browsers.
Replacessauce-browsers
in conjunction withairtap-sauce-browsers
.
const sauce = require('airtap-sauce-browsers').promise
const match = require('airtap-match-browsers')
// Browsers available on Sauce Labs, as manifests
const available = await sauce()
// Browsers that we want, by manifest properties
const wanted = [
{ name: 'firefox', platform: 'linux' },
{ name: 'chrome', version: '78..latest' },
{ name: 'ios safari', version: '13' }
]
// Find matches
const manifests = match(available, wanted)
Required, must be a string. Matched loosely using browser-names
.
Defaults to "latest". Supported forms (compatible with Zuul & Airtap):
- An exact or partial version ("6" matches "6.0").
- A keyword, one of "oldest" (first version) or "latest" (last stable version).
- A range in the form of
<start>..<end>
, wherestart
andend
are either a version or a keyword. This will result in one or more matches. - A negative range in the form of
-<n>..latest
, for example-1..latest
which means the last 2 stable versions. - A prerelease version like "dev", "beta", "80.0a1". Such versions sort after stable versions, so that
oldest..latest
excludes "dev" andlatest..dev
includes e.g. latest, "beta" and "dev". - An array of versions.
If a manifest doesn't have a version
, it behaves like a prerelease.
Yet to document. A quick example:
const manifests = match(available, [{
name: 'chrome for android',
version: '10',
capabilities: {
appium: {
// Select a specific emulator (case-insensitive)
deviceName: 'google pixel 3a googleapi emulator'
}
}
}])
Yet to document.
Yet to document.
With npm do:
npm install airtap-match-browsers
MIT © 2020-present Vincent Weevers