Added an environment configuration for running integration tests with a HEADLESS environment variable set to True.
Documentation Update (CONTRIBUTING.md):
Added documentation to describe that Selenium-based council tests can now run in headless mode if the HEADLESS=True environment variable is set, with a link to the corresponding GitHub Actions runner setup.
Makefile:
Modified unit-tests target to first erase any existing coverage data before running tests, then to append coverage results instead of overwriting.
pytest Configuration (conftest.py):
Added a function to set the HEADLESS environment variable to "False" if it is not already set.
File Handling (file_handler.py in tests/step_defs/step_helpers):
Updated load_json_file to handle file encoding during JSON file loading and improved error handling with more detailed logging for file loading issues.
Integration Test Code (test_validate_council.py in tests/step_defs):
Added handle_test_errors as a decorator to the context fixture.
Revised environment variable checks and added fixtures to modularize Selenium mode setup in integration tests.
Logging and Error Handling Enhancements (test_collect_data.py and test_common_functions.py in tests):
Added new unit tests for various functionalities, including valid logging setup, holiday checks using mock data, and handling input and output operations with JSON files.
Improved error handling and introduced mocking in tests for file operations and date checking functionalities.
Miscellaneous Code Updates:
Various changes to enhance robustness, error handling, and testability of the codebase, especially focusing on JSON data management and Selenium WebDriver setup.
Closes #696
GitHub Actions Workflow (
behave.yml
):environment
configuration for running integration tests with aHEADLESS
environment variable set toTrue
.Documentation Update (
CONTRIBUTING.md
):HEADLESS=True
environment variable is set, with a link to the corresponding GitHub Actions runner setup.Makefile:
unit-tests
target to first erase any existing coverage data before running tests, then to append coverage results instead of overwriting.pytest Configuration (
conftest.py
):HEADLESS
environment variable to "False" if it is not already set.File Handling (
file_handler.py
intests/step_defs/step_helpers
):load_json_file
to handle file encoding during JSON file loading and improved error handling with more detailed logging for file loading issues.Integration Test Code (
test_validate_council.py
intests/step_defs
):handle_test_errors
as a decorator to thecontext
fixture.Logging and Error Handling Enhancements (
test_collect_data.py
andtest_common_functions.py
intests
):Miscellaneous Code Updates: