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
- Open Visual Studio Code
- Open the Extensions view:
- Windows/Linux:
Ctrl+Shift+X
- macOS:
Cmd+Shift+X
- Windows/Linux:
- Search for "Plato"
- Click Install
- Reload VSCode when prompted
Verifying installation
To verify the installation:
- Open the Command Palette (
Ctrl+Shift+P
orCmd+Shift+P
) - Type "Plato"
- 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:
- Open the Plato sidebar
- Click "Add Page" to add URLs
- 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
- Open the Plato sidebar in VSCode (look for the Test icon (a flask) in the Activity Bar)
- Click "Set Model" to choose your preferred AI model
- 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
- Add the pages you want to test to your working set
- Type your test requirements in natural language, preceded with a /command
- 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.