Plugin for setting up ssh tunnel while running tests with Hermione.
npm i hermione-tunnel
- host (mandatory)
String
Address of remote host to which tunnel will be established. - ports (mandatory)
Object
Ports range on remote host, port will be picked randomly from this range. If you want to set specific port, min and max values must be the same. - ports.min (mandatory)
Number
Min port number. - ports.max (mandatory)
Number
Max port number. - localport (mandatory)
Number|Function
Available port on local machine. If set toFunction
, it should returnPromise
which will be resolved with the actual port number. If promise is rejected, plugin will fail. - enabled (optional)
Boolean
Determines whether plugin is enabled. If set tofalse
plugin will do nothing. Defaults totrue
. - retries (optional)
Number
of attempts to establish tunnel. Defaults to5
. - protocol (optional)
String
Protocol which will be used in resulting root url. Defaults tohttp
.
Set the configuration to your .hermione.conf.js
plugins: {
'hermione-tunnel': {
host: remote_host_address,
ports: {
min: 8201,
max: 8400
},
localport: 3333,
retries: 3,
protocol: 'https'
}
}
Usually it's a problem with permissions to the host (example.com
in this example). You can manually create an ssh tunnel. Let's assume that you want to open a tunnel from localhost:8080
to example.com:9000
.
Run the following command.
$ ssh -v example.com -R 9000:localhost:8080 -N
And open an url http://example.com:9000/
in a browser.
First of all, make sure that done()
is executed in the test. If so, then this error means that Selenium grid doesn't have permissions to the tunneled host. Please ask your administrator to fix this issue.