Nightwatch: Unable to upload image/video files after Dockerization

Created on 13 Jul 2016  路  2Comments  路  Source: nightwatchjs/nightwatch

Hi there,

I have a suite of functional tests working with Nightwatch, and have recently Dockerised the functional tests so that they can be included into our CI pipeline.

The only issue I've come across (to which I've found no answers whatsoever from Selenium/Docker/Nightwatch online sources) is my now failing file uploads.

I've been using the conventional wisdom of:

genrePageObjects.setValue('@imageButton', filePath);

It works fine locally, but it won't upload images nor the videos I am attempting to upload now that it has been Dockerized.

The file paths are correct, the file permissions are correct, the file exists, and my x-path pointer hasn't changed.

I'm not sure if this is a Nightwatch solution, but I', wondering if there's another way to upload files that might be facilitated by Nightwatch that is accepted in a Docker container.

Thanks

Most helpful comment

I know its been a while since you asked, but I have found a solution.

When you start the selenium driver nodes, map a volume to it, this is my docker-compose file

hub:
  image: selenium/hub:3.4.0-chromium
  ports:
    - "4444:4444"
chrome:
  image: selenium/node-chrome-debug:3.4.0-chromium
  ports:
    - "5901:5900"
  volumes:
    - .:/test
  links:
    - hub
firefox:
  image: selenium/node-firefox-debug:3.4.0-chromium
  ports:
    - "5902:5900"
  volumes:
    - .:/test
  links:
    - hub

Later when you run nightwatch, just supply the relative path of your image/video. Like this:

setValue('input#avatar', '/test/[filepath]')

All 2 comments

Sorry, can't really help you there, I'm closing this.

I know its been a while since you asked, but I have found a solution.

When you start the selenium driver nodes, map a volume to it, this is my docker-compose file

hub:
  image: selenium/hub:3.4.0-chromium
  ports:
    - "4444:4444"
chrome:
  image: selenium/node-chrome-debug:3.4.0-chromium
  ports:
    - "5901:5900"
  volumes:
    - .:/test
  links:
    - hub
firefox:
  image: selenium/node-firefox-debug:3.4.0-chromium
  ports:
    - "5902:5900"
  volumes:
    - .:/test
  links:
    - hub

Later when you run nightwatch, just supply the relative path of your image/video. Like this:

setValue('input#avatar', '/test/[filepath]')

Was this page helpful?
0 / 5 - 0 ratings