Skip to content

Commit

Permalink
Support focus/blur and enable tests
Browse files Browse the repository at this point in the history
  • Loading branch information
uuf6429 committed Mar 7, 2024
1 parent 48e300c commit 51daae8
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
14 changes: 14 additions & 0 deletions src/WebdriverClassicDriver.php
Original file line number Diff line number Diff line change
Expand Up @@ -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()');
}

// </editor-fold>

// <editor-fold desc="Private Utilities">
Expand Down
4 changes: 0 additions & 4 deletions tests/WebdriverClassicConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.';

Expand Down

0 comments on commit 51daae8

Please sign in to comment.