code: def test_markdown_elements_by_type():
      script = AppTest.from_string(
          """
          import streamlit as st
  
          st.markdown("**This is a markdown1**")
          st.caption("This is a caption1")
          st.code("print('hello world1')")
          st.latex("sin(2x)=2sin(x)cos(x)")
  
          st.markdown("**This is a markdown2**")
          st.caption("This is a caption2")
          st.code("print('hello world2')")
          st.latex("cos(2x)=cos^2(x)-sin^2(x)")
          """,
      )
      sr = script.run()
  
      assert len(sr.markdown) == 2
      assert len(sr.caption) == 2
      assert len(sr.code) == 2
      assert len(sr.latex) == 2
  
imports: from datetime import date, datetime, time
  import numpy
  import pandas
  import pytest
  from streamlit.elements.markdown import MARKDOWN_HORIZONTAL_RULE_EXPRESSION
  from streamlit.testing.v1.app_test import AppTest
label_desc: Use image node_id 22 for calling a global function with example usage: test_markdown_elements_by_type() without return types