code: def test_data_editor_delete_row_via_toolbar(
      themed_app: Page, assert_snapshot: ImageCompareFunction
  ):
      """Test that a row can be deleted via the toolbar."""
      data_editor_element = themed_app.get_by_test_id(
          "stDataFrame"
      ).nth(1)
      data_editor_toolbar = data_editor_element.get_by_test_id(
          "stElementToolbar"
      )
  
      # Select the second row
      data_editor_element.click(position={"x": 10, "y": 100})
      # Take a snapshot to check if row is selected:
      assert_snapshot(
          data_editor_element,
          name="st_data_editor-selected_row_for_deletion",
      )
      expect(data_editor_element).to_have_css("height", "248px")
  
      # The toolbar should be locked (visible):
      expect(data_editor_toolbar).to_have_css("opacity", "1")
      # Take snapshot to check if trash icon is in toolbar:
      assert_snapshot(
          data_editor_toolbar,
          name="st_data_editor-row_deletion_toolbar",
      )
  
      # Click row deletion button:
      delete_row_button = data_editor_toolbar.get_by_test_id(
          "stElementToolbarButton"
      ).nth(0)
      delete_row_button.click()
      # The height should reflect that one row is missing (248px-35px=213px):
      expect(data_editor_element).to_have_css("height", "213px")
  
file_path: streamlit/e2e_playwright/st_dataframe_interactions_test.py
imports: import pytest
  from playwright.sync_api import Page, expect
  from e2e_playwright.conftest import ImageCompareFunction
label_desc: Use image node_id 3 for calling a global function with example usage: test_data_editor_delete_row_via_toolbar(themed_app, assert_snapshot) without return types