diff --git a/conftest.py b/conftest.py index 46105dc..436292d 100644 --- a/conftest.py +++ b/conftest.py @@ -6,7 +6,7 @@ from utils.logger import Logger, LogLevel -log = Logger(log_lvl=LogLevel.DEBUG).get_instance() +log = Logger(log_lvl=LogLevel.INFO).get_instance() # Initialize the WebDriver options diff --git a/pytest.ini b/pytest.ini index dd9b916..f348110 100644 --- a/pytest.ini +++ b/pytest.ini @@ -3,4 +3,6 @@ addopts = -rA -v --html=test_results.html markers = smoke: run smoke regression: run regression tests - sanity: run sanity tests \ No newline at end of file + sanity: run sanity tests +junit_family=legacy +junit_suite_name = Selenium UI suite \ No newline at end of file diff --git a/resources/caps.yaml b/resources/caps.yaml new file mode 100644 index 0000000..df2199f --- /dev/null +++ b/resources/caps.yaml @@ -0,0 +1,3 @@ + chrome: + browser: "" + diff --git a/src/utils/yaml_reader.py b/src/utils/yaml_reader.py new file mode 100644 index 0000000..c8952ff --- /dev/null +++ b/src/utils/yaml_reader.py @@ -0,0 +1,20 @@ +import yaml +from pathlib import Path + + +class YamlReader: + @staticmethod + def read_caps(browser="chrome", filename="caps.yaml"): + try: + # Get the path to the resources folder from the script's directory + resources_path = Path(__file__).resolve().parent.parent.parent / "resources" + abs_path = resources_path / filename + + with open(abs_path, "r", encoding="UTF-8") as stream: + data = yaml.safe_load(stream) + return data.get(browser) + except (yaml.YAMLError, KeyError) as e: + print(f"Error while reading '{filename}': {e}") + return None + +