Skip to content

djgould/cypress-ai

Repository files navigation

THIS IS CURRENTLY AN EXPERIMENTAL PROJECT. YOU WILL PROBABLY GET ERRORS

cypress-ai

This Plugin leverages OpenAI to help give tips to debugging cypress tests when they fail.

Installation

npm install @djgould/cypress-ai --save-dev

Usage

cypress.config.ts

import { defineConfig } from 'cypress'
import { cypressAI } from '@djgould/cypress-ai'

export default defineConfig({
  e2e: {
    setupNodeEvents(on, config) {
      cypressAI(on, config, { apiKey: 'open ai api key' })
    }
  }
})

Include failed html in request to open ai

  1. Configure Cyclope to save page after failure here
  2. Add includeFailedHtml: true to options:
  cypressAI(on, config, { apiKey: 'open ai api key', includeFailedHtml: true })

Output

image

Contributing

  1. Create an project issue with proper description and expected behaviour
  2. NPM command npm run verify have to pass locally
  3. Provide a PR with implementation and tests

About

Use AI to help debug your cypress tests

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published