Generating the Test Code
After recording the test steps, you can download the Cypress code and autohealing data.
To Generate the Test Code:
-
When you have completed all actions in the test, click Finish Test.
-
Click Confirm.
-
Enter a name for the test and click Create Test.
-
Select one of the following options:
-
Copy Test
Copies the Cypress code to your clipboard.
-
Copy Autoheal Data
Copies the autoheal JSON data to your clipboard.
-
Download All
Downloads a zip file containing the Cypress and Autoheal code.
-
-
Copy the generated code into your Cypress framework:
-
Unzip the generated code downloaded to your download folder.
-
Copy and paste the file
yourTestName.cy.js
into the folder./cypress/e2e
or the folder where your tests are located in your framework. -
Copy and paste the file
<testDataId>-PreflightCyTest_AutohealData.json
into the folder./cypress/testgenai/autoheal
.
Note: The
yourTestName.cy.js
test will contain an initialization step to import the corresponding self-healing JSON file. The uniquetestDataId
value on this line should match the value in the autoheal filename. For example:a012f0a23f9e-PreflightCyTest_AutohealData.json
cy.initializeAutoheal('a012f0a23f9e');
-