Skip to content

Commit

Permalink
Merge pull request #475 from METAJIJI/patch-2
Browse files Browse the repository at this point in the history
More human readable generate_config
  • Loading branch information
ddavison authored Apr 28, 2017
2 parents 4ed22aa + ed8f62e commit fe860cb
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 46 deletions.
29 changes: 15 additions & 14 deletions Hub/generate_config
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
#!/bin/bash

echo "
cat <<_EOF
{
\"host\": null,
\"port\": 4444,
\"role\": \"hub\",
\"maxSession\": $GRID_MAX_SESSION,
\"newSessionWaitTimeout\": $GRID_NEW_SESSION_WAIT_TIMEOUT,
\"capabilityMatcher\": \"org.openqa.grid.internal.utils.DefaultCapabilityMatcher\",
\"throwOnCapabilityNotPresent\": $GRID_THROW_ON_CAPABILITY_NOT_PRESENT,
\"jettyMaxThreads\": $GRID_JETTY_MAX_THREADS,
\"cleanUpCycle\": $GRID_CLEAN_UP_CYCLE,
\"browserTimeout\": $GRID_BROWSER_TIMEOUT,
\"timeout\": $GRID_TIMEOUT,
\"debug\": $GRID_DEBUG
}"
"host": null,
"port": 4444,
"role": "hub",
"maxSession": $GRID_MAX_SESSION,
"newSessionWaitTimeout": $GRID_NEW_SESSION_WAIT_TIMEOUT,
"capabilityMatcher": "org.openqa.grid.internal.utils.DefaultCapabilityMatcher",
"throwOnCapabilityNotPresent": $GRID_THROW_ON_CAPABILITY_NOT_PRESENT,
"jettyMaxThreads": $GRID_JETTY_MAX_THREADS,
"cleanUpCycle": $GRID_CLEAN_UP_CYCLE,
"browserTimeout": $GRID_BROWSER_TIMEOUT,
"timeout": $GRID_TIMEOUT,
"debug": $GRID_DEBUG
}
_EOF
33 changes: 17 additions & 16 deletions NodeChrome/generate_config
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,24 @@

CHROME_VERSION=$( sudo dpkg -s google-chrome-stable | grep Version | cut -d " " -f 2 | cut -d "-" -f 1 )

echo "
cat <<_EOF
{
\"capabilities\": [
"capabilities": [
{
\"version\": \"$CHROME_VERSION\",
\"browserName\": \"chrome\",
\"maxInstances\": $NODE_MAX_INSTANCES,
\"seleniumProtocol\": \"WebDriver\",
\"applicationName\": \"$NODE_APPLICATION_NAME\"
"version": "$CHROME_VERSION",
"browserName": "chrome",
"maxInstances": $NODE_MAX_INSTANCES,
"seleniumProtocol": "WebDriver",
"applicationName": "$NODE_APPLICATION_NAME"
}
],
\"proxy\": \"org.openqa.grid.selenium.proxy.DefaultRemoteProxy\",
\"maxSession\": $NODE_MAX_SESSION,
\"port\": $NODE_PORT,
\"register\": true,
\"registerCycle\": $NODE_REGISTER_CYCLE,
\"nodePolling\": $NODE_POLLING,
\"unregisterIfStillDownAfter\": $NODE_UNREGISTER_IF_STILL_DOWN_AFTER,
\"downPollingLimit\": $NODE_DOWN_POLLING_LIMIT
}"
"proxy": "org.openqa.grid.selenium.proxy.DefaultRemoteProxy",
"maxSession": $NODE_MAX_SESSION,
"port": $NODE_PORT,
"register": true,
"registerCycle": $NODE_REGISTER_CYCLE,
"nodePolling": $NODE_POLLING,
"unregisterIfStillDownAfter": $NODE_UNREGISTER_IF_STILL_DOWN_AFTER,
"downPollingLimit": $NODE_DOWN_POLLING_LIMIT
}
_EOF
33 changes: 17 additions & 16 deletions NodeFirefox/generate_config
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,24 @@

FIREFOX_VERSION=$( firefox -version | cut -d " " -f 3 )

echo "
cat <<_EOF
{
\"capabilities\": [
"capabilities": [
{
\"version\": \"$FIREFOX_VERSION\",
\"browserName\": \"firefox\",
\"maxInstances\": $NODE_MAX_INSTANCES,
\"seleniumProtocol\": \"WebDriver\",
\"applicationName\": \"$NODE_APPLICATION_NAME\"
"version": "$FIREFOX_VERSION",
"browserName": "firefox",
"maxInstances": $NODE_MAX_INSTANCES,
"seleniumProtocol": "WebDriver",
"applicationName": "$NODE_APPLICATION_NAME"
}
],
\"proxy\": \"org.openqa.grid.selenium.proxy.DefaultRemoteProxy\",
\"maxSession\": $NODE_MAX_SESSION,
\"port\": $NODE_PORT,
\"register\": true,
\"registerCycle\": $NODE_REGISTER_CYCLE,
\"nodePolling\": $NODE_POLLING,
\"unregisterIfStillDownAfter\": $NODE_UNREGISTER_IF_STILL_DOWN_AFTER,
\"downPollingLimit\": $NODE_DOWN_POLLING_LIMIT
}"
"proxy": "org.openqa.grid.selenium.proxy.DefaultRemoteProxy",
"maxSession": $NODE_MAX_SESSION,
"port": $NODE_PORT,
"register": true,
"registerCycle": $NODE_REGISTER_CYCLE,
"nodePolling": $NODE_POLLING,
"unregisterIfStillDownAfter": $NODE_UNREGISTER_IF_STILL_DOWN_AFTER,
"downPollingLimit": $NODE_DOWN_POLLING_LIMIT
}
_EOF

0 comments on commit fe860cb

Please sign in to comment.