You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+36-1Lines changed: 36 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,42 @@
1
1
2
2
# ReactPHP WebDriver
3
3
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.).
0 commit comments