ply-ct / vscode-ply

API Automated Testing
https://ply-ct.org
MIT License
44 stars 1 forks source link
graphql nodejs ply rest-api testing typescript visual-studio-code workflow

ply

API Automated Testing
Ply your wares

GitHub Workflow Status VS Code Marketplace CodeQL

Ply is simply a more intuitive way of autotesting your REST and GraphQL APIs. Create and run HTTP requests using Ply's visual request editor.

request-recording

Then reuse your requests in Ply's graphical flow builder.

flow-recording

Or edit raw YAML describing your request sequence. Run Ply to submit these requests and compare actual results against expected, with template literal placeholders for dynamic values.

The Ply extension gives you a side-by-side diff view so you can compare results at a glance.

diff

Checkmarks indicate diff lines that're okay, such as substituted values or comments; whereas Xs indicate significant differences causing test failure(s).

When you need even greater control, Ply cases give you programmatic access via TypeScript to supplement this built-in expected/actual verification.

Features

Dependencies

Requires Test Explorer UI extension.

Configuration

Ply configuration is read from plyconfig.json/yaml. Other values are configured through vscode settings:

Setting Description Default
ply.logpanel Write detailed log output to the Ply Invoker output panel false
ply.websocketPort WebSocket port for Ply flow live updates (0 to disable). Modify in Workspace settings to avoid conflicts. 9351
ply.customSteps Glob pattern for step descriptor JSON files, relative to workspace folder
ply.debugPort Port to use for debug connections 9229
ply.debugConfig Name of a launch configuration to use for debugging (see below)
ply.nodePath Path to node executable Find on your PATH; if not found, use node shipped with VS Code
ply.plyPath Path to ply package (relative to workspace folder) eg: "node_modules/@ply-ct/ply" Use a bundled version of ply
ply.cwd Working directory for Ply test execution (relative to workspace folder) Workspace folder root
ply.env Environment variables to apply for Ply test execution
ply.saveBeforeRun Automatically save dirty test editor documents before running true
ply.openRequestsAndFlowsWhenRun Automatically open requests/flows in custom editor when executing from Ply Explorer If Single (running a single suite)
ply.plyExplorerUseRequestEditor When opening individual requests within flow/request suites from Ply Explorer, open in request editor true
ply.useDist TODO false
ply.requireTsNode TODO false
ply.previewEnabled Enable Ply preview features false

Custom debug configuration

You can specify a custom vscode debug configuration to use for Ply cases instead of the built-in default. Do this by creating a debugging configuration in .vscode/launch.json. Then specify the name of that in setting ply.debugConfig. The default built-in debug configuration looks like this:

{
  "name": "Ply Debugging",
  "type": "node",
  "request": "attach",
  "port": 9229,
  "protocol": "inspector",
  "timeout": 10000,
  "continueOnAttach": true
}

Troubleshooting

If your Ply tests are not displayed or not executing correctly, you can diagnose problems by turning on logging to "Ply Invoker" in Output view through this VS Code setting: