diff --git a/src/Locator/Locator.php b/src/Locator/Locator.php index 13072ff..7962fd2 100644 --- a/src/Locator/Locator.php +++ b/src/Locator/Locator.php @@ -96,10 +96,10 @@ public function getOptions(): array /** * @param array|ClickOptions $options */ - public function click(array|ClickOptions $options = []): void + public function click(array|ClickOptions $options = [], int $waitForActionableTimeout = 30000): void { $options = ClickOptions::from($options); - $this->waitForActionable(); + $this->waitForActionable(['timeout' => $waitForActionableTimeout]); $this->sendCommand('locator.click', ['options' => $options->toArray()]); } @@ -412,10 +412,10 @@ public function setInputFiles(string|array $files, array|SetInputFilesOptions $o /** * @param array|FillOptions $options */ - public function fill(string $value, array|FillOptions $options = []): void + public function fill(string $value, array|FillOptions $options = [], int $waitForActionableTimeout = 30000): void { $options = FillOptions::from($options); - $this->waitForActionable(); + $this->waitForActionable(['timeout' => $waitForActionableTimeout]); $this->sendCommand('locator.fill', ['value' => $value, 'options' => $options->toArray()]); } @@ -477,10 +477,10 @@ public function hover(array|HoverOptions $options = []): void * * @param array|DragToOptions $options */ - public function dragTo(LocatorInterface $target, array|DragToOptions $options = []): void + public function dragTo(LocatorInterface $target, array|DragToOptions $options = [], int $waitForActionableTimeout = 30000): void { $options = DragToOptions::from($options); - $this->waitForActionable(); + $this->waitForActionable(['timeout' => $waitForActionableTimeout]); $targetSelector = $target->getSelector();