I am unable to copy a file generated by my Selenium tests in a folder inside docker container mounted to host machine.
Here is how my compose file look like
selenium:
image: 'selenium/standalone-chrome'
expose:
- "4444"
tests:
build:
context: ./tests
dockerfile: Dockerfile
depends_on:
- selenium
- web
volumes:
- /testResultsReport:/testResultsReport
This is how my directory structure looks like.
\
- docker-compose.yml
- build scripts
- tests
- testResultsReport
- Test scripts
Name of the file generated inside testResultsReport folder when running docker-compose is TestResultsReport.HTML
As my tests are running inside selenium server on port 4444
, should I mount my volume there? I tried doing that to but still not getting my html file copied to host machine?
I confirmed that my html file is generated when i run my tests outside compose.
I also tried ./testResultsReport however it added a folder in root with name of testResultsReport and did nothing. So I used ./tests/testResultsReport but still not getting file.
Worked by using right folder and absolute path. Thanks @chrisz