| 840 | ) |
| 841 | |
| 842 | async def _drop( |
| 843 | self, |
| 844 | selector: str, |
| 845 | payload: "DropPayload", |
| 846 | strict: bool = None, |
| 847 | position: Position = None, |
| 848 | timeout: float = None, |
| 849 | ) -> None: |
| 850 | params: Dict[str, Any] = { |
| 851 | "selector": selector, |
| 852 | "strict": strict, |
| 853 | "position": position, |
| 854 | "timeout": self._timeout(timeout), |
| 855 | } |
| 856 | files = payload.get("files") if payload else None |
| 857 | if files is not None: |
| 858 | converted = await convert_input_files(files, self.page.context) |
| 859 | if "directoryStream" in converted or "directoryLocalPath" in converted: |
| 860 | raise Error( |
| 861 | "Dropping a directory is not supported, pass individual files instead." |
| 862 | ) |
| 863 | params.update(converted) |
| 864 | data = payload.get("data") if payload else None |
| 865 | if data is not None: |
| 866 | params["data"] = [{"mimeType": k, "value": v} for k, v in data.items()] |
| 867 | await self._channel.send("drop", self._timeout, params) |
| 868 | |
| 869 | async def type( |
| 870 | self, |