@@ -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
1111it'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:
4537Capybara ::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+
4848If you already have tests on Poltergeist then it should simply work, for
4949Selenium you better check your code for ` manage ` calls because it works
5050differently 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
100100the content and also if you passed ` binding ` an ` irb ` or ` pry ` console will be
101101opened 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
111113Manipulate HTTP request headers like a boss:
@@ -122,6 +124,7 @@ Notice that `headers=` will overwrite already set headers. You should use
122124subsequent HTTP requests (including requests for assets, AJAX, etc). They will
123125be 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
168172Besides 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
179185Cuprite 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
194200domains that are essential or a blacklist of domains that are not essential,
195201such as ad networks or analytics, to your testing environment.
196202
203+
197204## License
198205
199206Copyright 2018-2020 Machinio
0 commit comments