Skip to content

A layer on top of Selenium Docker that exposes docker-compose commands via API (using express)

Notifications You must be signed in to change notification settings

DonPage/grid-composer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

47 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Grid Composer

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.

API

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.

How to use

  1. cd into the location of docker-compose.yml.
  2. clone repo: $ git clone https://github.com/DonPage/grid-composer.git . (the . is so it clones everything within in the repo.)
  3. (optional) create config.json.
  4. run $ npm install.
  5. run $ npm start.

Config options

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.

About

A layer on top of Selenium Docker that exposes docker-compose commands via API (using express)

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published