Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Browser running multiple browsers in Selenium Grid dockerized #546

Open
mpluta-airhelp opened this issue Dec 18, 2017 · 5 comments
Open

Comments

@mpluta-airhelp
Copy link

mpluta-airhelp commented Dec 18, 2017

Hello,

Problem I have is to make my test run to use specific browser available inn grid. Even better it should use all browsers that I set in parametrised test. But for now I am running test with command:

docker-compose run --rm -u $(id -u)  galenframework galen test tests/suites/NewHomePage.test --groups STAG -Dbase_url=some_base_url   --htmlreport report -Dbrowser=chrome

and my test looks like this:

@@ table devices
    | deviceName | tags      | size     |
    | Mobile     | mobile    | 360x700  |
    | Tablet     | tablet    | 780x800  |
    | Desktop    | desktop   | 1024x768 |

@@ parameterized using devices
@@ groups EPP, STAG
New homepage on ${deviceName} device ${browser}
    Website Homepage v2017 | ${base_url}test-front-page-2017/ ${size} ${browser}
        wait 3s
        check specs/homepage.gspec --include "${tags}"

Problem is that this command does not override galen.browserFactory.selenium.grid.browser config param and so test is using firefox node:

galen.config:

galen.range.approximation=2
galen.default.browser=chrome
$.webdriver.chrome.driver=/usr/local/bin/chromedriver
spec.colorscheme.precision = 256
galen.browser.screenshots.fullPage.scrollTimeout = 50
galen.browser.screenshots.fullPage.scrollWait = 20
spec.colorscheme.testrange = 6
galen.browserFactory.selenium.runInGrid = true
galen.browserFactory.selenium.grid.url = http://hub:4444/wd/hub
galen.browserFactory.selenium.grid.browser = firefox
galen.test.suffix=.test
galen.test.js.file.suffix=.test.js
galen.browser.pageElement.areaFinder = native

Here is my docker setup:

docker-compose.yml

version: '2'
services:
  galenframework:
    build:
      context: .
      dockerfile: Dockerfile
    volumes:
      - .:/usr/src/galen
    links:
      - seleniumhub:hub
  seleniumhub:
    image: selenium/hub:3.8.1-aluminum
    ports:
      - "4444"
    environment:
      GRID_TIMEOUT: 0
  chrome_node:
    image: selenium/node-chrome:3.8.1-aluminum
    links:
      - seleniumhub:hub
    ports:
      - "5900"
    environment:
      HUB_PORT_4444_TCP_ADDR: seleniumhub
      HUB_PORT_4444_TCP_PORT: 4444
      SCREEN_WIDTH: 1920
      SCREEN_HEIGHT: 1080
      SCREEN_DEPTH: 24
    shm_size: 1536m
  firefox_node:
    image: selenium/node-firefox:3.8.1-aluminum
    links:
      - seleniumhub:hub
    ports:
      - "5900"
    environment:
      HUB_PORT_4444_TCP_ADDR: seleniumhub
      HUB_PORT_4444_TCP_PORT: 4444
      SCREEN_WIDTH: 1920
      SCREEN_HEIGHT: 1080
      SCREEN_DEPTH: 24
    shm_size: 1536m

and Dockerfile

FROM java:8

ENV NVM_DIR /usr/local/nvm
ENV NODE_VERSION 6.11.4
ENV GALEN_VERSION 2.3.6


# Install nvm with node and npm
RUN curl https://raw.githubusercontent.com/creationix/nvm/v0.31.0/install.sh | bash \
    && . $NVM_DIR/nvm.sh \
    && nvm install $NODE_VERSION \
    && nvm alias default $NODE_VERSION \
    && nvm use default \
    && npm install -g galenframework-cli@$GALEN_VERSION


ENV NODE_PATH      $NVM_DIR/versions/node/v$NODE_VERSION/lib/node_modules
ENV PATH           $NVM_DIR/versions/node/v$NODE_VERSION/bin:$PATH

RUN mkdir -p /usr/src/galen
WORKDIR /usr/src/galen

Am I missing sth?

Regards!
Mateusz

@axelbarfod1
Copy link

Where ou able to make it work ? I'm looking into using grid with Galen but I have been unable to make it work

@hypery2k
Copy link
Contributor

hypery2k commented Feb 4, 2018

Youncan try my Docker Image https://hub.docker.com/r/galenframework/cli/

@mpluta-airhelp
Copy link
Author

@axelbarfod1 - Grid works fine until you need to switch browser. I had no time to look into it recently.

@hypery2k - Can you tell us how you manage cross browser testing?

@hypery2k
Copy link
Contributor

@mplutia-airhelp: Didn't get what you mean. The Docker Image has multiple browsers configured.

@mpluta-airhelp
Copy link
Author

@hypery2k how do you set up configuration parameters?:

galen.browserFactory.selenium.runInGrid  
galen.browserFactory.selenium.grid.url 
galen.browserFactory.selenium.grid.browser  

With that setup, what is your command for launching test against given browser? My experience is that there is no such command and browser is taken from galen.config which cannot be changed during runtime. But I might have omitted sth.

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants