1. testswarm
Nodejs module for interacting with TestSwarm
testswarm
Package: testswarm
Created by: jzaefferer
Last modified: Sun, 12 Feb 2023 07:15:20 GMT
Version: 1.1.2
Downloads: 10,655
Repository: https://github.com/jzaefferer/node-testswarm

Install

npm install testswarm
yarn add testswarm

Build Status NPM version

node-testswarm

Nodejs module for interacting with TestSwarm

Getting Started

Install the module with:

npm install --save-dev testswarm
 var testswarm = require( "./lib/testswarm" ),
	testUrl = "http://localhost/jquery-core/test/",
	runs = {};

["attributes", "callbacks"].forEach(function (suite) {
	runs[suite] = testUrl + "?module=" + suite;
});

testswarm.createClient({
	url: "http://localhost/testswarm/"
})
.addReporter( testswarm.reporters.cli )
.auth({
	id: "example",
	token: "yourauthtoken"
})
.addjob(
	{
		name: "node-testswarm test job",
		runs: runs,
		browserSets: [ "example" ],
	}, function( err, passed ) {
		if ( err ) {
			throw err;
		}
		process.exit( passed ? 0 : 1 );
	}
);

For local testing, copy sample-test.js to test.js and modify to match your local TestSwarm setup.

API

createClient({ url })

  • Object config
  • String url - Url to root of TestSwarm install.

Client#addReporter( reporter )

  • Object reporter - usually testswarm.reporters.cli, unless you want to use a custom reporter

Client#auth({ id, token })

  • Object auth
  • String id - Username of TestSwarm account.
  • String token - Authentication token of account.

Client#addjob( options, callback )

  • Object options
  • String name - name of this job
  • Number runMax - [optional] how often failed tests should rerun
  • Object runs - Run urls by run name.
  • Array|String browserSets - which sets to test against
  • Number pollInterval - [optional] In milliseconds, default 5 seconds.
  • Number timeout - [optional] In milliseconds, default 15 minutes.
  • Function( Object err, Boolean passed, Object results ) callback

License

Copyright (c) 2014 Jörn Zaefferer
Licensed under the MIT license.

Dependencies

RELATED POST

10 Must-Know Windows Shortcuts That Will Save You Time

10 Must-Know Windows Shortcuts That Will Save You Time

Arrays vs Linked Lists: Which is Better for Memory Management in Data Structures?

Arrays vs Linked Lists: Which is Better for Memory Management in Data Structures?

Navigating AWS Networking: Essential Hacks for Smooth Operation

Navigating AWS Networking: Essential Hacks for Smooth Operation

Achieving Stunning Visuals with Unity's Global Illumination

Achieving Stunning Visuals with Unity's Global Illumination

Nim's Hidden Gems: Lesser-known Features for Writing Efficient Code

Nim's Hidden Gems: Lesser-known Features for Writing Efficient Code