playwright-ruby-client 1.15.beta1 → 1.15.beta2

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 (69) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +10 -14
  3. data/documentation/docs/api/browser.md +2 -0
  4. data/documentation/docs/api/browser_context.md +5 -1
  5. data/documentation/docs/api/browser_type.md +1 -0
  6. data/documentation/docs/api/element_handle.md +27 -1
  7. data/documentation/docs/api/experimental/android_device.md +1 -0
  8. data/documentation/docs/api/frame.md +28 -0
  9. data/documentation/docs/api/locator.md +29 -0
  10. data/documentation/docs/api/page.md +35 -2
  11. data/documentation/docs/api/request.md +27 -1
  12. data/documentation/docs/api/response.md +18 -1
  13. data/documentation/docs/api/tracing.md +42 -8
  14. data/documentation/docs/article/getting_started.md +10 -1
  15. data/documentation/docs/article/guides/download_playwright_driver.md +9 -0
  16. data/documentation/docs/article/guides/inspector.md +1 -1
  17. data/documentation/docs/article/guides/playwright_on_alpine_linux.md +56 -3
  18. data/documentation/docs/article/guides/rails_integration.md +4 -2
  19. data/documentation/docs/article/guides/rails_integration_with_null_driver.md +86 -0
  20. data/documentation/docs/article/guides/recording_video.md +1 -1
  21. data/documentation/docs/article/guides/semi_automation.md +1 -1
  22. data/documentation/docs/article/guides/use_storage_state.md +1 -1
  23. data/documentation/docs/include/api_coverage.md +11 -0
  24. data/documentation/docusaurus.config.js +1 -0
  25. data/documentation/package.json +2 -2
  26. data/documentation/src/pages/index.js +0 -1
  27. data/documentation/static/img/playwright-ruby-client.png +0 -0
  28. data/documentation/yarn.lock +625 -549
  29. data/lib/playwright/channel.rb +36 -2
  30. data/lib/playwright/channel_owners/artifact.rb +6 -2
  31. data/lib/playwright/channel_owners/browser.rb +4 -0
  32. data/lib/playwright/channel_owners/browser_context.rb +21 -14
  33. data/lib/playwright/channel_owners/element_handle.rb +10 -2
  34. data/lib/playwright/channel_owners/frame.rb +8 -0
  35. data/lib/playwright/channel_owners/page.rb +20 -4
  36. data/lib/playwright/channel_owners/request.rb +38 -17
  37. data/lib/playwright/channel_owners/response.rb +41 -5
  38. data/lib/playwright/connection.rb +5 -3
  39. data/lib/playwright/http_headers.rb +9 -4
  40. data/lib/playwright/locator_impl.rb +8 -0
  41. data/lib/playwright/{route_handler_entry.rb → route_handler.rb} +30 -2
  42. data/lib/playwright/tracing_impl.rb +18 -7
  43. data/lib/playwright/transport.rb +2 -0
  44. data/lib/playwright/utils.rb +8 -0
  45. data/lib/playwright/version.rb +1 -1
  46. data/lib/playwright/web_socket_transport.rb +2 -0
  47. data/lib/playwright.rb +1 -1
  48. data/lib/playwright_api/android.rb +6 -6
  49. data/lib/playwright_api/android_device.rb +10 -9
  50. data/lib/playwright_api/browser.rb +10 -8
  51. data/lib/playwright_api/browser_context.rb +12 -8
  52. data/lib/playwright_api/browser_type.rb +8 -7
  53. data/lib/playwright_api/cdp_session.rb +6 -6
  54. data/lib/playwright_api/console_message.rb +6 -6
  55. data/lib/playwright_api/dialog.rb +6 -6
  56. data/lib/playwright_api/element_handle.rb +31 -8
  57. data/lib/playwright_api/frame.rb +31 -6
  58. data/lib/playwright_api/js_handle.rb +6 -6
  59. data/lib/playwright_api/locator.rb +26 -0
  60. data/lib/playwright_api/page.rb +40 -10
  61. data/lib/playwright_api/playwright.rb +6 -6
  62. data/lib/playwright_api/request.rb +26 -4
  63. data/lib/playwright_api/response.rb +20 -4
  64. data/lib/playwright_api/route.rb +6 -6
  65. data/lib/playwright_api/selectors.rb +6 -6
  66. data/lib/playwright_api/tracing.rb +33 -4
  67. data/lib/playwright_api/web_socket.rb +6 -6
  68. data/lib/playwright_api/worker.rb +8 -8
  69. metadata +5 -3
