diff --git a/src/WebdriverClassicDriver.php b/src/WebdriverClassicDriver.php index fe2568b..3535e76 100644 --- a/src/WebdriverClassicDriver.php +++ b/src/WebdriverClassicDriver.php @@ -696,6 +696,20 @@ public function setTimeouts(array $timeouts): void } } + public function focus( + #[Language('XPath')] + string $xpath + ): void { + $this->executeJsOnXpath($xpath, 'arguments[0].focus()'); + } + + public function blur( + #[Language('XPath')] + string $xpath + ): void { + $this->executeJsOnXpath($xpath, 'arguments[0].blur()'); + } + // // diff --git a/tests/WebdriverClassicConfig.php b/tests/WebdriverClassicConfig.php index 41be414..cb08e36 100644 --- a/tests/WebdriverClassicConfig.php +++ b/tests/WebdriverClassicConfig.php @@ -55,10 +55,6 @@ public function skipMessage($testCase, $test): ?string case [$testCase, $test] === [EventsTest::class, 'testKeyboardEvents'] && $this->isOldChrome(): return 'Old Chrome does not allow triggering events.'; - case [$testCase, $test] === [EventsTest::class, 'testBlur']: - case [$testCase, $test] === [EventsTest::class, 'testFocus']: - return 'Focus/blur are not supported anymore.'; - case [$testCase, $test] === [EventsTest::class, 'testKeyboardEvents']: return 'Keyboard events are currently not supported.';