Script Executor
EasyYapi provides a built-in script executor for testing Groovy scripts.
Usage
- Open Tools > EasyApi > Script Executor
- Write your Groovy script in the editor
- Click the run button to execute
Available Tools
The following tools are available in the script executor:
- it — Context object
- tool — Utility methods
- regex — Regular expression utilities
- logger — Logging
- helper — Common operation helpers
- httpClient — HTTP client
- localStorage — Persistent local storage
- session — Session-level storage
- config — Configuration access
- api — API utilities
- runtime — Runtime information
- fieldContext — Field context utilities
- files — File operations
Example
groovy
// Test a field mock rule
def field = it // context object
if (field.type().name() == "java.lang.String") {
logger.info("String field: " + field.name())
}