Skip to content

Commit 1045e5c

Browse files
committed
readme with package description, usage details & see also block
1 parent a920b4d commit 1045e5c

1 file changed

Lines changed: 36 additions & 1 deletion

File tree

README.md

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,42 @@
11

22
# ReactPHP WebDriver
33

4-
TBD
4+
This is a direct port of [RemoteWebDriver](https://github.com/php-webdriver/php-webdriver/blob/1.8.3/lib/Remote/RemoteWebDriver.php)
5+
logic from the [php-webdriver/webdriver](https://github.com/php-webdriver/php-webdriver) package, which utilizes [ReactPHP](https://github.com/reactphp/reactphp)
6+
event loop and promise API for browser interaction w/o execution flow blocking.
7+
8+
Usage example:
9+
10+
```php
11+
use React\EventLoop\Factory as LoopFactory;
12+
use React\Http\Browser;
13+
use Itnelo\React\WebDriver\Client\W3CClient;
14+
15+
$loop = LoopFactory::create();
16+
$browser = new Browser($loop);
17+
18+
$webdriver = new W3CClient(
19+
$browser,
20+
[
21+
'server' => [
22+
'host' => 'selenium-hub',
23+
'port' => 4444,
24+
],
25+
'request' => [
26+
'timeout' => 30,
27+
],
28+
]
29+
);
30+
```
31+
32+
See a self-documented [ClientInterface.php](src/ClientInterface.php) for the API details. Not all methods are ported
33+
(only the most necessary), so feel free to open an issue / make a pull request if you want more.
34+
35+
## See also
36+
37+
- [php-webdriver/webdriver](https://github.com/php-webdriver/php-webdriver) — the original, "blocking" implementation;
38+
to get information how to use some advanced methods, for example, [WebDriverKeys](https://github.com/php-webdriver/php-webdriver/blob/main/lib/WebDriverKeys.php#L10)
39+
helper describes Unicode strings for sending special inputs to page elements (e.g. `Ctrl`, `Alt`, etc.).
540

641
## Changelog
742

0 commit comments

Comments
 (0)