playwright-ruby-client 1.17.beta1 → 1.18.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. checksums.yaml +4 -4
  2. data/documentation/docs/api/api_request.md +7 -0
  3. data/documentation/docs/api/api_request_context.md +161 -0
  4. data/documentation/docs/api/api_response.md +104 -0
  5. data/documentation/docs/api/browser_context.md +4 -0
  6. data/documentation/docs/api/download.md +1 -3
  7. data/documentation/docs/api/frame.md +1 -1
  8. data/documentation/docs/api/frame_locator.md +10 -1
  9. data/documentation/docs/api/locator.md +19 -47
  10. data/documentation/docs/api/page.md +5 -1
  11. data/documentation/docs/include/api_coverage.md +35 -13
  12. data/lib/playwright/api_response_impl.rb +73 -0
  13. data/lib/playwright/channel_owners/api_request_context.rb +232 -0
  14. data/lib/playwright/channel_owners/browser_context.rb +8 -1
  15. data/lib/playwright/channel_owners/frame.rb +2 -2
  16. data/lib/playwright/channel_owners/local_utils.rb +14 -0
  17. data/lib/playwright/channel_owners/page.rb +6 -2
  18. data/lib/playwright/frame_locator_impl.rb +2 -1
  19. data/lib/playwright/locator_impl.rb +62 -3
  20. data/lib/playwright/tracing_impl.rb +21 -7
  21. data/lib/playwright/version.rb +2 -2
  22. data/lib/playwright_api/android.rb +6 -6
  23. data/lib/playwright_api/android_device.rb +8 -8
  24. data/lib/playwright_api/api_request.rb +20 -0
  25. data/lib/playwright_api/api_request_context.rb +61 -14
  26. data/lib/playwright_api/api_response.rb +81 -0
  27. data/lib/playwright_api/browser.rb +6 -6
  28. data/lib/playwright_api/browser_context.rb +12 -12
  29. data/lib/playwright_api/browser_type.rb +6 -6
  30. data/lib/playwright_api/cdp_session.rb +6 -6
  31. data/lib/playwright_api/console_message.rb +6 -6
  32. data/lib/playwright_api/dialog.rb +6 -6
  33. data/lib/playwright_api/download.rb +0 -4
  34. data/lib/playwright_api/element_handle.rb +6 -6
  35. data/lib/playwright_api/frame.rb +8 -8
  36. data/lib/playwright_api/frame_locator.rb +11 -2
  37. data/lib/playwright_api/js_handle.rb +6 -6
  38. data/lib/playwright_api/local_utils.rb +9 -0
  39. data/lib/playwright_api/locator.rb +16 -46
  40. data/lib/playwright_api/page.rb +17 -12
  41. data/lib/playwright_api/playwright.rb +6 -6
  42. data/lib/playwright_api/request.rb +6 -6
  43. data/lib/playwright_api/response.rb +6 -6
  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. data/playwright.gemspec +1 -1
  49. metadata +15 -8
@@ -56,6 +56,11 @@ module Playwright
56
56
  wrap_impl(@impl.mouse)
57
57
  end
58
58
 
59
+ # API testing helper associated with this page. Requests made with this API will use page cookies.
60
+ def request # property
61
+ wrap_impl(@impl.request)
62
+ end
63
+
59
64
  def touchscreen # property
60
65
  wrap_impl(@impl.touchscreen)
61
66
  end
@@ -681,8 +686,8 @@ module Playwright
681
686
  # different DOM elements. That would happen if the DOM structure between those actions has changed.
682
687
  #
683
688
  # Shortcut for main frame's [`method: Frame.locator`].
684
- def locator(selector)
685
- wrap_impl(@impl.locator(unwrap_impl(selector)))
689
+ def locator(selector, hasText: nil)
690
+ wrap_impl(@impl.locator(unwrap_impl(selector), hasText: unwrap_impl(hasText)))
686
691
  end
687
692
 
688
693
  # The page's main frame. Page is guaranteed to have a main frame which persists during navigations.
@@ -1387,8 +1392,8 @@ module Playwright
1387
1392
  end
1388
1393
 
1389
1394
  # @nodoc
1390
- def stop_js_coverage
1391
- wrap_impl(@impl.stop_js_coverage)
1395
+ def start_css_coverage(resetOnNavigation: nil, reportAnonymousScripts: nil)
1396
+ wrap_impl(@impl.start_css_coverage(resetOnNavigation: unwrap_impl(resetOnNavigation), reportAnonymousScripts: unwrap_impl(reportAnonymousScripts)))
1392
1397
  end
1393
1398
 
1394
1399
  # @nodoc
@@ -1397,8 +1402,8 @@ module Playwright
1397
1402
  end
1398
1403
 
1399
1404
  # @nodoc
1400
- def start_css_coverage(resetOnNavigation: nil, reportAnonymousScripts: nil)
1401
- wrap_impl(@impl.start_css_coverage(resetOnNavigation: unwrap_impl(resetOnNavigation), reportAnonymousScripts: unwrap_impl(reportAnonymousScripts)))
1405
+ def stop_js_coverage
1406
+ wrap_impl(@impl.stop_js_coverage)
1402
1407
  end
1403
1408
 
1404
1409
  # @nodoc
@@ -1406,12 +1411,6 @@ module Playwright
1406
1411
  wrap_impl(@impl.guid)
1407
1412
  end
1408
1413
 
1409
- # -- inherited from EventEmitter --
1410
- # @nodoc
1411
- def off(event, callback)
1412
- event_emitter_proxy.off(event, callback)
1413
- end
1414
-
1415
1414
  # -- inherited from EventEmitter --
1416
1415
  # @nodoc
1417
1416
  def once(event, callback)
@@ -1424,6 +1423,12 @@ module Playwright
1424
1423
  event_emitter_proxy.on(event, callback)
1425
1424
  end
1426
1425
 
1426
+ # -- inherited from EventEmitter --
1427
+ # @nodoc
1428
+ def off(event, callback)
1429
+ event_emitter_proxy.off(event, callback)
1430
+ end
1431
+
1427
1432
  private def event_emitter_proxy
1428
1433
  @event_emitter_proxy ||= EventEmitterProxy.new(self, @impl)
1429
1434
  end
@@ -96,12 +96,6 @@ module Playwright
96
96
  wrap_impl(@impl.electron)
97
97
  end
98
98
 
99
- # -- inherited from EventEmitter --
100
- # @nodoc
101
- def off(event, callback)
102
- event_emitter_proxy.off(event, callback)
103
- end
104
-
105
99
  # -- inherited from EventEmitter --
106
100
  # @nodoc
107
101
  def once(event, callback)
@@ -114,6 +108,12 @@ module Playwright
114
108
  event_emitter_proxy.on(event, callback)
115
109
  end
116
110
 
111
+ # -- inherited from EventEmitter --
112
+ # @nodoc
113
+ def off(event, callback)
114
+ event_emitter_proxy.off(event, callback)
115
+ end
116
+
117
117
  private def event_emitter_proxy
118
118
  @event_emitter_proxy ||= EventEmitterProxy.new(self, @impl)
119
119
  end
@@ -154,12 +154,6 @@ module Playwright
154
154
  wrap_impl(@impl.header_values(unwrap_impl(name)))
155
155
  end
156
156
 
157
- # -- inherited from EventEmitter --
158
- # @nodoc
159
- def off(event, callback)
160
- event_emitter_proxy.off(event, callback)
161
- end
162
-
163
157
  # -- inherited from EventEmitter --
164
158
  # @nodoc
165
159
  def once(event, callback)
@@ -172,6 +166,12 @@ module Playwright
172
166
  event_emitter_proxy.on(event, callback)
173
167
  end
174
168
 
169
+ # -- inherited from EventEmitter --
170
+ # @nodoc
171
+ def off(event, callback)
172
+ event_emitter_proxy.off(event, callback)
173
+ end
174
+
175
175
  private def event_emitter_proxy
176
176
  @event_emitter_proxy ||= EventEmitterProxy.new(self, @impl)
177
177
  end
@@ -97,12 +97,6 @@ module Playwright
97
97
  wrap_impl(@impl.ok?)
98
98
  end
99
99
 
100
- # -- inherited from EventEmitter --
101
- # @nodoc
102
- def off(event, callback)
103
- event_emitter_proxy.off(event, callback)
104
- end
105
-
106
100
  # -- inherited from EventEmitter --
107
101
  # @nodoc
108
102
  def once(event, callback)
@@ -115,6 +109,12 @@ module Playwright
115
109
  event_emitter_proxy.on(event, callback)
116
110
  end
117
111
 
