Grid Composer is a layer on top of Docker-Selenium and Docker-Compose to provide API endpoints for commonly used commands for your Selenium Nodes.
All API methods are public by default. Passing in {token: 'secretToken'}
will confirm request by checking the token parameter in the request. IE /status?token=secretToken
.
Method | Endpoint | Docker-Compose equivalent | Description |
---|---|---|---|
POST | /start |
$ docker-compose up -d |
boot up docker containers. |
POST | /stop |
$ docker-compose down |
shutdown docker containers. |
POST | /restart |
$ docker-compose restart |
restart all docker containers. |
PUT | /scale/:browserName/:numberOfNodes |
$ docker-compose scale <browser>=<numberOfNodes> |
Scale up a specific browser node. |
GET | /status |
$ docker-compose ps |
get info on node containers. |
- cd into the location of
docker-compose.yml
. - clone repo:
$ git clone https://github.com/DonPage/grid-composer.git .
(the.
is so it clones everything within in the repo.) - (optional) create
config.json
. - run
$ npm install
. - run
$ npm start
.
These options should be a json format inside config.json
Option | Type | Default | Description |
---|---|---|---|
maxNodes | number |
20 |
Max number of nodes that should be idle/up at any given time. |
token | string |
false |
token to confirm against before executing docker-compose commands. If false , all API endpoints will be open |
port | number |
8080 |
The open port you want the API to listen on. |