@applitools/testgenai-cypress
TypeScript icon, indicating that this package has built-in type declarations

0.8.23 • Public • Published

Applitools TestGenAI Plugin for Cypress

Applitools TestGenAI enables both technical and non-technical team members to expand test coverage effectively. This inclusivity allows non-technical participants to engage in test automation, helping to distribute the workload more efficiently across the team.

Advantages of TestGenAI:

  • Time-savings: It swiftly records user actions, generating test cases without the need to write manual code for each step.
  • Self-Healing and Robust Tests: The tool automates mundane tasks like filling in forms and provides amenities that improve the overall quality of the generated test code, making tests more robust and easier to maintain over time.
  • Modern Test Coverage: Quickly create modern test coverage in code using Cypress, which includes industry best practices and allows easy migration from existing test implementations, such as Selenium, to Cypress.
  • Facilitates non-developers involvement in test automation, effectively distributing the test creation workload.
  • Automatic reusable variable generation.
  • Page Object Model generation to make code more efficient and tests more readable.

If you have any questions, please visit our documentation or contact us at support@applitools.com

Getting Started

Installation

npm install @applitools/testgenai-cypress

Initial Setup

Option 1: Automatic Setup

You can automatically configure the TestGenAI plugin by running:

npx @applitools/testgenai-cypress init

Option 2: Manual Setup

If you prefer manual setup or encountered issues with automatic configuration:

  1. Add to your cypress/support/e2e.js:
import '@applitools/testgenai-cypress/commands'
  1. Add to your cypress.config.js:
const { testGenAICypressTasksSetup } = require("@applitools/testgenai-cypress/tasks");

module.exports = defineConfig({
  e2e: {
    setupNodeEvents(on, config) {
      testGenAICypressTasksSetup(on)
    },
  },
});
  1. Create required directories:
    • Create a testgenai folder inside your cypress directory
    • Inside testgenai, create two folders: autoheal and POMs
    • Final structure: ./cypress/testgenai/autoheal and ./cypress/testgenai/POMs

Configuration

Using Configuration Options

Configure the TestGenAI plugin through the env.applitoolsTestGenAI object in your cypress.config.js. Here's an example combining various options:

module.exports = defineConfig({
  env: {
    applitoolsTestGenAI: {
      // Basic configuration
      isEnabled: true,
      autohealDataFolders: ['cypress/testgenai/autoheal'],

      // Network settings
      waitForNetworkCalls: {
        isEnabled: true,
        idle: 3000,
        timeout: 30000
      },

      // Element timing settings
      getElementTimeout: 30000,
      ifExistsTimeout: 5000,

      // Debug settings
      debug: {
        fileLogEnabled: true,
        recordTestRun: false
      }
    }
  },
});

All configuration options are optional and will use their default values if not specified.

Configuration Options Reference

Core Settings

Option Default Description
isEnabled true Disable/enable the Preflight Cypress plugin
generateFixedTests true Generate auto-healed tests
allowObscuredElements true Allow obscured elements
forceActions false Forces interactions with elements even when they're covered by other elements or not fully visible.

Network Settings

Option Default Description
waitForNetworkCalls.isEnabled true Wait for network calls to finish before continuing test
waitForNetworkCalls.idle 2000ms Wait for network calls to be idle before continuing
waitForNetworkCalls.timeout 60000ms Maximum wait time for network calls to finish

Element Timing Settings

Option Default Description
getElementTimeout 60000ms Maximum time to wait for an element to appear
ifExistsTimeout 3000ms Maximum time to wait for an element to exist
waitToDisappear.searchElementTimeout 10000ms Maximum time to wait for an element to appear before waiting for it to disappear
waitToDisappear.timeout 90000ms Maximum time to wait for an element to disappear

Selector and Auto-healing Settings

Option Default Description
autohealDataFolders [] A list of directory paths to the autoheal folder
selectorGeneratorOptions.excludedAttributeTypes [] List of selector attributes to exclude in self-healing
selectorGeneratorOptions.excludedAttributeValueKeywords [] List of selector attributes containing keywords to exclude in self-healing
selectorGeneratorOptions.includedAttributeTypes [] List of selector attributes to prefer in self-healing

Debug Settings

Option Default Description
debug.fileLogEnabled false Enable debug logging and generate a log file in the debug folder
debug.recordTestRun false Enable debug recording of test execution and generate a zip file in the debug folder

Package Sidebar

Install

npm i @applitools/testgenai-cypress

Weekly Downloads

153

Version

0.8.23

License

ISC

Unpacked Size

2.91 MB

Total Files

314

Last publish

Collaborators

  • danielputerman
  • gearm
  • amitzur
  • ramapplitools
  • amit.rokach
  • roy.sela
  • applitools-admin
  • applitools-readonly
  • iasisapp
  • noam.mendel
  • arik-applitools
  • yotammadem
  • denis.styrt
  • kyrylo.onufriiev
  • amitzur-applitools
  • yardenw.applitools
  • ormeda
  • vgprod
  • clementbarry
  • gofilord
  • alex.burdeynyy
  • chaimaharonson
  • ronikar_applitools
  • benny.halberstadt
  • itaibh-applitools
  • grayscale64
  • fatihsolhan-applitools
  • itaiz134
  • dockermaster
  • anandbagmar
  • sergovapplitools
  • eirenik0
  • mmilapp
  • noam.gaash
  • roeefr
  • livgerti
  • netta.bondy
  • anastasia.koifman
  • mkowalew3382
  • noamshv
  • aretm_borodavka
  • amir.groisman
  • netaavivi
  • shai.shlomai
  • adamcarmi
  • movsho
  • shirbin