112
+ # -- inherited from EventEmitter --
113
+ # @nodoc
114
+ def off(event, callback)
115
+ event_emitter_proxy.off(event, callback)
116
+ end
117
+
118
118
  private def event_emitter_proxy
119
119
  @event_emitter_proxy ||= EventEmitterProxy.new(self, @impl)
120
120
  end
@@ -56,12 +56,6 @@ module Playwright
56
56
  wrap_impl(@impl.request)
57
57
  end
58
58
 
59
- # -- inherited from EventEmitter --
60
- # @nodoc
61
- def off(event, callback)
62
- event_emitter_proxy.off(event, callback)
63
- end
64
-
65
59
  # -- inherited from EventEmitter --
66
60
  # @nodoc
67
61
  def once(event, callback)
@@ -74,6 +68,12 @@ module Playwright
74
68
  event_emitter_proxy.on(event, callback)
75
69
  end
76
70
 
71
+ # -- inherited from EventEmitter --
72
+ # @nodoc
73
+ def off(event, callback)
74
+ event_emitter_proxy.off(event, callback)
75
+ end
76
+
77
77
  private def event_emitter_proxy
78
78
  @event_emitter_proxy ||= EventEmitterProxy.new(self, @impl)
79
79
  end
@@ -43,12 +43,6 @@ module Playwright
43
43
  wrap_impl(@impl.register(unwrap_impl(name), contentScript: unwrap_impl(contentScript), path: unwrap_impl(path), script: unwrap_impl(script)))
44
44
  end
45
45
 
46
- # -- inherited from EventEmitter --
47
- # @nodoc
48
- def off(event, callback)
49
- event_emitter_proxy.off(event, callback)
50
- end
51
-
52
46
  # -- inherited from EventEmitter --
53
47
  # @nodoc
54
48
  def once(event, callback)
@@ -61,6 +55,12 @@ module Playwright
61
55
  event_emitter_proxy.on(event, callback)
62
56
  end
63
57
 
58
+ # -- inherited from EventEmitter --
59
+ # @nodoc
60
+ def off(event, callback)
61
+ event_emitter_proxy.off(event, callback)
62
+ end
63
+
64
64
  private def event_emitter_proxy
65
65
  @event_emitter_proxy ||= EventEmitterProxy.new(self, @impl)
66
66
  end
@@ -27,12 +27,6 @@ module Playwright
27
27
  wrap_impl(@impl.wait_for_event(unwrap_impl(event), predicate: unwrap_impl(predicate), timeout: unwrap_impl(timeout), &wrap_block_call(block)))
28
28
  end
29
29
 
30
- # -- inherited from EventEmitter --
31
- # @nodoc
32
- def off(event, callback)
33
- event_emitter_proxy.off(event, callback)
34
- end
35
-
36
30
  # -- inherited from EventEmitter --
37
31
  # @nodoc
38
32
  def once(event, callback)
@@ -45,6 +39,12 @@ module Playwright
45
39
  event_emitter_proxy.on(event, callback)
46
40
  end
47
41
 
42
+ # -- inherited from EventEmitter --
43
+ # @nodoc
44
+ def off(event, callback)
45
+ event_emitter_proxy.off(event, callback)
46
+ end
47
+
48
48
  private def event_emitter_proxy
49
49
  @event_emitter_proxy ||= EventEmitterProxy.new(self, @impl)
50
50
  end
@@ -43,20 +43,14 @@ module Playwright
43
43
  wrap_impl(@impl.url)
44
44
  end
45
45
 
46
- # @nodoc
47
- def page=(req)
48
- wrap_impl(@impl.page=(unwrap_impl(req)))
49
- end
50
-
51
46
  # @nodoc
52
47
  def context=(req)
53
48
  wrap_impl(@impl.context=(unwrap_impl(req)))
54
49
  end
55
50
 
56
- # -- inherited from EventEmitter --
57
51
  # @nodoc
58
- def off(event, callback)
59
- event_emitter_proxy.off(event, callback)
52
+ def page=(req)
53
+ wrap_impl(@impl.page=(unwrap_impl(req)))
60
54
  end
61
55
 
62
56
  # -- inherited from EventEmitter --
@@ -71,6 +65,12 @@ module Playwright
71
65
  event_emitter_proxy.on(event, callback)
72
66
  end
73
67
 
68
+ # -- inherited from EventEmitter --
69
+ # @nodoc
70
+ def off(event, callback)
71
+ event_emitter_proxy.off(event, callback)
72
+ end
73
+
74
74
  private def event_emitter_proxy
