playwright-ruby-client 1.28.1 → 1.29.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (77) hide show
  1. checksums.yaml +4 -4
  2. data/documentation/docs/api/accessibility.md +9 -14
  3. data/documentation/docs/api/api_request_context.md +44 -41
  4. data/documentation/docs/api/api_response.md +13 -3
  5. data/documentation/docs/api/browser.md +24 -23
  6. data/documentation/docs/api/browser_context.md +71 -45
  7. data/documentation/docs/api/browser_type.md +21 -14
  8. data/documentation/docs/api/cdp_session.md +3 -5
  9. data/documentation/docs/api/console_message.md +7 -4
  10. data/documentation/docs/api/dialog.md +9 -5
  11. data/documentation/docs/api/download.md +19 -11
  12. data/documentation/docs/api/element_handle.md +125 -116
  13. data/documentation/docs/api/experimental/android.md +4 -5
  14. data/documentation/docs/api/experimental/android_device.md +11 -2
  15. data/documentation/docs/api/experimental/android_input.md +5 -0
  16. data/documentation/docs/api/file_chooser.md +6 -3
  17. data/documentation/docs/api/frame.md +182 -171
  18. data/documentation/docs/api/frame_locator.md +27 -38
  19. data/documentation/docs/api/js_handle.md +16 -10
  20. data/documentation/docs/api/keyboard.md +29 -16
  21. data/documentation/docs/api/locator.md +189 -140
  22. data/documentation/docs/api/mouse.md +9 -4
  23. data/documentation/docs/api/page.md +304 -289
  24. data/documentation/docs/api/playwright.md +8 -5
  25. data/documentation/docs/api/request.md +34 -15
  26. data/documentation/docs/api/response.md +27 -10
  27. data/documentation/docs/api/route.md +44 -12
  28. data/documentation/docs/api/selectors.md +5 -3
  29. data/documentation/docs/api/touchscreen.md +2 -0
  30. data/documentation/docs/api/tracing.md +11 -11
  31. data/documentation/docs/api/web_socket.md +9 -4
  32. data/documentation/docs/api/worker.md +12 -11
  33. data/documentation/docs/include/api_coverage.md +2 -0
  34. data/lib/playwright/channel_owners/api_request_context.rb +37 -2
  35. data/lib/playwright/channel_owners/browser_context.rb +22 -26
  36. data/lib/playwright/channel_owners/page.rb +35 -25
  37. data/lib/playwright/channel_owners/route.rb +28 -8
  38. data/lib/playwright/event_emitter.rb +6 -1
  39. data/lib/playwright/locator_impl.rb +8 -0
  40. data/lib/playwright/select_option_values.rb +2 -0
  41. data/lib/playwright/version.rb +2 -2
  42. data/lib/playwright_api/accessibility.rb +9 -13
  43. data/lib/playwright_api/android.rb +8 -6
  44. data/lib/playwright_api/android_device.rb +32 -7
  45. data/lib/playwright_api/android_input.rb +5 -0
  46. data/lib/playwright_api/android_socket.rb +4 -2
  47. data/lib/playwright_api/android_web_view.rb +5 -2
  48. data/lib/playwright_api/api_request.rb +6 -3
  49. data/lib/playwright_api/api_request_context.rb +46 -36
  50. data/lib/playwright_api/api_response.rb +13 -2
  51. data/lib/playwright_api/browser.rb +24 -16
  52. data/lib/playwright_api/browser_context.rb +76 -39
  53. data/lib/playwright_api/browser_type.rb +23 -13
  54. data/lib/playwright_api/cdp_session.rb +3 -4
  55. data/lib/playwright_api/console_message.rb +7 -2
  56. data/lib/playwright_api/dialog.rb +8 -4
  57. data/lib/playwright_api/download.rb +19 -9
  58. data/lib/playwright_api/element_handle.rb +116 -93
  59. data/lib/playwright_api/file_chooser.rb +6 -1
  60. data/lib/playwright_api/frame.rb +180 -135
  61. data/lib/playwright_api/frame_locator.rb +29 -32
  62. data/lib/playwright_api/js_handle.rb +16 -6
  63. data/lib/playwright_api/keyboard.rb +29 -14
  64. data/lib/playwright_api/locator.rb +183 -112
  65. data/lib/playwright_api/mouse.rb +9 -2
  66. data/lib/playwright_api/page.rb +301 -253
  67. data/lib/playwright_api/playwright.rb +11 -4
  68. data/lib/playwright_api/request.rb +34 -7
  69. data/lib/playwright_api/response.rb +27 -10
  70. data/lib/playwright_api/route.rb +44 -11
  71. data/lib/playwright_api/selectors.rb +6 -1
  72. data/lib/playwright_api/touchscreen.rb +2 -0
  73. data/lib/playwright_api/tracing.rb +11 -5
  74. data/lib/playwright_api/web_socket.rb +9 -4
  75. data/lib/playwright_api/worker.rb +16 -13
  76. data/playwright.gemspec +1 -1
  77. metadata +7 -7
