Testproject docker chrome download directory

I have set up a permanent testproject agent on docker with a chrome headless browser. Tests are executing fine except for test cases where files are downloaded. It seems not downloading the file or the location where the downloads are stored is unknown. Below you can find the docker-compose script I have used. Where are downloads being stored? Is there any additional configuration required for files to get correctly downloaded? When browsing the the files on the chrome headless docker also nothing is there in /home/seluser.

services:
testproject-agent:
image: testproject/agent:latest
container_name: testproject-agent
depends_on:
- chrome
volumes:
- ${DOCKERCONFDIR}/testproject:/var/testproject/agent
environment:
TP_API_KEY: “KEY”
TP_AGENT_ALIAS: “ALPHA”
CHROME: “chrome:4444”
TZ: “Europe/Amsterdam”
chrome:
image: selenium/standalone-chrome
shm_size: ‘1gb’
volumes:
- ${DOCKERCONFDIR}/testproject:/var/testproject/agent
environment:
TZ: “Europe/Amsterdam”

I have fixed the problem. It was not downloading files because of a permission issue. I am running an ubuntu server with dockStarter. Below is my updated docker-compose which solved the problem. I had to add ‘user: 1000:1000’ to the chrome docker. The volume is added so that files become available on the host itself. This folder we can expose to the testproject agent so the agent can access the downloaded files for validation.

version: “3.1”
services:
testproject-agent:
image: testproject/agent:latest
container_name: testproject-agent
depends_on:
- chrome
restart: always
volumes:
- /home/HIDDEN/.appdata/testproject:/var/testproject/agent
- /home/HIDDEN/storage/downloads:/Downloads
environment:
TP_API_KEY: “API-KEY-HIDDEN”
TP_AGENT_ALIAS: “ALPHA”
CHROME: “chrome:4444”
TZ: “Europe/Amsterdam”
chrome:
image: selenium/standalone-chrome
shm_size: ‘1gb’
user: 1000:1000
restart: always
volumes:
- /home/HIDDEN/storage/downloads:/home/seluser/Downloads
- /mnt/attachments:/Attachments
environment:
TZ: “Europe/Amsterdam”

Please note that by default, the chrome docker downloads files into the root folder of the docker. Which I don’t like. To change that behavior you can use driver capabilities which can be set at job settings.

{
“goog:chromeOptions”: {
“experimentalOptions”: {
“prefs”: {
“download”: {
“default_directory”: “/home/seluser/Downloads”
}
}
}
}
}

The volume mapping in the chrome docker - /mnt/attachments:/Attachments I use for files that are used by test cases that are uploading files. /mnt/attachments is actually mounted to a network drive. This network drive we can easily access and upload files into which may be used by any future scenarios.