项目作者: airtap

项目描述 :
Sauce Labs browser provider.
高级语言: JavaScript
项目地址: git://github.com/airtap/sauce.git
创建时间: 2020-08-23T10:14:34Z
项目社区:https://github.com/airtap/sauce

开源协议:MIT License

下载


airtap-sauce

Sauce Labs browser provider. List and run browsers on Sauce Labs.

npm status
node
Sauce Labs integration status
Lint
JavaScript Style Guide

Table of Contents

Click to expand

- Usage
- Programmatic
- With Airtap
- API
- Sauce([options])
- Browser options
- Install
- Big Thanks
- License

Usage

Programmatic

  1. const Sauce = require('airtap-sauce')
  2. const provider = new Sauce()
  3. // Get a list of desired browsers
  4. const wanted = [{ name: 'android', version: '5..latest' }]
  5. const manifests = await provider.manifests(wanted)
  6. // Instantiate a browser
  7. const target = { url: 'http://localhost:3000' }
  8. const browser = provider.browser(manifests[0], target)
  9. await browser.open()

With Airtap

  1. providers:
  2. - airtap-sauce
  3. browsers:
  4. - name: android
  5. version: 5..latest

This provider also exposes platform, capabilities and more properties to match on:

  1. browsers:
  2. - name: chrome
  3. version: 69
  4. platform: mac 10.15

API

Sauce([options])

Constructor. Returns an instance of browser-provider. Options:

  • username (string): defaults to process.env.SAUCE_USERNAME
  • key (string): defaults to process.env.SAUCE_ACCESS_KEY
  • hostname (string): defaults to 'ondemand.saucelabs.com'
  • port (number): defaults to 80
  • tunnel (object): custom options for sauce-connect-launcher

In Airtap these can be set like so:

  1. providers:
  2. - airtap-sauce:
  3. tunnel:
  4. connectRetries: 10

Browser options

  • name (string): name for Sauce Labs job, defaults to browser manifest name
  • profile (object, only on Firefox): custom user profile to programmatically configure anything that can be changed in about:config
  • capabilities (object): custom Selenium capabilities.

In Airtap these can be set like so:

  1. browsers:
  2. - name: firefox
  3. options:
  4. name: my-custom-job-name
  5. profile:
  6. webgl.force-enabled: true

Install

With npm do:

  1. npm install airtap-sauce

Big Thanks

Cross-browser Testing Platform and Open Source ♥ Provided by Sauce Labs.

Sauce Labs logo

License

MIT © 2018 Roman Shtylman, Zuul contributors and Airtap contributors