Karma

Karma is a tool that runs Javascript tests on node.js in multiple, real browsers. This section explains how to use Karma with Perfecto

For the source code of the Perfecto plugin and a sample configuration file, see the following GitHub project: https://github.com/PerfectoCode/karma-perfecto-launcher

Important: This document includes references to a third-party product, Karma. The user interface and usage of third-party products are subject to change without notice. For the latest published information about Karma, see https://karma-runner.github.io/latest/intro/installation.html.

Prerequisites

Running Karma with Perfectorequires:

  • An installation of Karma. For instructions, see https://karma-runner.github.io/latest/intro/installation.html.
  • A network connection to ensure that the browser has access to the local host. You may have to install Perfecto Connect or implement custom network settings.
  • A Perfecto security token for the user running the tests.

Installation

To install the plugin for the Perfecto integration, run the following command:

npm install karma-perfecto-launcher

Sample configuration

For a sample configuration, see the karma.conf.js file. The following configuration parameters are mandatory:

Parameter

Description

perfectoUrl

The Perfecto cloud URL, in the following format: https://<yourcloud>.perfectomobile.com
Example: demo.perfectomobile.com

securityToken

A unique cryptographic key assigned to an authorized user. If you have not generated a security token yet, go back to the Prerequisites above.