Hello and thanks for replying,
I also have seq and timer, that’s it.
In any case, i solved it by using pulseaudio’s server and creating fake audios like so:
USER root
# Install pulse audio and python
RUN apt-get -qq update && apt-get -qq install -y pulseaudio pavucontrol python python3-pip
RUN pip3 install selenium
# Copy the media folder of this repo to opt/media in the container
#RUN mkdir -p /opt/media
#COPY media /opt/media/
# Use custom entrypoint
COPY entrypoint.sh /opt/bin/entrypoint.sh
USER seluser
ENTRYPOINT ["sh", "/opt/bin/entrypoint.sh"]
and entrypoint:
#!/usr/bin/env bash
# Load pulse audio
pulseaudio -D --exit-idle-time=-1
# Create a virtual speaker output
pactl load-module module-null-sink sink_name=SpeakerOutput sink_properties=device.description="Dummy_Output"
# Create a virtual microphone
pacmd load-module module-virtual-source source_name=VirtualMicrophone
# Stand up a local server that serves the media files within opt/media
python -m SimpleHTTPServer &>/dev/null
# Start Selenium Test
cd /apps
python3 selenium-start.py
and selenium_start.py is the actual selenium test, which should include something like:
chrome_options = Options()
prefs = {"profile.default_content_setting_values.notifications" : 2}
chrome_options.add_argument("--use-fake-ui-for-media-stream")
chrome_options.add_argument("--window-size=1920x1080")
chrome_options.add_argument("--headless")
chrome_options.add_argument('--no-sandbox')
chrome_options.add_argument("--disable-dev-shm-usage")
chrome_options.add_experimental_option("prefs",prefs)
browser = webdriver.Chrome(chrome_options=chrome_options)
this made it work for me!
Thanks!