Skip to content

Commit 6ec442c

Browse files
author
Hugo Fonseca
committed
bump readme
1 parent c0e8809 commit 6ec442c

1 file changed

Lines changed: 44 additions & 0 deletions

File tree

README.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,50 @@ With Composer:
1919

2020
### Usage
2121

22+
23+
### Library
24+
25+
You can create a downloader, a starter, a stopper and a watcher.
26+
E.g. to create a starter:
27+
28+
```
29+
$seleniumStarterOptions = new SeleniumStartOptions();
30+
$process = new Process('');
31+
$exeFinder = new ExecutableFinder();
32+
$waiter = new ResponseWaitter(new Client());
33+
$starter = new SeleniumStarter($seleniumStarterOptions, $process, $waiter, $exeFinder);
34+
```
35+
36+
Then you can call:
37+
```
38+
$starter->start();
39+
```
40+
And it will just work.
41+
42+
Of course, you can also change de default settings.
43+
This is done by calling options classes that each one if this has.
44+
E.g. to change a setting for the starter:
45+
46+
```
47+
// timeout is changed in the "waitter" class:
48+
$starter->getResponseWaitter()->setTimeout($input->getOption('timeout'));
49+
// to set a specific selenium location you do:
50+
$starterOptions = $starter->getStartOptions();
51+
$starterOptions->setSeleniumJarLocation($input->getOption('selenium-location'));
52+
// to enable xvfb:
53+
$starterOptions->enabledXvfb();
54+
```
55+
56+
**see the tests and the built-in commands for more examples, or open an issue**
57+
58+
You can also create a "handler" that will allow you to start, stop, download, etc. through one single class.
59+
```
60+
$this->handler = new SeleniumHandler($starter, $stopper, $downloader, $logWatcher);
61+
```
62+
63+
64+
### Built-in commands
65+
2266
#### get selenium
2367
`(it will download to current directory by default)`
2468

0 commit comments

Comments
 (0)