Skip to content

Commit 66205e1

Browse files
committed
Update README [ci skip]
1 parent e2b678f commit 66205e1

File tree

1 file changed

+15
-8
lines changed

1 file changed

+15
-8
lines changed

README.md

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,6 @@ to the browser by CDP protocol. The design of the driver is as close to
1010
[Poltergeist](https://github.com/teampoltergeist/poltergeist) as possible though
1111
it's not a goal.
1212

13-
Since Cuprite uses [Ferrum](https://github.com/rubycdp/ferrum#examples) there
14-
are many useful methods you can call even using this driver:
15-
16-
```ruby
17-
browser = page.driver.browser
18-
browser.mouse.move(x: 123, y: 456).down.up
19-
```
20-
2113

2214
## Install
2315

@@ -45,6 +37,14 @@ if you use `Docker` don't forget to pass `no-sandbox` option:
4537
Capybara::Cuprite::Driver.new(app, browser_options: { 'no-sandbox': nil })
4638
```
4739

40+
Since Cuprite uses [Ferrum](https://github.com/rubycdp/ferrum#examples) there
41+
are many useful methods you can call even using this driver:
42+
43+
```ruby
44+
browser = page.driver.browser
45+
browser.mouse.move(x: 123, y: 456).down.up
46+
```
47+
4848
If you already have tests on Poltergeist then it should simply work, for
4949
Selenium you better check your code for `manage` calls because it works
5050
differently in Cuprite, see the documentation below.
@@ -100,12 +100,14 @@ In the middle of the execution Chrome will open a new tab where you can inspect
100100
the content and also if you passed `binding` an `irb` or `pry` console will be
101101
opened where you can further experiment with the test.
102102

103+
103104
## Clicking/Scrolling
104105

105106
* `page.driver.click(x, y)` Click a very specific area of the screen.
106107
* `page.driver.scroll_to(left, top)` Scroll to a given position.
107108
* `element.send_keys(*keys)` Send keys to a given node.
108109

110+
109111
## Request headers
110112

111113
Manipulate HTTP request headers like a boss:
@@ -122,6 +124,7 @@ Notice that `headers=` will overwrite already set headers. You should use
122124
subsequent HTTP requests (including requests for assets, AJAX, etc). They will
123125
be automatically cleared at the end of the test.
124126

127+
125128
## Network traffic
126129

127130
* `page.driver.network_traffic` Inspect network traffic (loaded resources) on
@@ -163,17 +166,20 @@ The following methods are used to inspect and manipulate cookies:
163166
* `page.driver.remove_cookie(name)` - remove a cookie
164167
* `page.driver.clear_cookies` - clear all cookies
165168

169+
166170
## Screenshot
167171

168172
Besides capybara screenshot method you can get image as Base64:
169173

170174
* `page.driver.render_base64(format, options)`
171175

176+
172177
## Authorization
173178

174179
* `page.driver.basic_authorize(user, password)`
175180
* `page.driver.set_proxy(ip, port, type, user, password)`
176181

182+
177183
## URL Blacklisting & Whitelisting
178184

179185
Cuprite supports URL blacklisting, which allows you to prevent scripts from
@@ -194,6 +200,7 @@ If you are experiencing slower run times, consider creating a URL whitelist of
194200
domains that are essential or a blacklist of domains that are not essential,
195201
such as ad networks or analytics, to your testing environment.
196202

203+
197204
## License
198205

199206
Copyright 2018-2020 Machinio

0 commit comments

Comments
 (0)