Skip to content

Commit de0864f

Browse files
committed
nitpicks
1 parent 50c8bd5 commit de0864f

File tree

2 files changed

+16
-3
lines changed

2 files changed

+16
-3
lines changed

README.md

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -525,16 +525,24 @@ Browsershot::url('https://example.com')
525525
->click('#selector2', 'right', 5, 200) // Right click 5 times on #selector2, each click lasting 200 milliseconds.
526526
```
527527

528-
#### Filling form fields
528+
#### Typing on the page
529529

530-
You can fill form fields on the page.
530+
You can type on the page (you can use this to fill form fields).
531531

532532
```php
533533
Browsershot::url('https://example.com')
534534
->type('#selector1', 'Hello, is it me you are looking for?')
535535
```
536536

537-
Note about AJAX requests: They may take longer for the response to arrive, so include a delay (eg. `->delay(5000)`) in your request chain.
537+
You can combined `type` and `click` to create a screenshot of a page after submitting a form:
538+
539+
```php
540+
Browsershot::url('https://example.com')
541+
->type('#firstName', 'My name')
542+
->click('#submit')
543+
->delay($millisecondsToWait)
544+
->save($pathToImage);
545+
```
538546

539547
## Related packages
540548

src/Browsershot.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -365,6 +365,11 @@ public function setDelay(int $delayInMilliseconds)
365365
return $this->setOption('delay', $delayInMilliseconds);
366366
}
367367

368+
public function delay(int $delayInMilliseconds)
369+
{
370+
return $this->setDelay($delayInMilliseconds);
371+
}
372+
368373
public function setOption($key, $value)
369374
{
370375
$this->arraySet($this->additionalOptions, $key, $value);

0 commit comments

Comments
 (0)