项目作者: airtap

项目描述 :
Match browser manifests to a desired set of browsers.
高级语言: JavaScript
项目地址: git://github.com/airtap/match-browsers.git
创建时间: 2020-03-01T12:43:52Z
项目社区:https://github.com/airtap/match-browsers

开源协议:Other

下载


airtap-match-browsers

Match browser manifests to a desired set of browsers.
Replaces sauce-browsers in conjunction with airtap-sauce-browsers.

npm status
node
Travis
JavaScript Style Guide

Usage

  1. const sauce = require('airtap-sauce-browsers').promise
  2. const match = require('airtap-match-browsers')
  3. // Browsers available on Sauce Labs, as manifests
  4. const available = await sauce()
  5. // Browsers that we want, by manifest properties
  6. const wanted = [
  7. { name: 'firefox', platform: 'linux' },
  8. { name: 'chrome', version: '78..latest' },
  9. { name: 'ios safari', version: '13' }
  10. ]
  11. // Find matches
  12. const manifests = match(available, wanted)

Properties to match on

name

Required, must be a string. Matched loosely using browser-names.

version

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>, where start and end 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” and latest..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.

platform and any other (nested) property

Yet to document. A quick example:

  1. const manifests = match(available, [{
  2. name: 'chrome for android',
  3. version: '10',
  4. capabilities: {
  5. appium: {
  6. // Select a specific emulator (case-insensitive)
  7. deviceName: 'google pixel 3a googleapi emulator'
  8. }
  9. }
  10. }])

Specifying options

Yet to document.

Deduplication logic

Yet to document.

Install

With npm do:

  1. npm install airtap-match-browsers

License

MIT © 2020-present Vincent Weevers