yaml-scene
v1.1.25
Published
Platform to do everything with only yaml scenario files
Downloads
106
Maintainers
Readme
YAML Scene
It's a platform to do everything with only yaml scenario files.
Because it's a platform, so you can easy to create extensions by yourself or use extensions which is shared by others.
Features
- Split a huge scenario file to many small files which make easy to run in a big project
- Flexible to use, easy to extends, customize for specific project
- Easy to install and reuse extensions via npm registry or create a extension by yourself
- Easy to customize or create new extensions and share them to everybody or reused in projects
- Support encrypt a scenario file and run the encrypted scenario file
- Provide docker image to run it without installation
- Support run a scenario file, load extensions from both local files and remote files (http(s)
- Auto generate a json schema for suggestion and validation
Installation
Install via npm
or yarn
npm install -g yaml-scene # yarn global add yaml-scene
How to run
- Create a
scenario file
with the below content
# Make a http request to http://localhost:8000/index.html
- yas-http/Get:
baseURL: http://localhost:8000
url: /index.html
var: responseContent
# Print response content to console
- Echo: ${responseContent}
- Run the scenario
yas $YAML_SCENE_FILE $PASSWORD
$YAML_SCENE_FILE
: Path to scenario file$PASSWORD
: Password to run encrypted scenario file which contains property "password" in scenario file content.
Docker image
docker pull doanthuanthanh88/yaml-scene:latest
Run via docker
docker run --rm -it doanthuanthanh88/yaml-scene $YAML_SCENE_FILE $PASSWORD
Extensions
- yas-http: Manage http(s) request, mocking api server, create testcases, generate to document...
- yas-grpc: Manage gRPC request, mocking gRPC server, create testcases, generate to document...
- yas-sequence-diagram: Generate to sequence diagram, flow diagram base on comment in code
- yas-redis: A redis client
You can build a extension by yourself
Guideline document
- Wiki Pages
- Integrate with Visual Studio Code
Sharing
How to create a yaml scene file
Please follow wiki pages to create a scene file for your self.
Examples
Please go to here to see examples
Create a new extension
Please clone Extension template project which includes examples, commands to unit test, build, document...
Or you can write a simple extension js file
CLI
- Run a scenario
my_scenario.yas.yaml
- From local file
yas my_scenario.yas.yaml
- From remote file
yas http://localhost/my_scenario.yas.yaml
Note: Pass
headers
via querystring to pass authentication, authorization.
Ex: http://localhost/my_scenario.yas.yaml?headers={"Authorization":"..."}
- Install new extensions
yas add yas-http yas-grpc
- Upgrade extensions
yas up yas-http yas-grpc
- Uninstall extensions
yas rm yas-http yas-grpc
- Show version
yas -v
- Show help content
yas -h