-
It is possible to load the content of a JS files to be injected into Portman, which path should be used? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Portman supports the loading of JS files content for:
By using the Example: {
"version": 1,
"globals": {
"stripResponseExamples": true,
"collectionPreRequestScripts": [
"file:configs/scripts/prerequest.js"
]
}
} The file path can be relative or absolute to the local system. The above example has a JS file with PreRequest code, located in: app
├── ...
├── configs # Config folder
│ ├── scripts # Folder that contains all the JS script files for Portman
│ │ ├── prerequest.js # the prerequest JS file
│ └── ... # etc.
└── ... The Portman CLI will be executed on the "app" level folder location, which could be any location on your local system. Example user@laptop /Sites/app $ % portman -l your-openapi-file.yaml The relative path for |
Beta Was this translation helpful? Give feedback.
Portman supports the loading of JS files content for:
By using the
file:
setting, you can define a JS file, which will be read as-is and injected in the wanted Postman Tests.Example:
The file path can be relative or absolute to the local system.
When using a relative path, it should be relative to the location from where Portman is executed.
The above example has a JS file with PreRequest code, located in: