1.2.0 • Published 4 months ago

@zygow/dynawright v1.2.0

Weekly downloads
-
License
MIT
Repository
-
Last release
4 months ago

DynaWright

A utility to convert Playwright traces to Dynatrace Synthetic Monitoring DSL.

Installation

npm install @zygow/dynawright

Usage

As a Command Line Tool

npx @zygow/dynawright <input-path> [output-dir]
  • input-path: Path to a Playwright trace zip file or directory containing trace files
  • output-dir: (Optional) Directory to save the generated Dynatrace DSL files. Defaults to 'dynatrace-scripts'

As a Library

import { DynaWright } from "@zygow/dynawright"

const converter = new DynaWright({
  browserType: "chrome",
  deviceType: "desktop",
  viewport: { width: 1920, height: 1080 },
})

// Convert a single trace file
await converter.convertTrace("path/to/trace.zip", "output/dynatrace.json")

// Process a directory of trace files
await converter.processDirectory("path/to/traces", "output/dynatrace-scripts")

Options

The DynaWright constructor accepts the following options:

interface DynaWrightOptions {
  browserType?: string // Default: 'chrome'
  deviceType?: string // Default: 'desktop'
  viewport?: {
    // Default: { width: 1920, height: 1080 }
    width: number
    height: number
  }
}

Supported Playwright Actions

DynaWright supports converting the following Playwright actions to Dynatrace DSL:

  • Navigation (goto, navigate)
  • Clicking (click, dblclick)
  • Text input (fill, typeText)
  • Keyboard actions (press, keyboard.press)
  • Select options (selectOption)
  • Checkboxes (check, uncheck)
  • Waiting (waitForTimeout, waitForSelector)
  • Screenshots (screenshot)
  • Mouse movement (hover)
  • Assertions (expect)

Development

  1. Clone the repository
  2. Install dependencies: npm install
  3. Build the project: npm run build
  4. Run tests: npm test

License

MIT

1.2.0

4 months ago

1.1.0

4 months ago