Registry / testing / pw2art

pw2art

JSON →
library1.0.0jsnpmunverified

pw2art is a Babel plugin that transpiles standard Playwright test syntax into syntax compatible with the Artillery Playwright engine. Version 1.0.0 is the initial stable release. It automates the conversion of Playwright tests for use with Artillery's load testing engine, reducing manual rewriting. Key differentiator: eliminates the tedious process of adapting Playwright scripts for Artillery, enabling reuse of existing test suites for performance testing. Release cadence is not yet established.

npm install pw2art
INSTALL
IMPORT
SIG · PW2ART
P
pw2art
testingjavascriptv1.0.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default
import pw2art from 'pw2art'
const pw2art = require('pw2art')
Package is ESM-only.
transform
import { transform } from 'pw2art'
const { transform } = require('pw2art')
Named export for programmatic use.
babelPluginPw2art
import { babelPluginPw2art } from 'pw2art'
const { babelPluginPw2art } = require('pw2art')
Use as Babel plugin in .babelrc or babel.config.js

Shows how to import pw2art, define source Playwright test, transpile to Artillery syntax, and log result.

import pw2art from 'pw2art'; import { transform } from 'pw2art'; // Example Playwright test code const playwrightCode = ` import { test, expect } from '@playwright/test'; test('example test', async ({ page }) => { await page.goto('https://example.com'); const title = await page.title(); expect(title).toBe('Example Domain'); }); `; // Transform to Artillery syntax const result = transform(playwrightCode, { imports: false }); console.log(result.code);
Debug
Known issues
breakingVersion 1.0.0 only supports a subset of Playwright API.
fix
Ensure your Playwright test uses only supported methods (page.goto, page.click, etc.). Check documentation for full list.
affects: 1.0.0
deprecatedThe transform function may change in future releases.
fix
Pin to specific version if using programmatic API.
affects: 1.0.0
gotchaTranspiled code may require manual adjustments for complex selectors or assertions.
fix
Review output and modify Artillery YAML configuration as needed.
affects: 1.0.0
Errors
Common errors & fixes
ReferenceError: require is not defined
Using CommonJS require on ESM-only package.
fix
Use import syntax or change to ES module.
TypeError: transform is not a function
Incorrect import (default vs named).
fix
Use import { transform } from 'pw2art'.
Error: Not a valid Babel plugin
Trying to use pw2art directly as Babel plugin without wrapper.
fix
Use babelPluginPw2art export or configure via .babelrc with require('pw2art').babelPluginPw2art.
Upgrade
Version history
1.0.0latest on npm
Audit
Dependencies
babelrequiredBabel is the transpiler framework
playwrightoptionalSource tests use Playwright syntax
Agent activity
6 hits · last 30 days
node
6
Resources
pw2art — npm install pw2art · libregistry