Skip to main content

Cucumber.js Integration

Add AI automation to your Cucumber.js project.

Installation

npm install openqa @playwright/test

Setup

Replace your step definitions with a single import:
// features/step_definitions/steps.js
import 'openqa/bdd/cucumber';

// Browser setup and all step definitions are handled automatically

Write Feature Files

Feature: Shopping Cart

  Scenario: Add product to cart
    Given I navigate to "https://shop.example.com"
    When I search for "laptop"
    And I add the first result to cart
    Then I should see "1 item" in the cart icon

Run Tests

npm test

Authentication

claude login

Notes

  • Browser lifecycle is managed automatically
  • Each scenario gets a fresh browser context
  • The AI agent shares state within a scenario