{"id":26134,"library":"pw2art","title":"pw2art – Babel plugin for Playwright to Artillery transpilation","description":"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.","status":"active","version":"1.0.0","language":"javascript","source_language":"en","source_url":null,"tags":["javascript"],"install":[{"cmd":"npm install pw2art","lang":"bash","label":"npm"},{"cmd":"yarn add pw2art","lang":"bash","label":"yarn"},{"cmd":"pnpm add pw2art","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Babel is the transpiler framework","package":"babel","optional":false},{"reason":"Source tests use Playwright syntax","package":"playwright","optional":true}],"imports":[{"note":"Package is ESM-only.","wrong":"const pw2art = require('pw2art')","symbol":"default","correct":"import pw2art from 'pw2art'"},{"note":"Named export for programmatic use.","wrong":"const { transform } = require('pw2art')","symbol":"transform","correct":"import { transform } from 'pw2art'"},{"note":"Use as Babel plugin in .babelrc or babel.config.js","wrong":"const { babelPluginPw2art } = require('pw2art')","symbol":"babelPluginPw2art","correct":"import { babelPluginPw2art } from 'pw2art'"}],"quickstart":{"code":"import pw2art from 'pw2art';\nimport { transform } from 'pw2art';\n\n// Example Playwright test code\nconst playwrightCode = `\nimport { test, expect } from '@playwright/test';\n\ntest('example test', async ({ page }) => {\n  await page.goto('https://example.com');\n  const title = await page.title();\n  expect(title).toBe('Example Domain');\n});\n`;\n\n// Transform to Artillery syntax\nconst result = transform(playwrightCode, { imports: false });\nconsole.log(result.code);\n","lang":"typescript","description":"Shows how to import pw2art, define source Playwright test, transpile to Artillery syntax, and log result."},"warnings":[{"fix":"Ensure your Playwright test uses only supported methods (page.goto, page.click, etc.). Check documentation for full list.","message":"Version 1.0.0 only supports a subset of Playwright API.","severity":"breaking","affected_versions":"1.0.0"},{"fix":"Pin to specific version if using programmatic API.","message":"The transform function may change in future releases.","severity":"deprecated","affected_versions":"1.0.0"},{"fix":"Review output and modify Artillery YAML configuration as needed.","message":"Transpiled code may require manual adjustments for complex selectors or assertions.","severity":"gotcha","affected_versions":"1.0.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Use import syntax or change to ES module.","cause":"Using CommonJS require on ESM-only package.","error":"ReferenceError: require is not defined"},{"fix":"Use import { transform } from 'pw2art'.","cause":"Incorrect import (default vs named).","error":"TypeError: transform is not a function"},{"fix":"Use babelPluginPw2art export or configure via .babelrc with require('pw2art').babelPluginPw2art.","cause":"Trying to use pw2art directly as Babel plugin without wrapper.","error":"Error: Not a valid Babel plugin"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}