|
1 | 1 | # ~~jsonwire-grid~~WebDriverGrid [](https://travis-ci.org/qa-dev/jsonwire-grid)
|
2 |
| -This is scalable Golang implementation of Selenium Grid (hub). |
| 2 | +This is high-performance scalable implementation of Selenium Grid (hub), |
| 3 | + |
| 4 | +## Features |
| 5 | +* One session per one node, no more no less😺 |
| 6 | +* Scaling grid-instances for fault-tolerance |
| 7 | +* Support and effective management over 9000 nodes, for parallel testing👹 |
| 8 | +* Single entry point for all your test apps |
| 9 | +* Send metrics to [statsd](https://github.com/etsy/statsd) |
| 10 | +* Support on-demand nodes in Kubernetes cluster (Only if grid running in cluster) |
| 11 | + |
3 | 12 |
|
4 | 13 | ## HowTo
|
5 |
| -1. Install MySql |
6 |
| -1. Set in config.json your db connesction string `[username[:password]@][protocol[(address)]]/dbname[?param1=value1&...¶mN=valueN]` |
7 |
| -1. Run app |
8 |
| -#### Run binary file |
9 |
| -1. download binary file and |
10 |
| -1. `export CONFIG_PATH=./config.json` |
11 |
| -1. `./jsonwire-grid` |
12 |
| - |
13 |
| -### Run From Source |
14 |
| -#### Requirements |
15 |
| -* Go >= 1.8.1 |
16 |
| -* [go-bindata](https://github.com/jteeuwen/go-bindata) |
17 |
| -1. `git clone https://github.com/qa-dev/jsonwire-grid .` |
18 |
| -1. `cd jsonwire-grid` |
19 |
| -1. `cp config-sample.json config.json` |
20 |
| -1. `make run` |
21 |
| - |
22 |
| -## HowToUse |
23 |
| -1. Run app |
| 14 | +### Run grid |
| 15 | +1. [Download last release](https://github.com/qa-dev/jsonwire-grid/releases) and unzip |
| 16 | +1. cd to `jsonwire-grid_vXXX` |
| 17 | +1. Type `export CONFIG_PATH=./config-local-sample.json` |
| 18 | +1. Type `./jsonwire-grid` |
| 19 | +1. Grid running! |
| 20 | + |
| 21 | +### Run nodes |
| 22 | +1. [Download selenium](http://www.seleniumhq.org/download/) |
24 | 23 | 1. `java -jar selenium-server-standalone-3.4.0.jar -role node -hub http://127.0.0.1:4444/grid/register`
|
25 |
| -1. try create session `curl -X POST http://127.0.0.1:4444/wd/hub/session -d '{"desiredCapabilities":{"browserName": "firefox"}}'` |
| 24 | +1. Repeat! |
| 25 | + |
| 26 | +### Run test |
| 27 | +1. Try create session, such as `curl -X POST http://127.0.0.1:4444/wd/hub/session -d '{"desiredCapabilities":{"browserName": "firefox"}}'` |
| 28 | +1. If your something similar with `{"state":null,"sessionId":"515be56a...` all right! If not, submit [issue](https://github.com/qa-dev/jsonwire-grid/issues/new) |
| 29 | + |
| 30 | + |
| 31 | +## Configuration |
| 32 | +### Logger - Configuration of logger. |
| 33 | +##### `logger.level` - Support `debug`, `info`, `warning` or `error`. |
| 34 | + |
| 35 | +### DB - Configuration of storage. |
| 36 | +##### `db.implementation` - Select your favorite db, or local storage. |
| 37 | +Now support's: `mysql`, `local`. |
| 38 | +>Note: Local (in-memory) storage not support single session storagen between grid-instances. |
| 39 | +##### `db.connection` - DSN for your db |
| 40 | +* `mysql` - example `db_user:db_pass@(db_host:3306)/db_name?parseTime=true` (parseTime=true - required option) |
| 41 | +* `local` - omit this property, because every instance have own in-memory storage |
| 42 | + |
| 43 | +### Statsd - Configuration of metrics. |
| 44 | +##### `statsd.host` - Host of statsd server. |
| 45 | +##### `statsd.port` - Host of statsd server `int`. |
| 46 | +##### `statsd.protocol` - Network protocol. |
| 47 | +##### `statsd.prefix` - Prefix of metrics tag. |
| 48 | +##### `statsd.enable` - Enable metrics `true/false`. |
| 49 | + |
| 50 | +### Grid - Configuration of app. |
| 51 | +##### `grid.client_type` - Type of used nodes. |
| 52 | +* `selenium` - [http://www.seleniumhq.org/]() |
| 53 | +* `wda` - [agent](https://github.com/qa-dev/WebDriverAgent) for [WDA](https://github.com/qa-dev/WebDriverAgent) |
| 54 | +##### `grid.port` - grit will run on this port. |
| 55 | +##### `grid.busy_node_duration` - max session lifetime, when timeout was elapsed grid will kill the session. |
| 56 | +##### `grid.reserved_node_duration` - max timeout between send request `POST /session` and opening the browser window, if. (Deprecated will renamed) |
| 57 | +##### `grid.strategy_list` - list of strategies, if grid not able create session on first strategy it go to next, until list ends. [Read more about strategies.](#strategy-list) |
| 58 | + |
| 59 | +### Strategy list |
| 60 | +##### `type` - [type of strategy.](#types-of-strategies) |
| 61 | +##### `limit` - max count active nodes of this strategy. Unlimited if equals `0`. Dependent of strategy [type](#types-of-strategies) |
| 62 | +##### `params` - object describes available nodes `ex. docker config, kubernetes config, etc.`. Dependent of strategy [type](#types-of-strategies) |
| 63 | +##### `node_list` - list of objects describes available nodes. |
| 64 | +##### `node_list.[].params` - list of objects describes available nodes `ex. image_name, etc.`. Dependent of strategy [type](#types-of-strategies) |
| 65 | +##### `node_list.[].capabilities_list` - array of available capabilities objects. `ex. [{"foo: "bar"}, {"foo: "baz", "ololo": "trololo"}]` |
| 66 | + |
| 67 | +### Types of strategies |
| 68 | +##### `persistent` - working with registered nodes, same as original selenium grid. |
| 69 | +* `limit` - omit this property, its always equals `0`. |
| 70 | +* `node_list` - omit this property. |
| 71 | +##### `kubernetes` - on-demand nodes in kubernetes cluster. |
| 72 | +* `params` - omit this property. |
| 73 | +* `node_list.[].params.image` - docker image with selenium. |
| 74 | +* `node_list.[].params.port` - port of selenium. |
| 75 | + |
0 commit comments