Running Nightwatch and selenium in dockers

773 views
Skip to first unread message

Michał Dulemba

unread,
Apr 18, 2017, 8:48:54 AM4/18/17
to NightwatchJs
I'm trying to run test environment where each component is in a docker (nightwatchjs, browsers, selenium server).
But now i'm stuck in finding right "setup". I get "Connection is refused is Selenium started" all the time. 
And it is weird because i set up webdriverio in similar way and it works (repo forked from hulilabs repo).

Anybody can help ?


DOCKER COMPOSE:

version: '2'
services:
    nightwatch:
        image: dulemba/nightwatch
        depends_on:
            - chrome
            - firefox
            - hub
        environment:
            - HUB_PORT_4444_TCP_ADDR=hub
            - HUB_PORT_4444_TCP_PORT=4444
        volumes:
            - /home/michal/Dokumenty/nw/nightwatch/app:/app

    hub:
        image: selenium/hub
        ports:
            - 4444:4444

    firefox:
        image: selenium/node-firefox-debug
        ports:
            - 5900
        environment:
            - HUB_PORT_4444_TCP_ADDR=hub
            - HUB_PORT_4444_TCP_PORT=4444
        depends_on:
            - hub

    chrome:
        image: selenium/node-chrome-debug
        ports:
            - 5900
        environment:
            - HUB_PORT_4444_TCP_ADDR=hub
            - HUB_PORT_4444_TCP_PORT=4444
        depends_on:
            - hub


NIGHTWATCH.JSON

{
  "src_folders" : ["tests"],
  "output_folder" : "reports",
  "custom_commands_path" : "",
  "custom_assertions_path" : "",
  "page_objects_path" : "",
  "globals_path" : "",

  "selenium" : {
    "start_process" : false,
    "server_path" : "/opt/selenium/selenium-server-standalone.jar",
    "log_path" : "",
    "host" : "127.0.0.1",
    "port" : 4444,
    "cli_args" : {
      "webdriver.chrome.driver" : "",
      "webdriver.gecko.driver" : "",
      "webdriver.edge.driver" : ""
    }
  },

  "test_settings" : {
    "default" : {
      "launch_url" : "http://localhost",
      "selenium_port"  : 4444,
      "selenium_host"  : "localhost",
      "silent": true,
      "screenshots" : {
        "enabled" : false,
        "path" : ""
      },
      "desiredCapabilities": {
        "browserName": "firefox",
        "marionette": true
      }
    },

    "chrome" : {
      "desiredCapabilities": {
        "browserName": "chrome"
      }
    },

    "edge" : {
      "desiredCapabilities": {
        "browserName": "MicrosoftEdge"
      }
    }
  }
}

Lorand-Edmond Iszlai

unread,
Apr 26, 2017, 11:04:04 AM4/26/17
to NightwatchJs
https://github.com/SeleniumHQ/docker-selenium  why are you not using this ?   ... 
Reply all
Reply to author
Forward
0 new messages