Skip to main content

Examples

Explore working examples in the GitHub repository.

YAML Tests

Simple YAML format for writing tests. Best for getting started quickly.

Playwright

Standard Playwright tests using runAgent() directly.

Playwright-BDD (Simple)

One-line BDD integration with Gherkin feature files.

Playwright-BDD (Manual)

Manual BDD setup for more control.

OnKernel Cloud

BDD tests running on OnKernel cloud browsers.

Cucumber.js

Standard Cucumber.js with AI step definitions.

Sample YAML Test

name: TodoMVC Tests
url: https://demo.playwright.dev/todomvc/

tests:
  - name: Add todo item
    steps:
      - Navigate to the TodoMVC home page
      - Add a new todo item "Buy groceries"
      - Verify "Buy groceries" appears in the list

Sample Feature File

Feature: TodoMVC

  Scenario: Add todo item
    Given I navigate to "https://demo.playwright.dev/todomvc/"
    When I add a new todo item "Buy groceries"
    Then I should see "Buy groceries" in the todo list

Sample Playwright Test

import { test } from "@playwright/test";
import { runAgent } from "openqa";

test("Add todo", async ({ context }) => {
  await runAgent('Navigate to "https://demo.playwright.dev/todomvc/"', context);
  await runAgent('Add a new todo item "Buy groceries"', context);
  await runAgent('Verify "Buy groceries" appears in the list', context);
});