File tree Expand file tree Collapse file tree 2 files changed +16
-3
lines changed
Expand file tree Collapse file tree 2 files changed +16
-3
lines changed Original file line number Diff line number Diff line change 4141 WaitElementTimeout ,
4242)
4343from pydoll .protocol .base import Response
44+ from pydoll .protocol .dom .types import EventFileChooserOpened
4445from pydoll .protocol .network .responses import GetResponseBodyResponse
4546from pydoll .protocol .network .types import Cookie , CookieParam , NetworkLog
4647from pydoll .protocol .page .events import PageEvent
@@ -678,10 +679,11 @@ async def expect_file_chooser(
678679 files: File path(s) for upload.
679680 """
680681
681- async def event_handler (event ):
682+ async def event_handler (event : EventFileChooserOpened ):
683+ file_list = files if isinstance (files , list ) else [files ]
682684 await self ._execute_command (
683- DomCommands .upload_files (
684- files = files ,
685+ DomCommands .set_file_input_files (
686+ files = file_list ,
685687 backend_node_id = event ['params' ]['backendNodeId' ],
686688 )
687689 )
Original file line number Diff line number Diff line change @@ -79,3 +79,14 @@ class BoxModel(TypedDict):
7979 width : int
8080 height : int
8181 shapeOutside : NotRequired [ShapeOutsideInfo ]
82+
83+
84+ class EventFileChooserOpenedParams (TypedDict ):
85+ frameId : str
86+ mode : str
87+ backendNodeId : int
88+
89+
90+ class EventFileChooserOpened (TypedDict ):
91+ method : str
92+ params : EventFileChooserOpenedParams
You can’t perform that action at this time.
0 commit comments