Skip to content

Commit ea71b67

Browse files
committed
fix none params
1 parent c31c741 commit ea71b67

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

pieces/SeleniumWebBrowserPiece/models.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from pydantic import BaseModel, Field
2-
from typing import List
2+
from typing import List, Optional
33
from enum import Enum
44

55
class Commands(str,Enum):
@@ -10,7 +10,8 @@ class CommandInput(BaseModel):
1010
name: Commands = Field(
1111
description='Name of the CommandInput.',
1212
)
13-
value: str = Field(
13+
value: Optional[str] = Field(
14+
default=None,
1415
description='value of the CommandInput.',
1516
)
1617

pieces/SeleniumWebBrowserPiece/piece.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,11 @@ def piece_function(self, input_data: InputModel):
2121
if cmd.name.value == "save_screenshot":
2222
cmd.value = str(results_path/cmd.value)
2323
self.display_result = dict(file_type="png",filepath=cmd.value)
24-
25-
getattr(driver, cmd.name)(cmd.value)
24+
25+
if cmd.name.value is None:
26+
getattr(driver, cmd.name)()
27+
else:
28+
getattr(driver, cmd.name)(cmd.value)
2629

2730
driver.quit()
2831

0 commit comments

Comments
 (0)