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

Unable to upload image/video files after Dockerization #1064

Closed
Quiza12 opened this issue Jul 13, 2016 · 2 comments
Closed

Unable to upload image/video files after Dockerization #1064

Quiza12 opened this issue Jul 13, 2016 · 2 comments

Comments

@Quiza12
Copy link

Quiza12 commented Jul 13, 2016

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

@beatfactor
Copy link
Member

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

@r1cebank
Copy link

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]')

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