playwright-ruby-client 1.15.beta2 → 1.16.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (48) hide show
  1. checksums.yaml +4 -4
  2. data/documentation/docs/api/api_request_context.md +10 -0
  3. data/documentation/docs/api/browser_context.md +1 -1
  4. data/documentation/docs/api/locator.md +18 -0
  5. data/documentation/docs/api/mouse.md +11 -0
  6. data/documentation/docs/api/page.md +2 -1
  7. data/documentation/docs/api/request.md +10 -3
  8. data/documentation/docs/api/response.md +20 -2
  9. data/documentation/docs/include/api_coverage.md +17 -0
  10. data/documentation/package.json +2 -2
  11. data/documentation/yarn.lock +1430 -1486
  12. data/lib/playwright/channel_owners/api_request_context.rb +4 -0
  13. data/lib/playwright/channel_owners/browser_context.rb +5 -0
  14. data/lib/playwright/channel_owners/fetch_request.rb +6 -0
  15. data/lib/playwright/channel_owners/frame.rb +3 -1
  16. data/lib/playwright/channel_owners/page.rb +5 -0
  17. data/lib/playwright/channel_owners/request.rb +19 -16
  18. data/lib/playwright/channel_owners/response.rb +16 -13
  19. data/lib/playwright/http_headers.rb +0 -11
  20. data/lib/playwright/locator_impl.rb +4 -0
  21. data/lib/playwright/mouse_impl.rb +9 -0
  22. data/lib/playwright/raw_headers.rb +61 -0
  23. data/lib/playwright/route_handler.rb +13 -1
  24. data/lib/playwright/version.rb +2 -2
  25. data/lib/playwright.rb +1 -0
  26. data/lib/playwright_api/android.rb +6 -6
  27. data/lib/playwright_api/android_device.rb +6 -6
  28. data/lib/playwright_api/api_request_context.rb +146 -0
  29. data/lib/playwright_api/browser.rb +6 -6
  30. data/lib/playwright_api/browser_context.rb +7 -7
  31. data/lib/playwright_api/browser_type.rb +6 -6
  32. data/lib/playwright_api/cdp_session.rb +7 -7
  33. data/lib/playwright_api/console_message.rb +6 -6
  34. data/lib/playwright_api/dialog.rb +6 -6
  35. data/lib/playwright_api/element_handle.rb +6 -6
  36. data/lib/playwright_api/frame.rb +6 -6
  37. data/lib/playwright_api/js_handle.rb +6 -6
  38. data/lib/playwright_api/locator.rb +13 -0
  39. data/lib/playwright_api/mouse.rb +8 -0
  40. data/lib/playwright_api/page.rb +8 -7
  41. data/lib/playwright_api/playwright.rb +8 -8
  42. data/lib/playwright_api/request.rb +15 -11
  43. data/lib/playwright_api/response.rb +20 -13
  44. data/lib/playwright_api/route.rb +6 -6
  45. data/lib/playwright_api/selectors.rb +6 -6
  46. data/lib/playwright_api/web_socket.rb +6 -6
  47. data/lib/playwright_api/worker.rb +8 -8
  48. metadata +10 -5
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2247f39a5fa4881e45ad884606295d7003b3e42ca9db5436b223d921649e5553
4
- data.tar.gz: f7f57d5044c66e300912578faa1d8114ee98f2eb1de736eac3da698e7851b9d6
3
+ metadata.gz: d6230bd49d8e914d2ba9f4d23910e69fcc003f983cf51abb142d4361e1332fd6
4
+ data.tar.gz: 9cf6be0bde1f294a50604f22f8be756040a02af94c61fff376354c5b1ec8d9fe
5
5
  SHA512:
