diff --git a/tests/selenium/base.py b/tests/selenium/base.py index 9b47a84b4d..06abe5c440 100644 --- a/tests/selenium/base.py +++ b/tests/selenium/base.py @@ -15,6 +15,8 @@ from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support import expected_conditions as exp_cond import glob +import subprocess +import json class WebTest: @@ -31,18 +33,12 @@ def __init__(self, cap=None): def read_ini(self): self.modules = [] self.auth_type = '' - # Assuming each PHP file returns an associative array config_files = glob.glob('../../config/*.php') - for file_path in config_files: - # Create an empty dictionary to hold the variables from the included file - config_dict = {} - # Execute the PHP file in a new dictionary - exec(open(file_path).read(), config_dict) - # Check if 'modules' is in the dictionary and is a list + result = subprocess.run(['php', 'get_config.php'], stdout=subprocess.PIPE) + config_dict = json.loads(result.stdout.decode()) if 'modules' in config_dict and isinstance(config_dict['modules'], list): self.modules += config_dict['modules'] - # Check if 'auth_type' is in the dictionary if 'auth_type' in config_dict: self.auth_type = config_dict['auth_type'] diff --git a/tests/selenium/get_config.php b/tests/selenium/get_config.php new file mode 100644 index 0000000000..64c1a06ab6 --- /dev/null +++ b/tests/selenium/get_config.php @@ -0,0 +1,7 @@ +