diff --git a/Dockerfile b/Dockerfile index f1f6d2e..29e408b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -20,7 +20,17 @@ RUN groupadd --system --gid $APP_UID $APP_USER \ RUN mkdir -p /opt/app \ && chown -R $APP_USER:$APP_USER /opt/app /usr/local/bundle -RUN mkdir -p /opt/app/tmp/selenium_downloads +# RUN mkdir -p /opt/app/tmp/selenium_downloads +# RUN mkdir -p /opt/app/artifacts + +# RUN mkdir -p /opt/app/artifacts/Downloads \ +# && chown 1200:1201 /opt/app/artifacts/Downloads + +# RUN mkdir -p /opt/app/artifacts \ +# && chown 1200:1201 /opt/app/artifacts + +RUN mkdir -p /home/seluser/Downloads \ + && chown 1200:1201 /home/seluser/Downloads # Get list of available packages RUN apt-get update -qq diff --git a/docker-compose.ci.yml b/docker-compose.ci.yml index 6398d04..c3a07c3 100644 --- a/docker-compose.ci.yml +++ b/docker-compose.ci.yml @@ -22,7 +22,8 @@ services: - selenium.test shm_size: 2g volumes: - - ./tmp/selenium_downloads:/home/seluser/Downloads + - artifacts:/opt/app/artifacts + # - ./tmp/selenium_downloads:/home/seluser/Downloads volumes: artifacts: diff --git a/docker-compose.yml b/docker-compose.yml index 54d45c5..ced99d4 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -22,6 +22,8 @@ services: - SOLR_URL=http://solr:8983/solr/geodata-test volumes: - ./:/opt/app:delegated + - downloads:/home/seluser/Downloads + # - artifacts:/opt/app/artifacts db: image: postgres:16.4 @@ -50,4 +52,9 @@ services: - selenium.test shm_size: 2g volumes: - - ./tmp/selenium_downloads:/home/seluser/Downloads + - downloads:/home/seluser/Downloads + # - ./tmp/selenium_downloads:/home/seluser/Downloads + +volumes: + artifacts: + downloads: diff --git a/spec/rails_helper.rb b/spec/rails_helper.rb index 02fba9f..2ca4240 100644 --- a/spec/rails_helper.rb +++ b/spec/rails_helper.rb @@ -19,7 +19,7 @@ ] chrome_options = Selenium::WebDriver::Chrome::Options.new(args: chrome_args).tap do |options| - options.add_preference(:download, prompt_for_download: false, directory_upgrade: true) + options.add_preference(:download, prompt_for_download: false, directory_upgrade: true, default_directory: '/home/seluser/Downloads') options.add_preference(:browser, set_download_behavior: { behavior: 'allow' }) end diff --git a/spec/support/constants/test_constants.rb b/spec/support/constants/test_constants.rb index db3b590..9c159b8 100644 --- a/spec/support/constants/test_constants.rb +++ b/spec/support/constants/test_constants.rb @@ -1,6 +1,7 @@ module CommonHelpers EXPORT_TMP_PATH = '/opt/app/tmp/cache/downloads'.freeze - DOWNLOAD_TMP_PATH = '/opt/app/tmp/selenium_downloads'.freeze + # DOWNLOAD_TMP_PATH = '/opt/app/tmp/selenium_downloads'.freeze + DOWNLOAD_TMP_PATH = '/home/seluser/Downloads'.freeze PUBLIC_RECORD_ID = 'berkeley-s7038h'.freeze RESTRICTED_RECORD_ID = 'berkeley-s7b12n'.freeze end