code: def test_text_area_limits_input_via_max_chars(app: Page):
      """Test that st.text_area correctly limits the number of characters via max_chars."""
      text_area_field = (
          app.get_by_test_id("stTextArea")
          .nth(9)
          .locator("textarea")
          .first
      )
      # Try typing in char by char:
      text_area_field.clear()
      text_area_field.type("12345678")
      text_area_field.press("Control+Enter")
  
      expect(app.get_by_test_id("stMarkdown").nth(10)).to_have_text(
          "value 10: 12345", use_inner_text=True
      )
  
      # Try filling in everything at once:
      text_area_field.focus()
      text_area_field.fill("12345678")
      text_area_field.press("Control+Enter")
  
      expect(app.get_by_test_id("stMarkdown").nth(10)).to_have_text(
          "value 10: 12345", use_inner_text=True
      )
  
file_path: streamlit/e2e_playwright/st_text_area_test.py
imports: import pytest
  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_text_area_limits_input_via_max_chars(app) without return types