README.md in wsdirector-cli-0.4.0 vs README.md in wsdirector-cli-0.5.0
- old
+ new
@@ -75,9 +75,48 @@
- client:
name: connection check
# no actions
```
+Run with loop option:
+
+```yml
+ # script.yml
+ - client:
+ name: "listeners"
+ loop:
+ multiplier: ":scale" # :scale take number from -s param, and run :scale number of clients in this group
+ actions:
+ - receive:
+ data:
+ type: "welcome"
+ - send:
+ data:
+ command: "subscribe"
+ identifier: "{\"channel\":\"Channel\"}"
+ - receive:
+ data:
+ identifier: "{\"channel\":\"Channel\"}"
+ type: "confirm_subscription"
+ - wait_all
+ - receive:
+ multiplier: ":scale + 1"
+```
+
+Also you can pass a JSON file with some testing scripts:
+
+```bash
+wsdirector scenario.json ws://websocket.server:9876
+```
+
+or pass a JSON scenario directly to the CLI without creating a file:
+
+```bash
+wsdirector -i '[{"receive": {"data":"welcome"}},{"send":{"data":"send message"}},{"receive":{"data":"receive message"}}]' ws://websocket.server:9876
+```
+
+Type `wsdirector --help` to check all commands.
+
### Protocols
WSDirector uses protocols to handle different actions.
Currently, we support "base" protocol (with `send`, `receive`, `wait_all` actions) and "action_cable" protocol, which extends "base" with `subscribe` and `perform` actions.