Skip to content

Commit 682d071

Browse files
committed
Add wait_for_network_idle to README [ci skip]
1 parent 80570f3 commit 682d071

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

README.md

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,17 +116,26 @@ be automatically cleared at the end of the test.
116116
* `page.driver.network_traffic` Inspect network traffic (resources have been
117117
loaded) on the current page. This returns an array of request objects.
118118

119-
120119
```ruby
121120
page.driver.network_traffic # => [Request, ...]
122121
request = page.driver.network_traffic.first
123122
request.response
124123
```
125124

125+
* `page.driver.wait_for_network_idle` Natively waits for network idle and if
126+
there are no active connections returns or raises `TimeoutError` error. Accepts
127+
the same options as Ferrum's [`wait_for_idle`](https://github.com/route/ferrum#wait_for_idleoptions)
128+
129+
```ruby
130+
page.driver.wait_for_network_idle
131+
page.driver.refresh
132+
```
133+
126134
Please note that network traffic is not cleared when you visit new page. You can
127135
manually clear the network traffic by calling `page.driver.clear_network_traffic`
128136
or `page.driver.reset`
129137

138+
130139
### Manipulating cookies ###
131140

132141
The following methods are used to inspect and manipulate cookies:
@@ -189,7 +198,7 @@ end
189198

190199
## License ##
191200

192-
Copyright 2018-2019 Machinio
201+
Copyright 2018-2020 Machinio
193202

194203
Permission is hereby granted, free of charge, to any person obtaining
195204
a copy of this software and associated documentation files (the

0 commit comments

Comments
 (0)