@@ -10,14 +10,6 @@ to the browser by CDP protocol. The design of the driver is as close to
10
10
[ Poltergeist] ( https://github.com/teampoltergeist/poltergeist ) as possible though
11
11
it's not a goal.
12
12
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
-
21
13
22
14
## Install
23
15
@@ -45,6 +37,14 @@ if you use `Docker` don't forget to pass `no-sandbox` option:
45
37
Capybara ::Cuprite ::Driver .new (app, browser_options: { ' no-sandbox' : nil })
46
38
```
47
39
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
+
48
48
If you already have tests on Poltergeist then it should simply work, for
49
49
Selenium you better check your code for ` manage ` calls because it works
50
50
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
100
100
the content and also if you passed ` binding ` an ` irb ` or ` pry ` console will be
101
101
opened where you can further experiment with the test.
102
102
103
+
103
104
## Clicking/Scrolling
104
105
105
106
* ` page.driver.click(x, y) ` Click a very specific area of the screen.
106
107
* ` page.driver.scroll_to(left, top) ` Scroll to a given position.
107
108
* ` element.send_keys(*keys) ` Send keys to a given node.
108
109
110
+
109
111
## Request headers
110
112
111
113
Manipulate HTTP request headers like a boss:
@@ -122,6 +124,7 @@ Notice that `headers=` will overwrite already set headers. You should use
122
124
subsequent HTTP requests (including requests for assets, AJAX, etc). They will
123
125
be automatically cleared at the end of the test.
124
126
127
+
125
128
## Network traffic
126
129
127
130
* ` page.driver.network_traffic ` Inspect network traffic (loaded resources) on
@@ -163,17 +166,20 @@ The following methods are used to inspect and manipulate cookies:
163
166
* ` page.driver.remove_cookie(name) ` - remove a cookie
164
167
* ` page.driver.clear_cookies ` - clear all cookies
165
168
169
+
166
170
## Screenshot
167
171
168
172
Besides capybara screenshot method you can get image as Base64:
169
173
170
174
* ` page.driver.render_base64(format, options) `
171
175
176
+
172
177
## Authorization
173
178
174
179
* ` page.driver.basic_authorize(user, password) `
175
180
* ` page.driver.set_proxy(ip, port, type, user, password) `
176
181
182
+
177
183
## URL Blacklisting & Whitelisting
178
184
179
185
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
194
200
domains that are essential or a blacklist of domains that are not essential,
195
201
such as ad networks or analytics, to your testing environment.
196
202
203
+
197
204
## License
198
205
199
206
Copyright 2018-2020 Machinio
0 commit comments