Generating the Test Code

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:

    • 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.

  5. Copy the generated code into your Cypress framework:

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

    2. Copy and paste the file yourTestName.cy.js into the folder ./cypress/e2e or the folder where your tests are located in your framework.

    3. 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');