-
Notifications
You must be signed in to change notification settings - Fork 111
Webdriver debugging tips
Carolyn Au edited this page Aug 29, 2025
·
2 revisions
Search for tests by keyword expression e.g., to run the test "get_chart_map_regions" in the vis_map_test.py file:
./run_test.sh -w -k get_chart_map_regions
To fix a test, you might want to iterate on both the test and server code. One suggestion to speed up that process is:
First setup the environment:
export FLASK_ENV=webdriver
export GOOGLE_CLOUD_PROJECT=datcom-website-dev
ENABLE_MODEL=true
then either run ./run_servers.sh --verbose or ./run_cdc_dev.sh --verbose
In another window, run the specific test. Use the -k flag to select a test method by keyword, or specify the test file in the path (or both).
python3 -m pytest server/webdriver/cdc_tests/vis_map_test.py -k test_manually_enter_option
Keep iterating by re-running the test, or updating server code (which will get reloaded on save).
Some other things you can do in the test to help with debugging:
Add the following line to the test to save a screenshot in the repo root folder:
self.driver.save_screenshot("your_screenshot_filename.png")