6
- metadata.gz: 86b2003368d06755bfef64cebe40c716ef9d0156d6bd21f18fddc79cef07ffee5a48f562294c32b956dd664b5480326587736ee56334c76e80e8a8e2b89dfb72
7
- data.tar.gz: 20697ed55fb7ce54856d04dc0f9568316d5941b0b103ce5c0138e680a28aeda1b7876a3cf4d358f006a2b5d7115a267ed8e7c689064bf54f65e6797848d69a2f
6
+ metadata.gz: 97bcd9185a7ac82910dcbae93c0131cf285b9c73d881705ae9b88b01fef388b999b4001e37f866f229dba2a0cb0d81af65bee34cb4301eaf16389b927aaba334
7
+ data.tar.gz: 047dd6e73800e629a439341d720df9e9281e9456f5f94eeeeaf475de7d439c5b0bf97332242497937684ae919e8b603f1b532a97cf6880f16c77f4f42d400ab2
@@ -0,0 +1,10 @@
1
+ ---
2
+ sidebar_position: 10
3
+ ---
4
+
5
+ # APIRequestContext
6
+
7
+ This API is used for the Web API testing. You can use it to trigger API endpoints, configure micro-services, prepare
8
+ environment or the service to your e2e test. When used on [Page](./page) or a [BrowserContext](./browser_context), this API will automatically use
9
+ the cookies from the corresponding [BrowserContext](./browser_context). This means that if you log in using this API, your e2e test will be
10
+ logged in and vice versa.
@@ -11,7 +11,7 @@ BrowserContexts provide a way to operate multiple independent browser sessions.
11
11
  If a page opens another page, e.g. with a `window.open` call, the popup will belong to the parent page's browser
12
12
  context.
13
13
 
