Hello Streamlit Community,
I’m currently working on testing a Streamlit app and have encountered a challenge with a particular functionality that i’m using in my app. I’m reaching out for guidance or suggestions from the community.
App: https://magiclit.streamlit.app
Github: GitHub - Mortafix/MagicLit: Supercharge Streamlit with MagicLit: Unlock the full potential of the framework for captivating and interactive web applications.
Funcionality
To navigate the app in a super fast way I’m using the URL fragment provided by this package.
from streamlit_url_fragment import get_fragment
from pages import profile, dashboard, error
def fragment_to_page(fragment): ...
def run_page(page):
pages = {"profile": profile, "dashboard": dashboard}
return pages.get(page, error)
st.markdown("<a href='#url@page=profile'>Page</a>", unsafe_allow_html=True)
fragment = get_fragment()
page = fragment_to_page(fragment)
script = run_page(page)
script.run()
When I click on the a
tag, this simple script decide which page (in the example, the profile page).
You can try this behavior in the public Streamlit Cloud app.
Problem
I read all the guides and docs to the new Streamlit testing framework, but I can’t find anything to test this functionality. I know it’s not a straightforward Streamlit functionality, but I really love the new testing framework and I want to use it!
There is a way to test it? If no, is there a plan to include it in the near future?
I appreciate any help or insights the Streamlit community can offer. Thank you in advance for your time and assistance.