Add variable validation features to README and CLI; implement linting and strict mode for environment variables in executor and linter. Enhance VSCode extension documentation for improved user guidance.

This commit is contained in:
sebseb7
2025-07-22 09:59:12 +02:00
parent 85537b26bf
commit 9e73900197
5 changed files with 66 additions and 5 deletions

View File

@@ -33,6 +33,31 @@ Run in headless mode (default):
node src/cli.js tests/example.test Chrome --headless
```
## Variable Validation
PlayWrong now provides comprehensive validation for environment variables:
### Linting (Static Analysis)
```bash
node src/cli.js tests/example.test Chrome --lint
```
- **Common variables** like `$PASSWORD`, `$PASSWORDMAIL`, `$EMAIL`, `$USERNAME` show as info messages
- **Undefined variables** that are not commonly defined show as warnings
### Runtime Validation
During execution, undefined variables:
- Show prominent warnings with helpful instructions
- Are used as literal text (e.g., `$UNDEFINED_VAR` stays as `$UNDEFINED_VAR`)
- Can be treated as errors with `--strict-variables` flag
### Strict Mode
```bash
node src/cli.js tests/example.test Chrome --strict-variables
```
- Treats undefined variables as errors
- Stops execution immediately when an undefined variable is encountered
- Useful for CI/CD pipelines to ensure all variables are properly set
## Test Language Syntax
### Profiles