Last updated: Feb 22, 2021 14:18
The integration require that the following be installed:
If you connect via VPN, for smooth Cypress execution, make sure the following URLs are accessible from your network:
Access to the npm registry or any other custom registry you use
If these URLs are not accessible, Cypress execution may be limited in that executions will run, but Cypress will not run and no tests will be executed or shown in the SDK.
If you need to work behind a proxy when using the Perfecto-Cypress SDK, configure the following environment variable on your workstation: https_proxy
1 | Install Cypress
- Launch a terminal in your IDE.
- In the workspace folder, create a new folder, for example CypressSEDemo.
- Change to the new folder you created.
Run the following command to create the
To install Cypress, run the following command from the command line:
--save-devsaves it as a dependency in the
To launch Cypress, run the following command:
This launches the Cypress UI and also creates a
cypressfolder inside the new folder you created in step 1.Click to view image
- In the Cypress UI:
- Click any
*.spec.jsfile and launch it in the selected browser.
- Close the Cypress UI.
- Click any
2 | Install the Perfecto-Cypress SDK
Return to the workspace folder 'CypressSEDemo' by running the following command:
Install the Perfecto-Cypress SDK by running the following command:
To add Perfecto Cypress Reporter capabilities, run the following command:
3 | Initialize the Perfecto-Cypress SDK
Create the configuration files. 3 configuration files are required to run Cypress tests in Perfecto.
initcommand generates the following configuration files for you (if they do not exist):
- In the
perfecto-config.jsonfile, define the following:
- The cloud name, for example
demo. The SDK automatically adds
- The security token, either hard-coded or passed later as a parameter in the command line.
- The test specs you want to execute in the cloud, for example
- The cloud name, for example
package.jsonfile, specify one of the following Cypress versions. Otherwise, the execution takes an additional 4 minutes.
Import perfecto-cypress-reporter into the support file
cypress/support/index.jsby adding the following code:Click to view image
Use the following SDK commands as needed:
uploadFor more information on these commands, run the
4 | Execute Cypress test specs
For a quick execution, perform the following steps:
Run the command from terminal, as follows:
CypressSEDemois the name of the folder you created.
- Launch Perfecto and go to Test Analysis > Live Stream to view the live execution. When it is done, you can see the results based on the CI Job or Project, or you can open the report link that should appear in the command line window.
Following is a complete list of command line parameters, including the known reporting perfecto-cypress-sdk options to be passed.
When uploading a Cypress test suite to the Perfecto cloud, utilize the following command options:
After uploading a
.zip file to the cloud, the cloud admin should obtain the repository ID of that
.zip file and pass it through the
run command to be executed in the cloud. For example, if the repository ID is
PRIVATE:perfecto-cypress.zip, the command would be as follows:
|Specifies the credentials used to initiate the communication with Perfecto services.|
Can also be provided as a CLI parameter.
Specifies the path to the
This is also the folder that the SDK packs and uploads to the Perfecto cloud.
|Can be provided also as a CLI parameter.|
|Specifies a list of patterns to exclude from the tests' zip archive.||Optional|
|Specifies a pattern to guide the SDK which test specs to run.||Can be provided also as a CLI parameter|
Specifies the major Node.js version for the Cypress execution environment.
Specifies the environment variables that your Cypress tests need.
|Specifies information for Perfecto Smart Reporting. For more information, see Smart Reporting capabilities.||Optional|
"My Cypress project"
|The name used as the Report Name for the Report Library and Live Stream interfaces. See also Smart Reporting capabilities.||optional|