@applitools/testgenai-cypress

中文文档
0.8.23发布于 2025/04/01ISCTypeScriptESM + CJS近 30 天下载 4545

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

原始使用文档
文档目录6 节
  1. Getting Started
  2. Installation
  3. Initial Setup
  4. Configuration
  5. Using Configuration Options
  6. Configuration Options Reference

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 [email protected]

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

OptionDefaultDescription
isEnabledtrueDisable/enable the Preflight Cypress plugin
generateFixedTeststrueGenerate auto-healed tests
allowObscuredElementstrueAllow obscured elements
forceActionsfalseForces interactions with elements even when they're covered by other elements or not fully visible.

Network Settings

OptionDefaultDescription
waitForNetworkCalls.isEnabledtrueWait for network calls to finish before continuing test
waitForNetworkCalls.idle2000msWait for network calls to be idle before continuing
waitForNetworkCalls.timeout60000msMaximum wait time for network calls to finish

Element Timing Settings

OptionDefaultDescription
getElementTimeout60000msMaximum time to wait for an element to appear
ifExistsTimeout3000msMaximum time to wait for an element to exist
waitToDisappear.searchElementTimeout10000msMaximum time to wait for an element to appear before waiting for it to disappear
waitToDisappear.timeout90000msMaximum time to wait for an element to disappear

Selector and Auto-healing Settings

OptionDefaultDescription
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

OptionDefaultDescription
debug.fileLogEnabledfalseEnable debug logging and generate a log file in the debug folder
debug.recordTestRunfalseEnable debug recording of test execution and generate a zip file in the debug folder

版本与发布记录

@applitools/testgenai-cypress 共发布 46 个版本,首次发布于 2024/06/14;过去 12 个月发布了 0 个版本。

版本发布日期距今
0.8.23latest2025/04/011.6 年前
0.8.222025/03/241.6 年前
0.8.212025/02/211.7 年前
0.8.202025/02/201.7 年前
0.8.192025/02/201.7 年前
0.8.182025/02/201.7 年前

关于 @applitools/testgenai-cypress 的常见问题

@applitools/testgenai-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

如何安装 @applitools/testgenai-cypress?

在项目目录运行 npm install @applitools/testgenai-cypress,或使用 pnpm add / yarn add / bun add。它还提供命令行工具 init,可以用 npx init 直接运行。

@applitools/testgenai-cypress 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@applitools/testgenai-cypress 支持 ESM 还是 CommonJS?

同时提供 ES Module 与 CommonJS 入口,import 和 require() 都可以使用,打包工具会自动选择合适的版本。

@applitools/testgenai-cypress 可以商用吗?

@applitools/testgenai-cypress 使用 ISC 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@applitools/testgenai-cypress 的下载量有多少?

根据 npm 官方下载统计,@applitools/testgenai-cypress 在 2026/10/07 – 2026/11/05 这 30 天内被下载 4,545 次,日均约 152 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@applitools/testgenai-cypress 还在维护吗?

最新版本 0.8.23 发布于 2025/04/01(1.6 年前);至今共发布 46 个版本,其中过去 12 个月发布了 0 个;首次发布于 2024/06/14。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。