# Selenium runner, helper software for erp5testnode.
#
# Seleniumrunner responsability is to install Xvfb as
# ${buildout:parts-directory}/xserver/bin/Xvfb, a default firefox as
# ${buildout:bin-directory}/firefox and a geckodriver as
# ${buildout:bin-directory}/geckodriver for erp5testnode.

[buildout]
extends =
   ../../component/xorg/buildout.cfg
   ../../component/firefox/buildout.cfg
   ../../component/ffmpeg/buildout.cfg
   ../../component/coreutils/buildout.cfg
   ../../component/fonts/buildout.cfg
   ../../stack/slapos.cfg
   ./buildout.hash.cfg

parts =
   slapos-cookbook
   template
   xserver
   ffmpeg
   firefox-wrapper
   geckodriver

# XXX firefox 68 does not seem to honor <dir> from fontconfig's
# fonts.conf and only loads from system locations and from the
# fonts folder located in firefox part, so we copy (actually, symlink)
# some fonts there, otherwise firefox cannot find its standard fonts.
[symlink-extra-fonts-to-firefox-fonts-dir]
extra-fonts =
  ${android-fonts:location}
  ${dejavu-fonts:location}
  ${ipa-fonts:location}
  ${ipaex-fonts:location}
  ${liberation-fonts:location}
  ${ocrb-fonts:location}
install =
  import os
  for extra_font_dir in '''${:extra-fonts}'''.splitlines():
    dst = os.path.join(location, 'fonts', os.path.basename(extra_font_dir))
    os.symlink(extra_font_dir, dst)

[firefox]
post-install =
  ${symlink-extra-fonts-to-firefox-fonts-dir:install}

[macro-template]
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/${:filename}

[template]
<= macro-template
output = ${buildout:directory}/template.cfg

[versions]
plone.recipe.command = 1.1
