1.5 KiB
1.5 KiB
PlayWrong VS Code Extension
This extension provides syntax highlighting for PlayWrong test files (.test).
Installation
-
Copy the
playwrong-syntaxfolder to your VS Code extensions directory:- Windows:
%USERPROFILE%\.vscode\extensions\ - macOS:
~/.vscode/extensions/ - Linux:
~/.vscode/extensions/
- Windows:
-
Restart VS Code
-
Open any
.testfile and enjoy syntax highlighting! -
(Optional) Enable the PlayWrong theme for better colors:
- Press
Ctrl+Shift+P→ "Preferences: Color Theme" - Select "PlayWrong Theme"
- Press
Features
- Syntax Highlighting: Keywords, commands, strings, numbers, and variables
- Comment Support: Use
#for line comments and/* */for multi-line comments - Auto-completion: Bracket and quote auto-closing
- Variable Highlighting:
$VARIABLEand${VARIABLE}syntax - Custom Theme: Optimized colors for PlayWrong syntax
Supported Commands
use,open,wait,click,fill,scroll,sleep,dump,break- Element selectors:
element,childText,class,id,name,href,type,value,child - Environment variables:
$PASSWORD,${API_KEY}
Example
/*
Multi-line comment block
This test demonstrates login functionality
*/
# This is a line comment
use "Chrome"
open "data:text/html,<html><body><h1>Comment Test</h1></body></html>"
fill element=input type="password" value="$PASSWORD"
click element=button childText="Login" /* inline comment */
sleep 2000 "wait for page load"