Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions src/Selenium2Driver.php
Original file line number Diff line number Diff line change
Expand Up @@ -862,6 +862,21 @@ public function keyUp($xpath, $char, $modifier = null)
$this->withSyn()->executeJsOnXpath($xpath, $script);
}

/**
* Simulates keyboard typing with Syn.type().
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mink drivers are abstractions. So the phpdoc of methods should absolutely not describe them by talking about their internal implementation.

and indeed, as @aik099 said, this method won't be accepted if it is not properly added to the Mink API (btw, people are not expected to use the driver directly)

* See: https://github.com/bitovi/syn/blob/master/src/key.js#L133
*
* @param string $xpath
* @param string $text example: "Firstname\tLast\tmail@example.org\r"
*
*/
public function type($xpath, $text)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This method can be useful, but needs to be added to:

  1. driver test suite
  2. driver interface
  3. at least to 2 other drivers

{
$text = json_encode($text);
$script = "Syn.type({{ELEMENT}}, $text)";
$this->withSyn()->executeJsOnXpath($xpath, $script);
}

/**
* {@inheritdoc}
*/
Expand Down