Resources
VS Code Extension

Artillery VS Code Extension

Overview

Artillery has created a VS Code extension to simplify the process of writing Artillery test scripts. This guide provides additional information about the extension.

This extension is currently in early adoption. We are actively working on improving it, and would love to hear your feedback!

Features

  • Intellisense: Browse the list of all available test script options. Use CTRL+SPACE at any point in the test script to see a list of all available options in-place;
  • Context on hovering: Hover over most Artillery options to see a description of what it does, and a link to more information in our documentation where relevant;
  • Inline test runs: Run your test script directly from VS Code, and see the results in the output window.

Installation and Usage

You can check out configuration directly from the VS Code Marketplace (opens in a new tab), and install it from there or directly from VS Code.

JSON Schema

The JSON schema powering the VS Code Extension is available on our website, here (opens in a new tab). It gets regularly updated as we make improvements to Artillery and to the Schema.

Running in other editors

Because we use JSON schema to power the extension, it's actually possible to leverage that JSON schema in other editors. Please refer to the documentation for your editor on how to use JSON schema in your editor. We recommend you toggle the JSON schema on specific files or patterns, rather than on all YAML files, as the schema is specific to Artillery.

Here are a few examples of other editors and the link to their documentation:

Known Limitations and Issues

  • before/after[].flow: the flow property of these hooks is not currently typed by the JSON schema. You can still fill in with any values but won't have intellisense;
  • Unspecified engine (default http): If you do not specify an engine, Artillery's default behaviour is to use the http engine. In the VS Code Extension, you will see the options of all known engine types (but you will still have intellisense);
  • Clear extension cache: For any issues with the JSON schema loading (e.g. an error mentioning multiple schemas), try using the Clear Extension Cache command in the VS Code Command Palette (Mac: CMD+SHIFT+P | Win: CTRL+SHIFT+P);
  • Fresh workspace: If you did not have any Artillery files in your workspace at the time of starting VS Code in it, and then create an Artillery file, the Extension may not start. You can reload the window (Mac: CMD+SHIFT+P | Win: CTRL+SHIFT+P and type Developer: Reload Window) and the extension should then start and recognize any Artillery files in your workspace from then on;
  • Inline test runs: You cannot specify any CLI flags when running tests using the VS Code command. This feature is meant for simple tests and debugging, not for running complex tests.