@@ -4,12 +4,12 @@ sidebar_position: 10
4
4
 
5
5
  # Android
6
6
 
7
+
7
8
  Playwright has **experimental** support for Android automation. This includes Chrome for Android and Android WebView.
8
9
 
9
10
  *Requirements*
10
11
  - Android device or AVD Emulator.
11
- - [ADB daemon](https://developer.android.com/studio/command-line/adb) running and authenticated with your device.
12
- Typically running `adb devices` is all you need to do.
12
+ - [ADB daemon](https://developer.android.com/studio/command-line/adb) running and authenticated with your device. Typically running `adb devices` is all you need to do.
13
13
  - [`Chrome 87`](https://play.google.com/store/apps/details?id=com.android.chrome) or newer installed on the device
14
14
  - "Enable command line on non-rooted devices" enabled in `chrome://flags`.
15
15
 
@@ -22,18 +22,17 @@ Playwright has **experimental** support for Android automation. This includes Ch
22
22
 
23
23
  An example of the Android automation script would be:
24
24
 
25
- Note that since you don't need Playwright to install web browsers when testing Android, you can omit browser download
26
- via setting the following environment variable when installing Playwright:
25
+ Note that since you don't need Playwright to install web browsers when testing Android, you can omit browser download via setting the following environment variable when installing Playwright:
27
26
 
28
27
  ```bash js
29
28
  PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1 npm i -D playwright
30
29
  ```
31
30
 
32
-
33
31
  ## devices
34
32
 
35
33
  ```
36
34
  def devices(host: nil, omitDriverInstall: nil, port: nil)
37
35
  ```
38
36
 
37
+
39
38
  Returns the list of detected Android devices.
@@ -4,8 +4,8 @@ sidebar_position: 10
4
4
 
5
5
  # AndroidDevice
6
6
 
7
- [AndroidDevice](./android_device) represents a connected device, either real hardware or emulated. Devices can be obtained using
8
- [Android#devices](./android#devices).
7
+
8
+ [AndroidDevice](./android_device) represents a connected device, either real hardware or emulated. Devices can be obtained using [Android#devices](./android#devices).
9
9
 
10
10
  ## close
11
11
 
@@ -13,6 +13,7 @@ sidebar_position: 10
13
13
  def close
14
14
  ```
15
15
 
16
+
16
17
  Disconnects from the device.
17
18
 
18
19
  ## info
@@ -21,6 +22,7 @@ Disconnects from the device.
21
22
  def info(selector)
22
23
  ```
23
24
 
25
+
24
26
  Returns information about a widget defined by `selector`.
25
27
 
26
28
  ## launch_browser
@@ -28,6 +30,7 @@ Returns information about a widget defined by `selector`.
28
30
  ```
29
31
  def launch_browser(
30
32
  acceptDownloads: nil,
33
+ args: nil,
31
34
  baseURL: nil,
32
35
  bypassCSP: nil,
33
36
  colorScheme: nil,
@@ -45,6 +48,7 @@ def launch_browser(
45
48
  noViewport: nil,
46
49
  offline: nil,
47
50
  permissions: nil,
51
+ proxy: nil,
48
52
  record_har_content: nil,
49
53
  record_har_mode: nil,
50
54
  record_har_omit_content: nil,
@@ -62,6 +66,7 @@ def launch_browser(
62
66
  &block)
63
67
  ```
64
68
 
69
+
65
70
  Launches Chrome browser on the device, and returns its persistent context.
66
71
 
67
72
  ## model
@@ -70,6 +75,7 @@ Launches Chrome browser on the device, and returns its persistent context.
70
75
  def model
71
76
  ```
72
77
 
78
+
73
79
  Device model.
74
80
 
75
81
  ## screenshot
@@ -78,6 +84,7 @@ Device model.
78
84
  def screenshot(path: nil)
79
85
  ```
80
86
 
87
+
81
88
  Returns the buffer with the captured screenshot of the device.
82
89
 
83
90
  ## serial
@@ -86,6 +93,7 @@ Returns the buffer with the captured screenshot of the device.
86
93
  def serial
87
94
  ```
88
95
 
96
+
89
97
  Device serial number.
90
98
 
91
99
  ## shell
@@ -94,6 +102,7 @@ Device serial number.
94
102
  def shell(command)
95
103
  ```
96
104
 
105
+
97
106
  Executes a shell command on the device and returns its output.
98
107
 
99
108
  ## input
@@ -5,12 +5,14 @@ sidebar_position: 10
5
5
  # AndroidInput
6
6
 
7
7
 
8
+
8
9
  ## drag
9
10
 
10
11
  ```
11
12
  def drag(from, to, steps)
12
13
  ```
13
14
 
15
+
14
16
  Performs a drag between `from` and `to` points.
15
17
 
16
18
  ## press
@@ -19,6 +21,7 @@ Performs a drag between `from` and `to` points.
19
21
  def press(key)
20
22
  ```
21
23
 
24
+
22
25
  Presses the `key`.
23
26
 
24
27
  ## tap_point
@@ -27,6 +30,7 @@ Presses the `key`.
27
30
  def tap_point(point)
28
31
  ```
29
32
 
33
+
30
34
  Taps at the specified `point`.
31
35
 
32
36
  ## type
@@ -35,4 +39,5 @@ Taps at the specified `point`.
35
39
  def type(text)
36
40
  ```
37
41
 
42
+
38
43
  Types `text` into currently focused widget.
@@ -4,23 +4,23 @@ sidebar_position: 10
4
4
 
5
5
  # FileChooser
6
6
 
7
+
7
8
  [FileChooser](./file_chooser) objects are dispatched by the page in the [`event: Page.fileChooser`] event.
8
9
 
9
10
  ```ruby
10
11
  file_chooser = page.expect_file_chooser do
11
- page.get_by_text("Upload").click # action to trigger file uploading
12
+ page.get_by_text("Upload file").click # action to trigger file uploading
12
13
  end
13
14
  file_chooser.set_files("myfile.pdf")
14
15
  ```
15
16
 
16
-
17
-
18
17
  ## element
19
18
 
20
19
  ```
21
20
  def element
22
21
  ```
23
22
 
23
+
24
24
  Returns input element associated with this file chooser.
25
25
 
26
26
  ## multiple?
@@ -29,6 +29,7 @@ Returns input element associated with this file chooser.
29
29
  def multiple?
30
30
  ```
31
31
 
32
+
32
33
  Returns whether this file chooser accepts multiple files.
33
34
 
34
35
  ## page
@@ -37,6 +38,7 @@ Returns whether this file chooser accepts multiple files.
37
38
  def page
38
39
  ```
39
40
 
41
+
40
42
  Returns page this file chooser belongs to.
41
43
 
42
44
  ## set_files
@@ -46,5 +48,6 @@ def set_files(files, noWaitAfter: nil, timeout: nil)
46
48
  ```
47
49
  alias: `files=`
48
50
 
51
+
49
52
  Sets the value of the file input this chooser is associated with. If some of the `filePaths` are relative paths, then
50
53
  they are resolved relative to the current working directory. For empty array, clears the selected files.