@@ -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 on(event, callback)
62
- event_emitter_proxy.on(event, callback)
63
- end
64
-
65
59
  # -- inherited from EventEmitter --
66
60
  # @nodoc
67
61
  def off(event, callback)
@@ -74,6 +68,12 @@ module Playwright
74
68
  event_emitter_proxy.once(event, callback)
75
69
  end
76
70
 
71
+ # -- inherited from EventEmitter --
72
+ # @nodoc
73
+ def on(event, callback)
74
+ event_emitter_proxy.on(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 on(event, callback)
49
- event_emitter_proxy.on(event, callback)
50
- end
51
-
52
46
  # -- inherited from EventEmitter --
53
47
  # @nodoc
54
48
  def off(event, callback)
@@ -61,6 +55,12 @@ module Playwright
61
55
  event_emitter_proxy.once(event, callback)
62
56
  end
63
57
 
58
+ # -- inherited from EventEmitter --
59
+ # @nodoc
60
+ def on(event, callback)
61
+ event_emitter_proxy.on(event, callback)
62
+ end
63
+
64
64
  private def event_emitter_proxy
65
65
  @event_emitter_proxy ||= EventEmitterProxy.new(self, @impl)
66
66
  end
@@ -1,13 +1,14 @@
1
1
  module Playwright
2
- # API for collecting and saving Playwright traces. Playwright traces can be opened using the Playwright CLI after
3
- # Playwright script runs.
2
+ # API for collecting and saving Playwright traces. Playwright traces can be opened in [Trace Viewer](./trace-viewer.md)
3
+ # after Playwright script runs.
4
4
  #
5
- # Start with specifying the folder traces will be stored in:
5
+ # Start recording a trace before performing actions. At the end, stop tracing and save it to a file.
6
6
  #
7
7
  # ```python sync
8
8
  # browser = chromium.launch()
9
9
  # context = browser.new_context()
10
10
  # context.tracing.start(screenshots=True, snapshots=True)
11
+ # page = context.new_page()
11
12
  # page.goto("https://playwright.dev")
12
13
  # context.tracing.stop(path = "trace.zip")
13
14
  # ```
@@ -17,17 +18,45 @@ module Playwright
17
18
  #
18
19
  # ```python sync
19
20
  # context.tracing.start(name="trace", screenshots=True, snapshots=True)
21
+ # page = context.new_page()
20
22
  # page.goto("https://playwright.dev")
21
- # context.tracing.stop()
22
23
  # context.tracing.stop(path = "trace.zip")
23
24
  # ```
24
25
  def start(name: nil, screenshots: nil, snapshots: nil)
25
26
  wrap_impl(@impl.start(name: unwrap_impl(name), screenshots: unwrap_impl(screenshots), snapshots: unwrap_impl(snapshots)))
26
27
  end
27
28
 
29
+ # Start a new trace chunk. If you'd like to record multiple traces on the same `BrowserContext`, use
30
+ # [`method: Tracing.start`] once, and then create multiple trace chunks with [`method: Tracing.startChunk`] and
31
+ # [`method: Tracing.stopChunk`].
32
+ #
33
+ # ```python sync
34
+ # context.tracing.start(name="trace", screenshots=True, snapshots=True)
35
+ # page = context.new_page()
36
+ # page.goto("https://playwright.dev")
37
+ #
38
+ # context.tracing.start_chunk()
39
+ # page.click("text=Get Started")
40
+ # # Everything between start_chunk and stop_chunk will be recorded in the trace.
41
+ # context.tracing.stop_chunk(path = "trace1.zip")
42
+ #
43
+ # context.tracing.start_chunk()
44
+ # page.goto("http://example.com")
45
+ # # Save a second trace file with different actions.
46
+ # context.tracing.stop_chunk(path = "trace2.zip")
47
+ # ```
48
+ def start_chunk
49
+ wrap_impl(@impl.start_chunk)
50
+ end
51
+
28
52
  # Stop tracing.
29
53
  def stop(path: nil)
30
54
  wrap_impl(@impl.stop(path: unwrap_impl(path)))
31
55
  end
56
+
57
+ # Stop the trace chunk. See [`method: Tracing.startChunk`] for more details about multiple trace chunks.
58
+ def stop_chunk(path: nil)
59
+ wrap_impl(@impl.stop_chunk(path: unwrap_impl(path)))
60
+ end
32
61
  end
33
62
  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 on(event, callback)
33
- event_emitter_proxy.on(event, callback)
34
- end
35
-
36
30
  # -- inherited from EventEmitter --
37
31
  # @nodoc
38
32
  def off(event, callback)
@@ -45,6 +39,12 @@ module Playwright
45
39
  event_emitter_proxy.once(event, callback)
46
40
  end
47
41
 
42
+ # -- inherited from EventEmitter --
43
+ # @nodoc
44
+ def on(event, callback)
45
+ event_emitter_proxy.on(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 context=(req)
48
- wrap_impl(@impl.context=(unwrap_impl(req)))
49
- end
50
-
51
46
  # @nodoc
52
47
  def page=(req)
53
48
  wrap_impl(@impl.page=(unwrap_impl(req)))
54
49
  end
55
50
 
56
- # -- inherited from EventEmitter --
57
51
  # @nodoc
58
- def on(event, callback)
59
- event_emitter_proxy.on(event, callback)
52
+ def context=(req)
53
+ wrap_impl(@impl.context=(unwrap_impl(req)))
60
54
  end
61
55
 
62
56
  # -- inherited from EventEmitter --
@@ -71,6 +65,12 @@ module Playwright
71
65
  event_emitter_proxy.once(event, callback)
72
66
  end
73
67
 
68
+ # -- inherited from EventEmitter --
69
+ # @nodoc
70
+ def on(event, callback)
71
+ event_emitter_proxy.on(event, callback)
72
+ end
73
+
74
74
  private def event_emitter_proxy
75
75
  @event_emitter_proxy ||= EventEmitterProxy.new(self, @impl)
76
76
  end
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.15.beta1
4
+ version: 1.15.beta2
5
5
  platform: ruby
6
6
  authors:
7
7
  - YusukeIwaki
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-08-23 00:00:00.000000000 Z
11
+ date: 2021-09-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: concurrent-ruby
@@ -248,6 +248,7 @@ files:
248
248
  - documentation/docs/article/guides/launch_browser.md
249
249
  - documentation/docs/article/guides/playwright_on_alpine_linux.md
250
250
  - documentation/docs/article/guides/rails_integration.md
251
+ - documentation/docs/article/guides/rails_integration_with_null_driver.md
251
252
  - documentation/docs/article/guides/recording_video.md
252
253
  - documentation/docs/article/guides/semi_automation.md
253
254
  - documentation/docs/article/guides/use_storage_state.md
@@ -263,6 +264,7 @@ files:
263
264
  - documentation/src/pages/markdown-page.md
264
265
  - documentation/static/.nojekyll
265
266
  - documentation/static/img/playwright-logo.svg
267
+ - documentation/static/img/playwright-ruby-client.png
266
268
  - documentation/static/img/undraw_dropdown_menu.svg
267
269
  - documentation/static/img/undraw_web_development.svg
268
270
  - documentation/static/img/undraw_windows.svg
@@ -313,7 +315,7 @@ files:
313
315
  - lib/playwright/locator_impl.rb
314
316
  - lib/playwright/mouse_impl.rb
315
317
  - lib/playwright/playwright_api.rb
316
- - lib/playwright/route_handler_entry.rb
318
+ - lib/playwright/route_handler.rb
317
319
  - lib/playwright/select_option_values.rb
318
320
  - lib/playwright/timeout_settings.rb
319
321
  - lib/playwright/touchscreen_impl.rb