# wsdirector

> A command line tool for testing WebSocket servers using scenarios.

- URL: https://evilmartians.com/opensource/wsdirector
- GitHub: https://github.com/palkan/wsdirector
- Authors: Vladimir Dementyev

---

wsdirector is a command line tool for testing WebSocket servers using scenarios.

WebSocket Director is command-line tool and a library which aimed to automate black-box testing of WebSocket
servers (Action Cable, AnyCable, Elixir Phoenix, etc.) using human-readable scenarios (stored as YAML or JSON).

All you need is to `gem install wsdirector-cli`, create a YAML file and run it. For example, consider an Action Cable scenario interacting with the echo channel:

```yml
# script.yml
- client:
  protocol: action_cable
  actions:
    - subscribe:
        channel: "EchoChannel"
    - perform:
        channel: "EchoChannel"
        data:
          text: "Hey!"
    - receive:
        channel: "EchoChannel"
        data:
          response: "Hey!"
```

You can run it using the following command:

```sh
$ wsdirector -u localhost:3000/cable -f script.yml

1 client, 0 failures
```

WebSocket Director could be used as a helper tool in development as well as a building block for automated tests.
