New: Introducing PHP and Composer Support.Read the Announcement
Socket
Book a DemoInstallSign in
Socket

gitproxy.zycloud.tk/qa-dev/jsonwire-grid

Package Overview
Dependencies
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gitproxy.zycloud.tk/qa-dev/jsonwire-grid

Go Modules
Version
v0.5.0
Version published
Created
Source

jsonwire-gridWebDriverGrid Build Status Go Report Card codecov

This is high-performance scalable implementation of Selenium Grid (hub),

What is Selenium-Grid?

Selenium-Grid allows you run your tests on different machines against different browsers in parallel. That is, running multiple tests at the same time against different machines running different browsers and operating systems. Essentially, Selenium-Grid support distributed test execution. It allows for running your tests in a distributed test execution environment.

Features

  • One session per one node, no more no less😺
  • Scaling grid-instances for fault-tolerance
  • Support and effective management over 9000 nodes, for parallel testing👹
  • Single entry point for all your test apps
  • Send metrics to statsd
  • Support on-demand nodes in Kubernetes cluster (Only if grid running in cluster)

HowTo

Run grid

  • Download last release and unzip
  • cd to jsonwire-grid_vXXX
  • Type export CONFIG_PATH=./config-local-sample.json
  • Type ./jsonwire-grid
  • Grid running!

Run nodes

  • Download selenium
  • java -jar selenium-server-standalone-3.4.0.jar -role node -hub http://127.0.0.1:4444/grid/register
  • Repeat!

Run test

  • Try create session, such as curl -X POST http://127.0.0.1:4444/wd/hub/session -d '{"desiredCapabilities":{"browserName": "firefox"}}'
  • If you see something similar with {"state":null,"sessionId":"515be56a... all right! If not, submit issue

Configuration

Configurations are stored in json files. Example:

{
  "logger": {
    "level": "debug"
  },
  "db": {
    "implementation": "local"
  },
  "grid": {
    "client_type": "selenium",
    "port": 4444,
    "strategy_list": [
      {
        "type": "persistent"
      }
    ],
    "busy_node_duration": "15m",
    "reserved_node_duration": "5m"
  }
}

Logger - Configuration of logger.

OptionPossible valuesDescription
logger.leveldebug, info, warning, errorLogging level.

DB - Configuration of storage.

OptionPossible valuesDescription
db.implementationmysql, localSelect your favorite db, or local storage.
db.connectionsee next tableDSN for your db.

Note: Note: Local (in-memory) storage does not support common session storage between grid-instances.

DB implementationDSN format
mysqlspec, example db_user:db_pass@(db_host:3306)/db_name?parseTime=true (parseTime=true - required option)
localomit this property, because every instance have its own in-memory storage

Statsd - Configuration of metrics(optional).

OptionPossible valuesDescription
statsd.hoststringHost of statsd server.
statsd.portintPort of statsd server.
statsd.protocolstringNetwork protocol.
statsd.prefixstringPrefix of metrics tag.
statsd.enableboolEnable metric.

Grid - Configuration of app.

OptionPossible valuesDescription
grid.client_typeselenium, wdaType of used nodes.
grid.portintGrid will run on this port.
grid.busy_node_durationstring as 12m, 60sMax session lifetime, when timeout was elapsed grid will kill the session.
grid.reserved_node_durationstring as 12m, 60sMax timeout between send request POST /session and opening the browser window. (Deprecated will renamed)
grid.strategy_listarrayList of strategies, if grid not able create session on first strategy it go to next, until list ends. Read more about strategies.

Element of strategy list

OptionPossible valuesDescription
typestring, see type of strategy.Host of statsd server.
limitint, unlimited if equals 0Max count of active nodes on this strategy.
paramsobject, dependent on strategy typeObject describes available nodes, ex. docker config, kubernetes config, etc.
node_listarray, dependent on strategy typeArray of objects describing available nodes.
node_list.[].paramsobject, dependent on strategy typeObject of describing node, ex. image_name, etc.
node_list.[].capabilities_listarray, ex. [{"foo: "bar"}, {"foo: "baz", "ololo": "trololo"}]array of objects describes available capabilities .

Types of strategy

persistent - using externally started nodes, same as original selenium grid.
Strategy optionPossible valuesDescription
limit-Omit this property, сount of nodes always unlimited.
params-Omit this property.
node_list-Omit this property.
kubernetes - on-demand nodes in kubernetes cluster.
Strategy optionPossible valuesDescription
params.namespacestringNamespace in k8s for on-demand nodes.
params.pod_creation_timeoutstring as 12m, 60sMax waiting time for creating a pod.
node_list.[].params.imagestringDocker image with selenium.
node_list.[].params.portstringPort of selenium.

API

  • /grid/status - a method returns a status of a grid

FAQs

Package last updated on 28 Oct 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts