code: def test_uploads_and_deletes_multiple_files(
      app: Page, assert_snapshot: ImageCompareFunction
  ):
      """Test that uploading multiple files at once works correctly."""
      file_name1 = "file1.txt"
      file_content1 = b"file1content"
  
      file_name2 = "file2.txt"
      file_content2 = b"file2content"
  
      files = [
          {
              "name": file_name1,
              "mimeType": "text/plain",
              "buffer": file_content1,
          },
          {
              "name": file_name2,
              "mimeType": "text/plain",
              "buffer": file_content2,
          },
      ]
  
      uploader_index = 2
  
      with app.expect_file_chooser() as fc_info:
          app.get_by_test_id("stFileUploadDropzone").nth(
              uploader_index
          ).click()
  
      file_chooser = fc_info.value
      file_chooser.set_files(files=files)
  
      wait_for_app_run(app)
      app.wait_for_timeout(1000)
  
      uploaded_file_names = app.locator(".uploadedFileName")
  
      # The widget should show the names of the uploaded files in reverse order
      file_names = [files[1]["name"], files[0]["name"]]
  
      for i, element in enumerate(uploaded_file_names.all()):
          expect(element).to_have_text(
              file_names[i], use_inner_text=True
          )
  
      # The script should have printed the contents of the two files into a st.text.
      # This tests that the upload actually went through.
      content = "\n".join(
          [
              files[0]["buffer"].decode("utf-8"),
              files[1]["buffer"].decode("utf-8"),
          ]
      )
      expect(
          app.get_by_test_id("stText").nth(uploader_index)
      ).to_have_text(content, use_inner_text=True)
  
      file_uploader = app.get_by_test_id("stFileUploader").nth(
          uploader_index
      )
      assert_snapshot(
          file_uploader, name="st_multi_file_uploader-uploaded"
      )
  
      #  Delete the second file. The second file is on top because it was
      #  most recently uploaded. The first file should still exist.
      app.get_by_test_id("fileDeleteBtn").first.click()
  
      wait_for_app_run(app)
      app.wait_for_timeout(1000)
  
      expect(
          app.get_by_test_id("stText").nth(uploader_index)
      ).to_have_text(
          files[0]["buffer"].decode("utf-8"), use_inner_text=True
      )
  
      expect(
          app.get_by_test_id("stMarkdownContainer").nth(5)
      ).to_have_text("True", use_inner_text=True)
  
imports: from playwright.sync_api import Page, expect
  from e2e_playwright.conftest import ImageCompareFunction, wait_for_app_run
label_desc: Use image node_id 4 for calling a global function with example usage: test_uploads_and_deletes_multiple_files(app, assert_snapshot) without return types