code: def test_multiselect_max_selections_form(app: Page):
      """Should apply max selections when used in form."""
      select_for_kth_multiselect(app, "male", 8, False)
      expect(app.locator("li")).to_have_text(
          "You can only select up to 1 option. Remove an option first.",
          use_inner_text=True,
      )
  
file_path: streamlit/e2e_playwright/st_multiselect_test.py
imports: from playwright.sync_api import Page, expect
  from e2e_playwright.conftest import ImageCompareFunction, wait_for_app_run
label_desc: Use image node_id 9 for calling a global function with example usage: test_multiselect_max_selections_form(app) without return types