npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

testcafe-browserstack

v0.1.4

Published

Add remote workers from the BrowserStack web service to the TestCafe.

Downloads

6

Readme

Add remote workers from the BrowserStack web service to the TestCafe

This module allows to enrich the TestCafe browsers list by adding remote workers from the BrowserStack web site that provides a large list of browsers for testing.

The module contains a set of functions that help to initialise, create and remove a remote worker.

Installation

npm install testcafe-browserstack

init ( config, callback )

Module initialization

  • config: Configuration that is required for the module initialization

    • TestCafe: TestCafe Configuration
      • hostname: The hostname of your computer
      • controlPanelPort: The port number where you can access TestCafe Control Panel
      • servicePort1: The number of the first port used to perform testing
      • servicePort2: The number of the second port used to perform testing
    • BrowserStack: BrowserStack Configuration
      • username: Your BrowserStack username
      • password: Your BrowserStack password
      • accessKey: Your BrowserStack access key
      • localTesting: true if your TestCafe is installed in the local PC, otherwise false
  • callback( function() ): Invokes when the initialization is completed

createWorkers( browsers, callback )

Creates new BrowserStack workers and returns an array of workers ids.

  • browsers: An array of browsers objects from the BrowserStack service
    • browserObject
      • os: The operation system
      • os_version: The operation system version
      • browser: The browser name
      • browser_version: The browser version
      • device: The device name
      • worker_name: The worker name that will be used by TestCafe to identify the browser for test execution
  • callback( function( workerIds ) ): Invoked when workers are created
    • workerIds: An array of workers id

removeWorkers( workerIds, callback )

Delete the specified BrowserStack workers.

  • workerIds: An array of workers id
  • callback( function() ): Invokes when the specified workers are deleted

removeAllWorkers ( callback )

Delete all BrowserStack workers.

  • callback( function() ): Invokes when all workers are deleted

Example

This example demonstrates how to create a new worker for running tests in Chrome with the OS X Snow Leopard operating system. The worker is created in a local TestCafe instance.

var testCafeBrowserStack = require('testcafe-browserstack');

testCafeBrowserStack.init({
    TestCafe: {
        hostname: '127.0.0.1',
        controlPanelPort: 1337,
        servicePort1: 1338,
        servicePort2: 1339
    },
    BrowserStack: {
        username: 'username',
        password: 'password',
        accessKey: 'accessKey',
        localTesting: true
    }
}, function(err) {
    if (!err) {
        testCafeBrowserStack.createWorkers([{
            os: 'OS X',
            os_version: 'Snow Leopard',
            browser: 'chrome',
            browser_version: 'latest',
            device: null
        }], function(workerIds, err) {
            if (err)
                console.error(err);
            else
                console.log('All workers are created!')
        });
    } else
        console.error(err);
});

Check if a required browser is supported by BrowserStack: a list of supported browsers.

https://www.browserstack.com/list-of-browsers-and-platforms?product=live