code: def test_status_collapses_and_expands(app: Page):
      """Test that a status collapses and expands."""
      expander_content = "Doing some work..."
      running_status = app.get_by_test_id("stExpander").nth(0)
      # Starts expanded:
      expect(
          running_status.get_by_text(expander_content)
      ).to_be_visible()
  
      expander_header = running_status.locator("summary")
      # Collapse:
      expander_header.click()
      expect(
          running_status.get_by_text(expander_content)
      ).not_to_be_visible()
      # Expand:
      expander_header.click()
      expect(
          running_status.get_by_text(expander_content)
      ).to_be_visible()
  
imports: from playwright.sync_api import Page, expect
  from e2e_playwright.conftest import ImageCompareFunction
label_desc: Use image node_id 3 for calling a global function with example usage: test_status_collapses_and_expands(app) without return types