VSCode Extension

Requirements

Before installing Plato, ensure you have:

  • Visual Studio Code version 1.96.0 or higher
  • Node.js 18 or higher
  • A compatible API key from OpenAI, Anthropic, or Google AI

Installation steps

  1. Open Visual Studio Code
  2. Open the Extensions view:
    • Windows/Linux: Ctrl+Shift+X
    • macOS: Cmd+Shift+X
  3. Search for "Plato"
  4. Click Install
  5. Reload VSCode when prompted

Verifying installation

To verify the installation:

  1. Open the Command Palette (Ctrl+Shift+P or Cmd+Shift+P)
  2. Type "Plato"
  3. You should see all Plato commands listed

Initial configuration

API key setup

Plato supports multiple AI models:

To change models in VSCode:

  • Run "Plato: Set Model"
  • Select from the available options
  • Enter your API key when prompted

Your API key is stored securely in your system's keychain/credentials manager.

Extension settings

Access settings through:

  • Command Palette → "Preferences: Open Settings (UI)"
  • Search for "Plato"

Available settings:

  • plato.defaultModel: Set your preferred default model

Working Set configuration

The working set is your collection of pages to test:

  1. Open the Plato sidebar
  2. Click "Add Page" to add URLs
  3. Organize your pages by related functionality

Plato can't see the Playwright selectors unless you add it to the working set.

Basic usage

Setting up

  1. Open the Plato sidebar in VSCode (look for the Test icon (a flask) in the Activity Bar)
  2. Click "Set Model" to choose your preferred AI model
  3. Enter your API key when prompted

Working with pages

The extension uses a "Working Set" - a collection of pages you want to test. To manage your working set:

  • Click "Add Page" to add a URL to your working set
  • Use "Remove Page" to remove a URL
  • "Clear Working Set" removes all pages

Generating tests

  1. Add the pages you want to test to your working set
  2. Type your test requirements in natural language, preceded with a /command
  3. Press Enter to generate the test

Example prompt:

/test Navigate to the login page, enter invalid credentials, and verify the error message

Tips

  • Use specific, clear instructions when generating tests
  • Add all related pages to your working set before generating tests
  • The extension generates TypeScript tests by default
  • Generated tests include proper assertions and error handling

Review and modify generated tests as needed. While the AI generates good tests, you should always verify they match your requirements.