code: def test_declare_component_correctly_sets_attr(app: Page):
      """Test that components.declare_component correctly sets attributes."""
  
      declare_component = app.locator("iframe").nth(2)
  
      expect(declare_component).to_have_attribute(
          "title", "st_components_v1.test_component"
      )
      expect(declare_component).to_have_attribute(
          "src",
          re.compile(
              r"http://not.a.real.url\?streamlitUrl=http%3A%2F%2Flocalhost.*"
          ),
      )
  
imports: import re
  from playwright.sync_api import Page, expect
  from e2e_playwright.conftest import ImageCompareFunction
label_desc: Use image node_id 4 for calling a global function with example usage: test_declare_component_correctly_sets_attr(app) without return types