Skip to content
This repository was archived by the owner on Mar 4, 2020. It is now read-only.

Commit 6be5953

Browse files
authored
Merge pull request #707 from facebook/w3c-clear
Use clear endpoint to clear element content even in W3C mode
2 parents 5ee2b82 + c0fd396 commit 6be5953

File tree

1 file changed

+1
-20
lines changed

1 file changed

+1
-20
lines changed

lib/Remote/RemoteWebElement.php

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public function __construct(RemoteExecuteMethod $executor, $id, $isW3cCompliant
6262
}
6363

6464
/**
65-
* If this element is a TEXTAREA or text INPUT element, this will clear the value.
65+
* Clear content editable or resettable element
6666
*
6767
* @return RemoteWebElement The current instance.
6868
*/
@@ -73,25 +73,6 @@ public function clear()
7373
[':id' => $this->id]
7474
);
7575

76-
if ($this->isW3cCompliant) {
77-
$this->executor->execute(DriverCommand::ACTIONS, [
78-
'actions' => [
79-
[
80-
'type' => 'key',
81-
'id' => 'keyboard',
82-
'actions' => [
83-
['type' => 'keyDown', 'value' => WebDriverKeys::CONTROL],
84-
['type' => 'keyDown', 'value' => 'a'],
85-
['type' => 'keyUp', 'value' => WebDriverKeys::CONTROL],
86-
['type' => 'keyUp', 'value' => 'a'],
87-
['type' => 'keyDown', 'value' => WebDriverKeys::BACKSPACE],
88-
['type' => 'keyUp', 'value' => WebDriverKeys::BACKSPACE],
89-
],
90-
],
91-
],
92-
]);
93-
}
94-
9576
return $this;
9677
}
9778

0 commit comments

Comments
 (0)