./content_diff is a simple test which looks for contents differences between Dev, Staging & Production version of the same page. At the moment it only compares selected Domestic & International pages.
This test uses:
- Python 3.8+
- Python Behave to run the tests
- requests to fetch page contents
- Python's built-in difflib to find & generate diff report
- Create a dedicated virtualenv
mkvirtualenv -p python3.8 contentdiff
or use the same one as for otherperiodic_tasks
- Install dependencies
make requirements_periodic_tasks
(orpip install -r requirements_load.txt
) - Set required env vars using
periodic.sh
script (see Env Vars & Convenience shell scripts sections in the main README) - Run the test with dedicated make target
In order to run the test you'll need to specify for which site you want to run it and what two environments you want to compare:
SERVICE=international ENVS_TO_COMPARE=stage_dev \
make compare_content
Possible values:
- SERVICE:
international
ordomestic
- ENVS_TO_COMPARE:
prod_uat
prod_stage
prod_dev
stage_uat
stage_dev
Once the test is finished, a simple HTML report will be generated and saved in ./reports
directory.
The report contains few metrics:L
- percentage similarity between two version of the page
Below is a an example of a content diff report summary:
And here's an example of a content difference between Dev & Staging version of the same page: