Gathering detailed insights and metrics for karma-sauce-launcher
Gathering detailed insights and metrics for karma-sauce-launcher
Gathering detailed insights and metrics for karma-sauce-launcher
Gathering detailed insights and metrics for karma-sauce-launcher
karma-sauce-launcher-fix-firefox
Fork of karma-sauce-launcher to work around a Firefox issue
karma-chrome-launcher
A Karma plugin. Launcher for Chrome and Chrome Canary.
karma-firefox-launcher
A Karma plugin. Launcher for Firefox.
sauce-connect-launcher
A library to download and launch Sauce Connect.
A Karma plugin. Launch any browser on SauceLabs!
npm install karma-sauce-launcher
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
199 Stars
304 Commits
103 Forks
14 Watching
42 Branches
57 Contributors
Updated on 29 Oct 2023
Minified
Minified + Gzipped
TypeScript (97.3%)
JavaScript (2.7%)
Cumulative downloads
Total Downloads
Last day
-7.5%
6,348
Compared to previous day
Last week
-5.3%
45,873
Compared to previous week
Last month
59.2%
168,622
Compared to previous month
Last year
-45.8%
1,246,910
Compared to previous year
Run your unit tests on Sauce Labs' browser cloud!
Install karma-sauce-launcher
as a devDependency
in your package.json:
1npm install karma-sauce-launcher --save-dev
This launcher is typically used in CI to run your unit tests across many browsers and platforms on Sauce Labs. However, you can also use it locally to debug tests in browsers not available on your machine. It is expected that you are already familiar with Karma when configuring this launcher, so if you are new to Karma, head over to the Karma website.
The Sauce Labs platform configurator can help to find the correct configuration for your desired test platform.
To configure this launcher, you need to add two properties to your top-level Karma config, sauceLabs
and customLaunchers
, set the browsers
array to use Sauce Labs browsers, and add the sauceLabs
reporter.
The sauceLabs
object defines global properties for each browser/platform while the customLaunchers
object configures individual browsers. The sauceLabs
reporter allows your tests results to be properly displayed on https://saucelabs.com. Here is a sample Karma config to get the launcher running:
1module.exports = function(config) { 2 // Example set of browsers to run on Sauce Labs 3 // Check out https://saucelabs.com/platforms for all browser/platform combos 4 var customLaunchers = { 5 // Old JSONWP way of setting the capabilities 6 sl_chrome: { 7 base: 'SauceLabs', 8 browserName: 'chrome', 9 platform: 'Windows 10', 10 }, 11 sl_firefox: { 12 base: 'SauceLabs', 13 browserName: 'firefox', 14 version: 'latest' 15 }, 16 sl_ie_11: { 17 base: 'SauceLabs', 18 browserName: 'internet explorer', 19 platform: 'Windows 8.1', 20 }, 21 // Mobile settings 22 // 1. Go to https://wiki.saucelabs.com/display/DOCS/Platform+Configurator#/ 23 // 2. Select Appium iOS,Android 24 // 3. Configure your device 25 // Don't forget to provide the `appiumVersion` 26 sl_ios_safari: { 27 base: 'SauceLabs', 28 deviceName: 'iPhone 11 Simulator', 29 platformVersion: '13.4', 30 platformName: 'iOS', 31 browserName: 'Safari', 32 appiumVersion: '1.17.1', 33 deviceOrientation: 'portrait' 34 }, 35 // !!!!IMPORTANT!!!! 36 // If you want to use an Android emulator then you can't use localhost. 37 // Because an Android emulator is a VM it will go to it's own localhost 38 // and the test will fail. Make change the `hostname` to your 39 // local ip 40 sl_android: { 41 base: 'SauceLabs', 42 deviceName: 'Android GoogleAPI Emulator', 43 platform: 'Android', 44 version: '11.0', 45 browserName: 'chrome', 46 appiumVersion: '1.18.1', 47 deviceOrientation: 'portrait' 48 }, 49 // For W3C way of setting the capabilities check 50 // https://wiki.saucelabs.com/display/DOCS/Platform+Configurator#/ 51 // And select WebDriver (W3C) Selenium 3/4, Webdriver.io 52 sl_chromeW3C: { 53 base: 'SauceLabs', 54 browserName: 'chrome', 55 browserVersion: 'latest', 56 'sauce:options':{ 57 tags: ['w3c-chrome'] 58 } 59 }, 60 } 61 62 config.set({ 63 64 // The rest of your karma config is here 65 // ... 66 sauceLabs: { 67 testName: 'Web App Unit Tests' 68 }, 69 customLaunchers: customLaunchers, 70 browsers: Object.keys(customLaunchers), 71 reporters: ['dots', 'saucelabs'], 72 singleRun: true 73 }) 74}
Note: this config assumes that process.env.SAUCE_USERNAME
and process.env.SAUCE_ACCESS_KEY
are set.
For example configs using this launcher (using Travis CI), check out this repo's karma file, or AngularJS' Karma config.
Version 4.2.0
and lower of this module will give you the following result in Sauce Labs, no matter how many tests you execute.
As of version 4.3.0 the logs are replaced with the test names and results of the individual tests that have been executed on Sauce Labs, including the execution url in the logs.
Successful run
Unsuccessful run
Execution url
sauceLabs
config properties shared across all browsersType: String
Default: process.env.SAUCE_USERNAME
Your Sauce Labs username (if you don't have an account, you can sign up here).
Type: String
Default: process.env.SAUCE_ACCESS_KEY
Your Sauce Labs access key which you will see on your account page.
Type: String
Detect datacenter to run tests in. Can be either eu
or us
.
Type: Boolean
If set to true
tests are being run on Sauce Labs headless platform on us-east-1
. This option will be ignored if region
is set.
Type: String
Proxy for connecting to Sauce REST API, which is used to communicate job updates of pass/fail.
Type: Boolean
Default: true
If true
, Sauce Connect will be started automatically.
Set this to false
if you are launching tests locally but want to start Sauce Connect via a binary manually in the background to improve test speed.
Type: Object
Default:
1{ 2 username: 'yourUsername', 3 accessKey: 'yourAccessKey', 4 tunnelIdentifier: 'autoGeneratedTunnelID' 5}
Options to send to Sauce Connect.
Check here for all available options. All parameters have to be applied camel cased instead of with hyphens.
Type: String
Default: One of the following environment variables:
process.env.BUILD_NUMBER
process.env.BUILD_TAG
process.env.CI_BUILD_NUMBER
process.env.CI_BUILD_TAG
process.env.TRAVIS_BUILD_NUMBER
process.env.CIRCLE_BUILD_NUM
process.env.DRONE_BUILD_NUMBER
ID of the build currently running. This should be set by your CI.
Type: String
Default: 'Karma test'
Name of the unit test group you are running.
Type: String
Sauce Connect can proxy multiple sessions, this is an id of a session.
Type: Array of Strings
Tags to use for filtering jobs in your Sauce Labs account.
Type: Boolean
Default: false
Set to true
if you want to record a video of your Karma session.
Type: Boolean
Default: true
Set to false
if you don't want to record screenshots.
Type: String
Default: null
Control who can view job details. Available visibility levels are documented on the SauceLabs website.
Type: Object
Default: {}
Send arbitrary data alongside your tests. See the SauceLabs documentation for more details.
customLaunchers
config propertiesThe customLaunchers
object has browser names as keys and configs as values. Documented below are the different properties which you can configure for each browser/platform combo.
Note: You can learn about the available browser/platform combos on the Sauce Labs platforms page, platforms configurator page and REST API page.
Type: String
Required: true
This defines the base configuration for the launcher. In this case it should always be SauceLabs
so that browsers can use the base Sauce Labs config defined at the root sauceLabs
property.
Type: String
Required: true
Name of the browser.
Type: String
Default: Latest browser version for all browsers except Chrome
Version of the browser to use.
Type: String
Default: 'Linux'
for Firefox/Chrome, 'Windows 7'
for IE/Safari
Name of platform to run browser on.
sauce:options
Specific Sauce Labs capability options.
This launcher uses Sauce Connect in the background. If you are interested in security or want to see the system requirements, head over to the documentation.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 5/21 approved changesets -- score normalized to 2
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
security policy file not detected
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
69 existing vulnerabilities detected
Details
Score
Last Scanned on 2024-11-18
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More