code: def test_persists_widget_state_across_reruns(app: Page):
      """Test that st.container persists widget state across reruns."""
      checkbox_widget = app.get_by_test_id("stCheckbox").first
      checkbox_widget.click()
  
      expect(app.locator("h1").first).to_have_text("Checked!")
  
      app.get_by_test_id("stButton").first.locator("button").click()
      expect(app.locator("h2").first).to_have_text("Pressed!")
      expect(checkbox_widget.locator("input")).to_have_attribute(
          "aria-checked", "true"
      )
  
imports: from playwright.sync_api import Page, expect
  from e2e_playwright.conftest import ImageCompareFunction, wait_for_app_run
label_desc: Use image node_id 2 for calling a global function with example usage: test_persists_widget_state_across_reruns(app) without return types