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
On this page:
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.
To generate a security token-
In the Perfecto UI at <YourCloud>.app.perfectomobile.com (where YourCloud is your actual cloud name, such as mobilecloud), click your user name and select My security token.
-
In the My security token form, click Generate Security Token.
-
Click Copy to clipboard. Then paste it into any scripts that you want to run with Perfecto.
- Click Close.
-
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 |
---|---|
|
The Perfecto cloud URL, in the following format: |
|
A unique cryptographic key assigned to an authorized user. If you have not generated a security token yet, go back to the Prerequisites above. |