webrtc/test: check if selenium is available before attempting to add tests

Fixes the following error

File "/builds/vivia/gst-plugins-bad/gst-build/build/../subprojects/gst-examples/webrtc/check/basic.py", line 5, in <module>
     from selenium import webdriver

ModuleNotFoundError: No module named 'selenium'
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-examples/-/merge_requests/17>
This commit is contained in:
Matthew Waters 2020-06-25 22:11:33 +10:00
parent 204945b902
commit f5d9471639
2 changed files with 20 additions and 1 deletions

View file

@ -0,0 +1,15 @@
#!/usr/bin/env python3
import os
import unittest
from selenium import webdriver
from selenium.webdriver.support.wait import WebDriverWait
from selenium.webdriver.firefox.firefox_profile import FirefoxProfile
from selenium.webdriver.chrome.options import Options as COptions
import asyncio
import threading
import signal
import gi
gi.require_version('Gst', '1.0')
from gi.repository import Gst

View file

@ -2,8 +2,12 @@ tests = [
['basic', 'basic.py'],
]
if openssl.found()
check_test = find_program ('configure_test_check.py')
have_webrtc_check_deps = run_command (check_test).returncode() == 0
if openssl.found() and have_webrtc_check_deps
test_deps = [certs]
message ('adding webrtc tests')
foreach elem : tests
test(elem.get(0),