cypress Plugin
This page will show you how to configure and use the step plugin for cypress. The cypress plugin allows you to declare step Keywords that run cypress commands and thus leverage the combined power of step and cypress.
Setup
The cypress plugin is a beta feature currently incubating as part of the enterprise version of step. The cypress plugin is enabled per default in step enterprise. To use the plugin you simply have to install cypress on the step Agents you’ll want to run cypress Keywords on:
-
Install cypress following the official cypress documentation
-
Test the installation
npx cypress open
That’s it!
Declaring a cypress Keyword
You can declare cypress Keywords and use these Keywords within Plans like any other step Keyword. To declare a cypress Keyword:
-
Open step
-
Navigate to Keywords
-
Click “New keyword”
-
On the Keyword creation dialog
-
Enter a name for your Keyword
-
Select “cypress” as Keyword type. If you don’t find “cypress” in the list, you might be using the open-source edition of step
-
Enter the cypress command or script. Example: cy.visit(“https://exense.ch”)
-
Enter the base URL related to the command. Important: the base URL should match with the one used within the command
-
Creating a plan with cypress Keywords
Creating a Plan with cypress Keywords is as easy as with any other Keyword.
-
Open step
-
Navigate to Plans
-
Create a new Plan
-
Select your cypress Keywords from the Keyword list and add them to the plan
Running a plan with cypress Keywords
Once you’ve created your Plan, run it by clicking on the Play button as documented here
The execution report looks the same as with other Keywords. If the Parameter debug is to true a screenshot will be generated after each Keyword execution.
In addition to the measurement of the whole Keyword response time, a performance measurement for each cypress command is generated and can be analyzed under the Performance tab
Limitations
In its current beta version the cypress plugin has following limitations:
-
Keyword inputs and outputs are not supported. Support for inputs will be added soon
-
Only native cypress commands are supported. Support for custom commands will be added soon
-
Using Keywords with different Base URLs within one test case is not supported