0.2.0 • Published 1 month ago

@djgould/cypress-ai v0.2.0

Weekly downloads
-
License
MIT
Repository
github
Last release
1 month ago

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