0.8.4 • Published 9 months ago

@applitools/testgenai-cypress v0.8.4

Weekly downloads
-
License
ISC
Repository
-
Last release
9 months ago

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

Installation

You can install the TestGenAI plugin using the following command:

npm install @applitools/testgenai-cypress

Configuration

Automatic Configuration

You can automatically configure the TestGenAI plugin by running the following command:

npx @applitools/testgenai-cypress init

Manual Configuration

If you encountered an error with the automatic configuration or prefer to configure the plugin manually, you can follow the steps below:

  1. Add following import to your cypress/support/e2e.js file
import '@applitools/testgenai-cypress/commands'
  1. Add following import to your cypress.config.js file
const { testGenAICypressTasksSetup } = require("@applitools/testgenai-cypress/tasks");
  1. Call the testGenAICypressTasksSetup function in the e2e setupNodeEvents configuration in your cypress.config.js file
module.exports = defineConfig({
  e2e: {
    setupNodeEvents(on, config) {
      testGenAICypressTasksSetup(on)
    },
  },
});
  1. Configure the plugin in your cypress.config.js file with env.applitoolsTestGenAI object
module.exports = defineConfig({
  env: {
    applitoolsTestGenAI: {
      autohealDataFolders: ['cypress/testgenai/autoheal']
    }
  },
});
  1. Add a folder named testgenai inside the cypress directory with two folders inside of it named autoheal and POMs. The final output should be ./cypress/testgenai/autoheal and ./cypress/testgenai/POMs.

Configuration

You can configure the TestGenAI plugin through the env.applitoolsTestGenAI object in your cypress.config.js file.

Example

module.exports = defineConfig({
    env: {
        applitoolsTestGenAI: {
            autohealDataFolders: ['cypress/testgenai/autoheal'],
            waitForNetworkCalls: {
                isEnabled: false
            },
            allowObscuredElements: false
        }
    },
});

Configuration Options

PropertyDefaultDescription
isEnabledtrueDisable/enable the Preflight Cypress plugin.
waitForNetworkCalls.isEnabledtrueWait for network calls to finish before continuing test.
waitForNetworkCalls.idle2000 (ms)Wait for network calls to be idle before continuing test.
waitForNetworkCalls.timeout60000 (ms)Maximum wait time for network calls to finish before continuing test.
autohealDataFolders[]A list of directory paths to the autoheal folder.
selectorGeneratorOptions.excludedAttributeTypes[]This is a list of selector attributes you wish to exclude in self-healing.
selectorGeneratorOptions.excludedAttributeValueKeywords[]A list of selector attributes containing keywords you wish to exclude in self-healing.
selectorGeneratorOptions.includedAttributeTypes[]A list of selector attributes you prefer to include in self-healing.
generateFixedTeststrueGenerate auto-healed tests.
getElementTimeout60000 (ms)Maximum time to wait for an element to appear.
ifExistsTimeout3000 (ms)Maximum time to wait for an element to exist.
allowObscuredElementstrueAllow obscured elements.
waitToDisappear.searchElementTimeout10000 (ms)Maximum time to wait for an element to appear before waiting for it to disappear.
waitToDisappear.timeout90000 (ms)Maximum time to wait for an element to disappear.
debug.fileLogEnabledfalseEnable debug logging and generate a log file in the debug folder.
debug.recordTestRunfalseEnable debug recording of test execution and generates a zip file in the debug folder.
0.8.4

9 months ago

0.8.1

9 months ago

0.8.0

9 months ago

0.8.3

9 months ago

0.8.2

9 months ago

0.7.9

11 months ago

0.7.8

11 months ago

0.7.7

11 months ago

0.7.5

1 year ago

0.7.4

1 year ago

0.7.3

1 year ago

0.7.2

1 year ago

0.7.1

1 year ago

0.7.0

1 year ago

0.6.8

1 year ago

0.6.7

1 year ago

0.6.6

1 year ago

0.6.5

1 year ago

0.6.3

1 year ago

0.6.2

1 year ago

0.6.1

1 year ago

0.6.0

1 year ago

0.5.0

1 year ago

0.4.0

1 year ago

0.3.0

1 year ago

0.2.0

1 year ago

0.1.0

1 year ago