75
75
  @event_emitter_proxy ||= EventEmitterProxy.new(self, @impl)
76
76
  end
data/playwright.gemspec CHANGED
@@ -27,7 +27,7 @@ Gem::Specification.new do |spec|
27
27
  spec.required_ruby_version = '>= 2.4'
28
28
  spec.add_dependency 'concurrent-ruby', '>= 1.1.6'
29
29
  spec.add_dependency 'mime-types', '>= 3.0'
30
- spec.add_development_dependency 'bundler', '~> 2.2.3'
30
+ spec.add_development_dependency 'bundler', '~> 2.3.0'
31
31
  spec.add_development_dependency 'chunky_png'
32
32
  spec.add_development_dependency 'dry-inflector'
33
33
  spec.add_development_dependency 'faye-websocket'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: playwright-ruby-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.17.beta1
4
+ version: 1.18.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - YusukeIwaki
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-11-22 00:00:00.000000000 Z
11
+ date: 2022-02-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: concurrent-ruby
@@ -44,14 +44,14 @@ dependencies:
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: 2.2.3
47
+ version: 2.3.0
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: 2.2.3
54
+ version: 2.3.0
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: chunky_png
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -210,7 +210,9 @@ files:
210
210
  - documentation/README.md
211
211
  - documentation/babel.config.js
212
212
  - documentation/docs/api/accessibility.md
213
+ - documentation/docs/api/api_request.md
213
214
  - documentation/docs/api/api_request_context.md
215
+ - documentation/docs/api/api_response.md
214
216
  - documentation/docs/api/browser.md
215
217
  - documentation/docs/api/browser_context.md
216
218
  - documentation/docs/api/browser_type.md
@@ -275,6 +277,7 @@ files:
275
277
  - lib/playwright/accessibility_impl.rb
276
278
  - lib/playwright/android_input_impl.rb
277
279
  - lib/playwright/api_implementation.rb
280
+ - lib/playwright/api_response_impl.rb
278
281
  - lib/playwright/channel.rb
279
282
  - lib/playwright/channel_owner.rb
280
283
  - lib/playwright/channel_owners/android.rb
@@ -293,6 +296,7 @@ files:
293
296
  - lib/playwright/channel_owners/fetch_request.rb
294
297
  - lib/playwright/channel_owners/frame.rb
295
298
  - lib/playwright/channel_owners/js_handle.rb
299
+ - lib/playwright/channel_owners/local_utils.rb
296
300
  - lib/playwright/channel_owners/page.rb
297
301
  - lib/playwright/channel_owners/playwright.rb
298
302
  - lib/playwright/channel_owners/request.rb
@@ -340,7 +344,9 @@ files:
340
344
  - lib/playwright_api/android_input.rb
341
345
  - lib/playwright_api/android_socket.rb
342
346
  - lib/playwright_api/android_web_view.rb
347
+ - lib/playwright_api/api_request.rb
343
348
  - lib/playwright_api/api_request_context.rb
349
+ - lib/playwright_api/api_response.rb
344
350
  - lib/playwright_api/browser.rb
345
351
  - lib/playwright_api/browser_context.rb
346
352
  - lib/playwright_api/browser_type.rb
@@ -354,6 +360,7 @@ files:
354
360
  - lib/playwright_api/frame_locator.rb
355
361
  - lib/playwright_api/js_handle.rb
356
362
  - lib/playwright_api/keyboard.rb
363
+ - lib/playwright_api/local_utils.rb
357
364
  - lib/playwright_api/locator.rb
358
365
  - lib/playwright_api/mouse.rb
359
366
  - lib/playwright_api/page.rb
@@ -382,12 +389,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
382
389
  version: '2.4'
383
390
  required_rubygems_version: !ruby/object:Gem::Requirement
384
391
  requirements:
385
- - - ">"
392
+ - - ">="
386
393
  - !ruby/object:Gem::Version
387
- version: 1.3.1
394
+ version: '0'
388
395
  requirements: []
389
- rubygems_version: 3.2.22
396
+ rubygems_version: 3.3.3
390
397
  signing_key:
391
398
  specification_version: 4
392
- summary: The Ruby binding of playwright driver 1.17.0
399
+ summary: The Ruby binding of playwright driver 1.18.1
393
400
  test_files: []