{"id":13593312,"url":"https://github.com/karma-runner/karma-sauce-launcher","last_synced_at":"2025-04-09T02:33:17.336Z","repository":{"id":9019278,"uuid":"10776021","full_name":"karma-runner/karma-sauce-launcher","owner":"karma-runner","description":"A Karma plugin. Launch any browser on SauceLabs!","archived":false,"fork":false,"pushed_at":"2024-03-14T21:29:44.000Z","size":1271,"stargazers_count":199,"open_issues_count":19,"forks_count":104,"subscribers_count":15,"default_branch":"master","last_synced_at":"2024-04-14T05:52:55.599Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/karma-runner.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2013-06-18T23:51:51.000Z","updated_at":"2024-06-08T20:52:17.008Z","dependencies_parsed_at":"2024-06-08T21:03:54.938Z","dependency_job_id":null,"html_url":"https://github.com/karma-runner/karma-sauce-launcher","commit_stats":{"total_commits":265,"total_committers":45,"mean_commits":5.888888888888889,"dds":0.7358490566037736,"last_synced_commit":"69dcb822a45d29e57297b0eda7af4123ae55aafd"},"previous_names":[],"tags_count":52,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/karma-runner%2Fkarma-sauce-launcher","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/karma-runner%2Fkarma-sauce-launcher/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/karma-runner%2Fkarma-sauce-launcher/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/karma-runner%2Fkarma-sauce-launcher/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/karma-runner","download_url":"https://codeload.github.com/karma-runner/karma-sauce-launcher/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247601378,"owners_count":20964861,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T16:01:19.051Z","updated_at":"2025-04-09T02:33:16.720Z","avatar_url":"https://github.com/karma-runner.png","language":"TypeScript","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"readme":"# karma-sauce-launcher\n\n[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat-square)](https://github.com/karma-runner/karma-sauce-launcher)\n[![npm version](https://img.shields.io/npm/v/karma-sauce-launcher.svg?style=flat-square)](https://www.npmjs.com/package/karma-sauce-launcher) [![npm downloads](https://img.shields.io/npm/dm/karma-sauce-launcher.svg?style=flat-square)](https://www.npmjs.com/package/karma-sauce-launcher)\n[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)\n\n[![Build Status](https://img.shields.io/travis/karma-runner/karma-sauce-launcher/master.svg?style=flat-square)](https://travis-ci.org/karma-runner/karma-sauce-launcher)\n\n\n![Karma Plus Sauce](/images/karma-plus-sauce.png)\n\n\u003e Run your unit tests on [Sauce Labs](https://saucelabs.com/)' browser cloud!\n\n\n## Installation\n\nInstall `karma-sauce-launcher` as a `devDependency` in your package.json:\n\n```bash\nnpm install karma-sauce-launcher --save-dev\n```\n\n## Usage\n\nThis 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](http://karma-runner.github.io/).\n\nThe [Sauce Labs platform configurator](https://wiki.saucelabs.com/display/DOCS/Platform+Configurator/#/) can help to find the correct configuration for your desired test platform.\n\n### Adding karma-sauce-launcher to an existing Karma config\n\nTo 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.\n\nThe `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:\n\n```js\nmodule.exports = function(config) {\n  // Example set of browsers to run on Sauce Labs\n  // Check out https://saucelabs.com/platforms for all browser/platform combos\n  var customLaunchers = {\n    // Old JSONWP way of setting the capabilities\n    sl_chrome: {\n      base: 'SauceLabs',\n      browserName: 'chrome',\n      platform: 'Windows 10',\n    },\n    sl_firefox: {\n      base: 'SauceLabs',\n      browserName: 'firefox',\n      version: 'latest'\n    },\n    sl_ie_11: {\n      base: 'SauceLabs',\n      browserName: 'internet explorer',\n      platform: 'Windows 8.1',\n    },\n    // Mobile settings\n    // 1. Go to https://wiki.saucelabs.com/display/DOCS/Platform+Configurator#/\n    // 2. Select Appium iOS,Android\n    // 3. Configure your device\n    //    Don't forget to provide the `appiumVersion`\n    sl_ios_safari: {\n      base: 'SauceLabs',\n      deviceName: 'iPhone 11 Simulator',\n      platformVersion: '13.4',\n      platformName: 'iOS',\n      browserName: 'Safari',\n      appiumVersion: '1.17.1',\n      deviceOrientation: 'portrait'\n    },\n    // !!!!IMPORTANT!!!!\n    // If you want to use an Android emulator then you can't use localhost.\n    // Because an Android emulator is a VM it will go to it's own localhost\n    // and the test will fail. Make change the `hostname` to your\n    // local ip\n    sl_android: {\n      base: 'SauceLabs',\n      deviceName: 'Android GoogleAPI Emulator',\n      platform: 'Android',\n      version: '11.0',\n      browserName: 'chrome',\n      appiumVersion: '1.18.1',\n      deviceOrientation: 'portrait'\n    },\n    // For W3C way of setting the capabilities check\n    // https://wiki.saucelabs.com/display/DOCS/Platform+Configurator#/\n    // And select WebDriver (W3C) Selenium 3/4, Webdriver.io\n    sl_chromeW3C: {\n      base: 'SauceLabs',\n      browserName: 'chrome',\n      browserVersion: 'latest',\n      'sauce:options':{\n        tags: ['w3c-chrome']\n      }\n    },\n  }\n\n  config.set({\n\n    // The rest of your karma config is here\n    // ...\n    sauceLabs: {\n        testName: 'Web App Unit Tests'\n    },\n    customLaunchers: customLaunchers,\n    browsers: Object.keys(customLaunchers),\n    reporters: ['dots', 'saucelabs'],\n    singleRun: true\n  })\n}\n```\n\n**Note: this config assumes that `process.env.SAUCE_USERNAME` and `process.env.SAUCE_ACCESS_KEY` are set.**\n\n### Example karma-sauce-launcher configs\n\nFor example configs using this launcher (using Travis CI), check out this repo's [karma file](https://github.com/karma-runner/karma-sauce-launcher/tree/master/examples/karma.conf-ci.js), or [AngularJS' Karma config](https://github.com/angular/angular.js/blob/master/karma-shared.conf.js).\n\n### Example results in Sauce Labs\nVersion `4.2.0` and lower of this module will give you the following result in Sauce Labs, no matter how many tests you execute.\n\n![Sauce Logs](/images/saucelabs-old.png)\n\nAs of version [4.3.0](https://github.com/karma-runner/karma-sauce-launcher/releases/tag/v4.3.0) the logs are replaced with the\ntest names and results of the individual tests that have been executed on Sauce Labs, including the execution url in the logs.\n\n**Successful run**\n![Sauce Successful Logs](/images/new-sauce-logs-success.png)\n\n**Unsuccessful run**\n![Sauce Successful Logs](/images/new-sauce-logs-failure.png)\n\n**Execution url**\n![Sauce Successful Logs](/images/sauce-execution-url.png)\n\n## `sauceLabs` config properties shared across all browsers\n\n### username\nType: `String`\nDefault: `process.env.SAUCE_USERNAME`\n\nYour Sauce Labs username (if you don't have an account, you can sign up [here](https://saucelabs.com/signup/plan/free)).\n\n### accessKey\nType: `String`\nDefault: `process.env.SAUCE_ACCESS_KEY`\n\nYour Sauce Labs access key which you will see on your [account page](https://saucelabs.com/account).\n\n### region\nType: `String`\n\nDetect datacenter to run tests in. Can be either `eu` or `us`.\n\n### headless\nType: `Boolean`\n\nIf 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.\n\n### proxy\nType: `String`\n\nProxy for connecting to Sauce REST API, which is used to communicate job updates of pass/fail.\n\n### startConnect\nType: `Boolean`\nDefault: `true`\n\nIf `true`, Sauce Connect will be started automatically.\nSet this to `false` if you are launching tests locally but want to start Sauce Connect via [a binary](https://wiki.saucelabs.com/display/DOCS/Downloading+Sauce+Connect+Proxy) manually in the background to improve test speed.\n\n### connectOptions\nType: `Object`\nDefault:\n```js\n{\n  username: 'yourUsername',\n  accessKey: 'yourAccessKey',\n  tunnelIdentifier: 'autoGeneratedTunnelID'\n}\n```\n\nOptions to send to Sauce Connect.\n\nCheck [here](https://wiki.saucelabs.com/display/DOCS/Sauce+Connect+Proxy+Command-Line+Quick+Reference+Guide) for all available options.\nAll parameters have to be applied camel cased instead of with hyphens.\n\n### build\nType: `String`\nDefault: *One of the following environment variables*:\n`process.env.BUILD_NUMBER`\n`process.env.BUILD_TAG`\n`process.env.CI_BUILD_NUMBER`\n`process.env.CI_BUILD_TAG`\n`process.env.TRAVIS_BUILD_NUMBER`\n`process.env.CIRCLE_BUILD_NUM`\n`process.env.DRONE_BUILD_NUMBER`\n\nID of the build currently running. This should be set by your CI.\n\n### testName\nType: `String`\nDefault: `'Karma test'`\n\nName of the unit test group you are running.\n\n### tunnelIdentifier\nType: `String`\n\nSauce Connect can proxy multiple sessions, this is an id of a session.\n\n### tags\nType: `Array of Strings`\n\nTags to use for filtering jobs in your Sauce Labs account.\n\n### recordVideo\nType: `Boolean`\nDefault: `false`\n\nSet to `true` if you want to record a video of your Karma session.\n\n### recordScreenshots\nType: `Boolean`\nDefault: `true`\n\nSet to `false` if you don't want to record screenshots.\n\n### public\nType: `String`\nDefault: `null`\n\nControl who can view job details. Available visibility levels are documented on\nthe [SauceLabs website](https://wiki.saucelabs.com/display/DOCS/Test+Configuration+Options#TestConfigurationOptions-JobVisibility).\n\n### customData\nType: `Object`\nDefault: `{}`\n\nSend arbitrary data alongside your tests. See\nthe [SauceLabs documentation](https://wiki.saucelabs.com/display/DOCS/Test+Configuration+Options#TestConfigurationOptions-CustomData)\nfor more details.\n\n\n## `customLaunchers` config properties\n\nThe `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.\n\n*Note: You can learn about the available browser/platform combos on the [Sauce Labs platforms page](https://saucelabs.com/platforms), [platforms configurator page](https://docs.saucelabs.com/reference/platforms-configurator/#/) and [REST API page](https://docs.saucelabs.com/reference/rest-api/#get-supported-platforms).*\n\n### base\nType: `String`\nRequired: `true`\n\nThis 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.\n\n### browserName\nType: `String`\nRequired: `true`\n\nName of the browser.\n\n### browserVersion\nType: `String`\nDefault: Latest browser version for all browsers except Chrome\n\nVersion of the browser to use.\n\n### platformName\nType: `String`\nDefault: `'Linux'` for Firefox/Chrome, `'Windows 7'` for IE/Safari\n\nName of platform to run browser on.\n\n### `sauce:options`\n\nSpecific Sauce Labs capability [options](https://wiki.saucelabs.com/display/DOCS/Test+Configuration+Options).\n\n## Behind the scenes\n\nThis 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](https://wiki.saucelabs.com/display/DOCS/Getting+Started+with+Sauce+Connect+Proxy).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkarma-runner%2Fkarma-sauce-launcher","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkarma-runner%2Fkarma-sauce-launcher","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkarma-runner%2Fkarma-sauce-launcher/lists"}