streamlit / streamlit

Streamlit — A faster way to build and share data apps.
https://streamlit.io
Apache License 2.0
35.7k stars 3.09k forks source link

AppTest - add support for st.image and st.download_button #9003

Open mpalmer23 opened 4 months ago

mpalmer23 commented 4 months ago

Checklist

Summary

Requesting st.image and st.download_button to be added to AppTest

Why?

Images and download buttons are key features of our streamlit app, and we'd like to use AppTest to write automated tests for these widgets.

How?

New properties within AppTest class for getting sequences of all st.image and st.download_button widgets.

Additional Context

No response

github-actions[bot] commented 4 months ago

To help Streamlit prioritize this feature, react with a 👍 (thumbs up emoji) to the initial post.

Your vote helps us identify which enhancements matter most to our users.

Visits

Asaurus1 commented 4 months ago

As a workaround, I think you should be able to do something like at.get("imgs") or at.get("download_button")

mpalmer23 commented 4 months ago

As a workaround, I think you should be able to do something like at.get("imgs") or at.get("download_button")

Thanks for the suggestion. This works and helps us set up some basic checks.

Would still be good to eventually be able to use AppTest's more advanced interaction-simulation at some point.

asmaier commented 1 month ago

As a workaround, I think you should be able to do something like at.get("imgs") or at.get("download_button")

Is it possible to click the download button and receive the file from at.get("download_button") ?