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:
25
README.md
25
README.md
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user