code: def test_maintains_selection_when_same_name_exists(
      app: Page, assert_snapshot: ImageCompareFunction
  ):
      """Test when tabs names change, keeps selected tab if matching label still exists."""
      control_buttons = app.locator(".stButton")
      # Reset Tabs
      control_buttons.nth(5).click()
      wait_for_app_run(app)
      # Add Tab 3
      control_buttons.nth(0).click()
      # Select Tab 2
      tab_buttons = app.locator(".stTabs button[role=tab]")
      tab_buttons.nth(1).click()
      # Change Tab 1 & 3 Names
      control_buttons.nth(3).click()
      # Wait for tabs to properly load
      wait_for_app_run(app)
      app.wait_for_timeout(1000)
      assert_snapshot(
          app.locator(".stTabs"), name="tabs-change-some-names"
      )
  
file_path: streamlit/e2e_playwright/st_tabs_selection_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 5 for calling a global function with example usage: test_maintains_selection_when_same_name_exists(app, assert_snapshot) without return types