Generating the Test Code | Applitools Documentation

On this page

After recording the test steps, you can download the Cypress code and autohealing data.

To Generate the Test Code:

  1. When you have completed all actions in the test, click Finish Test.

  2. Click Confirm.

  3. Enter a name for the test and click Create Test.

  4. Select one of the following options:

  1. Copy the generated code into your Cypress framework:

  2. Unzip the generated code downloaded to your download folder.

    1. Copy and paste the file yourTestName.cy.js into the folder ./cypress/e2e or the folder where your tests are located in your framework.
    2. 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 unique testDataId value on this line should match the value in the autoheal filename. For example:

a012f0a23f9e-PreflightCyTest_AutohealData.json

cy.initializeAutoheal('**a012f0a23f9e**');