MCPcopy
hub / github.com/streamlit/streamlit / test_dynamic_popover_in_fragment

Function test_dynamic_popover_in_fragment

e2e_playwright/st_popover_test.py:272–294  ·  view source on GitHub ↗

Test that a dynamic popover works correctly inside a fragment.

(app: Page)

Source from the content-addressed store, hash-verified

270
271
272def test_dynamic_popover_in_fragment(app: Page):
273 """Test that a dynamic popover works correctly inside a fragment."""
274 # Initially closed — fragment content should not have executed
275 expect(app.get_by_text("Fragment popover exec count: 0")).to_be_visible()
276
277 # Open the fragment popover
278 open_popover(app, "Fragment popover")
279 wait_for_app_run(app)
280
281 # Content should have executed once
282 expect(app.get_by_text("Fragment popover exec count: 1")).to_be_visible()
283
284 # Close the popover
285 app.keyboard.press("Escape")
286 wait_for_app_run(app)
287
288 # Count should stay at 1
289 expect(app.get_by_text("Fragment popover exec count: 1")).to_be_visible()
290
291 # Popover content should not be visible when closed
292 expect(
293 app.get_by_text("Fragment popover content executed 1 times")
294 ).not_to_be_visible()
295
296
297def test_popover_callback_fires_on_open_and_close(app: Page):

Callers

nothing calls this directly

Calls 3

open_popoverFunction · 0.90
wait_for_app_runFunction · 0.90
get_by_textMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…