14
- Playwright allows creation of "incognito" browser contexts with [Browser#new_context](./browser#new_context) method. "Incognito" browser
14
+ Playwright allows creating "incognito" browser contexts with [Browser#new_context](./browser#new_context) method. "Incognito" browser
15
15
  contexts don't write any browsing data to disk.
16
16
 
17
17
  ```ruby
@@ -677,3 +677,21 @@ If the element is detached from the DOM at any moment during the action, this me
677
677
 
678
678
  When all steps combined have not finished during the specified `timeout`, this method throws a `TimeoutError`. Passing
679
679
  zero timeout disables this.
680
+
681
+ ## wait_for
682
+
683
+ ```
684
+ def wait_for(state: nil, timeout: nil)
685
+ ```
686
+
687
+ Returns when element specified by locator satisfies the `state` option.
688
+
689
+ If target element already satisfies the condition, the method returns immediately. Otherwise, waits for up to `timeout`
690
+ milliseconds until the condition is met.
691
+
692
+ ```ruby
693
+ order_sent = page.locator("#order-sent")
694
+ order_sent.wait_for
695
+ ```
696
+
697
+
@@ -66,3 +66,14 @@ def up(button: nil, clickCount: nil)
66
66
  ```
67
67
 
68
68
  Dispatches a `mouseup` event.
69
+
70
+ ## wheel
71
+
72
+ ```
73
+ def wheel(deltaX, deltaY)
74
+ ```
75
+
76
+ Dispatches a `wheel` event.
77
+
78
+ > NOTE: Wheel events may cause scrolling if they are not handled, and this method does not wait for the scrolling to
79
+ finish before returning.
@@ -1141,7 +1141,8 @@ In the case of multiple pages in a single browser, each page can have its own vi
1141
1141
  [Browser#new_context](./browser#new_context) allows to set viewport size (and more) for all pages in the context at once.
1142
1142
 
1143
1143
  `page.setViewportSize` will resize the page. A lot of websites don't expect phones to change size, so you should set the
1144
- viewport size before navigating to the page.
1144
+ viewport size before navigating to the page. [Page#set_viewport_size](./page#set_viewport_size) will also reset `screen` size, use
1145
+ [Browser#new_context](./browser#new_context) with `screen` and `viewport` parameters if you need better control of these properties.
1145
1146
 
1146
1147
  ```ruby
1147
1148
  page.viewport_size = { width: 640, height: 480 }
@@ -65,7 +65,15 @@ def headers_array
65
65
  ```
66
66
 
67
67
  An array with all the request HTTP headers associated with this request. Unlike [Request#all_headers](./request#all_headers), header
68
- names are not lower-cased. Headers with multiple entries, such as `Set-Cookie`, appear in the array multiple times.
68
+ names are NOT lower-cased. Headers with multiple entries, such as `Set-Cookie`, appear in the array multiple times.
69
+
70
+ ## header_value
71
+
72
+ ```
73
+ def header_value(name)
74
+ ```
75
+
76
+ Returns the value of the header matching the name. The name is case insensitive.
69
77
 
70
78
  ## navigation_request?
71
79
 
@@ -179,8 +187,7 @@ Returns the matching [Response](./response) object, or `null` if the response wa
179
187
  def sizes
180
188
  ```
181
189
 
182
- Returns resource size information for given request. Requires the response to be finished via
183
- [Response#finished](./response#finished) to ensure the info is available.
190
+ Returns resource size information for given request.
184
191
 
185
192
  ## timing
186
193
 
@@ -28,7 +28,7 @@ Returns the buffer with response body.
28
28
  def finished
29
29
  ```
30
30
 
31
- Waits for this response to finish, returns failure error if request failed.
31
+ Waits for this response to finish, returns always `null`.
32
32
 
33
33
  ## frame
34
34
 
@@ -53,7 +53,25 @@ def headers_array
53
53
  ```
54
54
 
55
55
  An array with all the request HTTP headers associated with this response. Unlike [Response#all_headers](./response#all_headers), header
56
- names are not lower-cased. Headers with multiple entries, such as `Set-Cookie`, appear in the array multiple times.
56
+ names are NOT lower-cased. Headers with multiple entries, such as `Set-Cookie`, appear in the array multiple times.
57
+
58
+ ## header_value
59
+
60
+ ```
61
+ def header_value(name)
62
+ ```
63
+
64
+ Returns the value of the header matching the name. The name is case insensitive. If multiple headers have the same name
65
+ (except `set-cookie`), they are returned as a list separated by `, `. For `set-cookie`, the `\n` separator is used. If
66
+ no headers are found, `null` is returned.
67
+
68
+ ## header_values
69
+
70
+ ```
71
+ def header_values(name)
72
+ ```
73
+
74
+ Returns all values of the headers matching the name, for example `set-cookie`. The name is case insensitive.
57
75
 
58
76
  ## json
59
77
 
@@ -1,5 +1,17 @@
1
1
  # API coverages
2
2
 
3
+ ## APIRequestContext
4
+
5
+ * ~~delete~~
6
+ * ~~dispose~~
7
+ * ~~fetch~~
8
+ * ~~get~~
9
+ * ~~head~~
10
+ * ~~patch~~
11
+ * ~~post~~
12
+ * ~~put~~
13
+ * ~~storage_state~~
14
+
3
15
  ## Request
4
16
 
5
17
  * all_headers
@@ -7,6 +19,7 @@
7
19
  * frame
8
20
  * headers
9
21
  * headers_array
22
+ * header_value
10
23
  * navigation_request?
11
24
  * method
12
25
  * post_data
@@ -28,6 +41,8 @@
28
41
  * frame
29
42
  * headers
30
43
  * headers_array
44
+ * header_value
45
+ * header_values
31
46
  * json
32
47
  * ok
33
48
  * request
@@ -67,6 +82,7 @@
67
82
  * down
68
83
  * move
69
84
  * up
85
+ * wheel
70
86
 
71
87
  ## Touchscreen
72
88
 
@@ -430,6 +446,7 @@
430
446
  * text_content
431
447
  * type
432
448
  * uncheck
449
+ * wait_for
433
450
 
434
451
  ## Android
435
452
 
@@ -14,8 +14,8 @@
14
14
  "write-heading-ids": "docusaurus write-heading-ids"
15
15
  },
16
16
  "dependencies": {
17
- "@docusaurus/core": "^2.0.0-beta.5",
18
- "@docusaurus/preset-classic": "^2.0.0-beta.5",
17
+ "@docusaurus/core": "^2.0.0-beta.6",
18
+ "@docusaurus/preset-classic": "^2.0.0-beta.6",
19
19
  "@mdx-js/react": "^1.6.21",
20
20
  "@svgr/webpack": "^5.5.0",
21
21
  "clsx": "^1.1.1",