Defining Test Success
There are several ways to think about what constitutes looking the same in terms of testing. I chose the following three principles for testing my streamlit-folium package:

  1. The Document Object Model (DOM) structure (but not necessarily the values) of the page should remain the same
  2. For values such as headings, test that those values are exactly equal
  3. Visually, the app should look the same
    I decided to take these less strict definitions of “unchanged” for testing streamlit-folium, as the internals of the Folium package itself appear to be non-deterministic. Meaning, the same Python code will create the same looking image, but the generated HTML will be different.

#testing #seleniumbase #streamlit

Testing Streamlit Apps Using SeleniumBase
3.20 GEEK