1.2.0 • Published 8 months ago
@zygow/dynawright v1.2.0
DynaWright
A utility to convert Playwright traces to Dynatrace Synthetic Monitoring DSL.
Installation
npm install @zygow/dynawrightUsage
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 filesoutput-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
- Clone the repository
- Install dependencies:
npm install - Build the project:
npm run build - Run tests:
npm test
License
MIT