playwright-ruby-client 1.14.beta2 → 1.14.beta3

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2e8cf4acb773b928d276eac118c170bb0eb2f0c8235f7c19bf0ebf2a4883a3e7
4
- data.tar.gz: 7a70fbaad653abe274b8fac05b953ec413ca213bfc9d0e6396c3bf2c6c0f5b2d
3
+ metadata.gz: 88c8fbe4451b00ed8eba172f656e0171fb2580d555eefb4d2aa0cc1a13f86fc4
4
+ data.tar.gz: 3d307147cc4a23356d561f9528ef95343984bf4623ad77ebb6e479ce4f4f9462
5
5
  SHA512:
6
- metadata.gz: 981c3cab4a5060634f858b934b01ef51e0f1e887d2bf5e4bbb62dca636d1ab3b9459542e436965c49cf0240f8431732a5fa50f9b7dc6d324c7c21fc36b8b01b8
7
- data.tar.gz: '08e490a08488fac3f0633ade8fc4f2299dc6e69fcc6cd86c5587197a9a7bfdca78e836de8fff6b0a578c64387b59c0cba2f245a93280ba7e7b0e6488875ae819'
6
+ metadata.gz: 647702705f820c268e5b858a1cd587b0e8f32f16415df2fd7b91505a221cadc20400fc9f2db188964fe4759f4734c8b30bc15c265434d2ac2b78e0683228c192
7
+ data.tar.gz: b4af0552e547d28be8c9390441bb7131d61fcea36fb5d3d293fd6985d6b47d3925e1c3bf27aa5f4e59243fc03ad751355acc20cb4e63b6e7489c47abb55b1864
@@ -32,27 +32,26 @@ Playwright will discard them as well for an easier to process tree, unless `inte
32
32
 
33
33
  An example of dumping the entire accessibility tree:
34
34
 
35
- ```python sync title=example_2e5019929403491cde0c78bed1e0e18e0c86ab423d7ac8715876c4de4814f483.py
36
- snapshot = page.accessibility.snapshot()
37
- print(snapshot)
38
-
35
+ ```ruby
36
+ snapshot = page.accessibility.snapshot
37
+ puts snapshot
39
38
  ```
40
39
 
41
40
  An example of logging the focused node's name:
42
41
 
43
- ```python sync title=example_df2acadf9e261a7624d83399f0d8b0910293a6a7081c812474715f22f8af7a4a.py
44
- def find_focused_node(node):
45
- if (node.get("focused"))
46
- return node
47
- for child in (node.get("children") or []):
48
- found_node = find_focused_node(child)
49
- return found_node
50
- return None
51
-
52
- snapshot = page.accessibility.snapshot()
42
+ ```ruby
43
+ def find_focused_node(node)
44
+ if node['focused']
45
+ node
46
+ else
47
+ node['children']&.find do |child|
48
+ find_focused_node(child)
49
+ end
50
+ end
51
+ end
52
+
53
+ snapshot = page.accessibility.snapshot
53
54
  node = find_focused_node(snapshot)
54
- if node:
55
- print(node["name"])
56
-
55
+ puts node['name']
57
56
  ```
58
57
 
@@ -4,8 +4,21 @@ sidebar_position: 10
4
4
 
5
5
  # Android
6
6
 
7
- Playwright has **experimental** support for Android automation. See [here](https://playwright.dev/python/docs/mobile) for more information. You can
8
- access android namespace via:
7
+ Playwright has **experimental** support for Android automation. This includes Chrome for Android and Android WebView.
8
+
9
+ *Requirements*
10
+ - 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.
13
+ - [`Chrome 87`](https://play.google.com/store/apps/details?id=com.android.chrome) or newer installed on the device
14
+ - "Enable command line on non-rooted devices" enabled in `chrome://flags`.
15
+
16
+ *Known limitations*
17
+ - Raw USB operation is not yet supported, so you need ADB.
18
+ - Device needs to be awake to produce screenshots. Enabling "Stay awake" developer mode will help.
19
+ - We didn't run all the tests against the device, so not everything works.
20
+
21
+ *How to run*
9
22
 
10
23
  An example of the Android automation script would be:
11
24
 
@@ -16,25 +16,16 @@ At every point of time, page exposes its current frame tree via the [Page#main_f
16
16
 
17
17
  An example of dumping frame tree:
18
18
 
19
- ```python sync title=example_a4a9e01d1e0879958d591c4bc9061574f5c035e821a94214e650d15564d77bf4.py
20
- from playwright.sync_api import sync_playwright
21
-
22
- def run(playwright):
23
- firefox = playwright.firefox
24
- browser = firefox.launch()
25
- page = browser.new_page()
26
- page.goto("https://www.theverge.com")
27
- dump_frame_tree(page.main_frame, "")
28
- browser.close()
29
-
30
- def dump_frame_tree(frame, indent):
31
- print(indent + frame.name + '@' + frame.url)
32
- for child in frame.child_frames:
33
- dump_frame_tree(child, indent + " ")
34
-
35
- with sync_playwright() as playwright:
36
- run(playwright)
19
+ ```ruby
20
+ def dump_frame_tree(frame, indent = 0)
21
+ puts "#{' ' * indent}#{frame.name}@#{frame.url}"
22
+ frame.child_frames.each do |child|
23
+ dump_frame_tree(child, indent + 2)
24
+ end
25
+ end
37
26
 
27
+ page.goto("https://www.theverge.com")
28
+ dump_frame_tree(page.main_frame)
38
29
  ```
39
30
 
40
31
 
@@ -176,9 +167,8 @@ The snippet below dispatches the `click` event on the element. Regardless of the
176
167
  `click` is dispatched. This is equivalent to calling
177
168
  [element.click()](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/click).
178
169
 
179
- ```python sync title=example_de439a4f4839a9b1bc72dbe0890d6b989c437620ba1b88a2150faa79f98184fc.py
170
+ ```ruby
180
171
  frame.dispatch_event("button#submit", "click")
181
-
182
172
  ```
183
173
 
184
174
  Under the hood, it creates an instance of an event based on the given `type`, initializes it with `eventInit` properties
@@ -195,11 +185,10 @@ Since `eventInit` is event-specific, please refer to the events documentation fo
195
185
 
196
186
  You can also specify [JSHandle](./js_handle) as the property value if you want live objects to be passed into the event:
197
187
 
198
- ```python sync title=example_5410f49339561b3cc9d91c7548c8195a570c8be704bb62f45d90c68f869d450d.py
188
+ ```ruby
199
189
  # note you can only create data_transfer in chromium and firefox
200
190
  data_transfer = frame.evaluate_handle("new DataTransfer()")
201
- frame.dispatch_event("#source", "dragstart", { "dataTransfer": data_transfer })
202
-
191
+ frame.dispatch_event("#source", "dragstart", eventInit: { dataTransfer: data_transfer })
203
192
  ```
204
193
 
205
194
 
@@ -238,11 +227,10 @@ return its value.
238
227
 
239
228
  Examples:
240
229
 
241
- ```python sync title=example_6814d0e91763f4d27a0d6a380c36d62b551e4c3e902d1157012dde0a49122abe.py
230
+ ```ruby
242
231
  search_value = frame.eval_on_selector("#search", "el => el.value")
243
232
  preload_href = frame.eval_on_selector("link[rel=preload]", "el => el.href")
244
- html = frame.eval_on_selector(".main-container", "(e, suffix) => e.outerHTML + suffix", "hello")
245
-
233
+ html = frame.eval_on_selector(".main-container", "(e, suffix) => e.outerHTML + suffix", arg: "hello")
246
234
  ```
247
235
 
248
236
 
@@ -263,9 +251,8 @@ return its value.
263
251
 
264
252
  Examples:
265
253
 
266
- ```python sync title=example_618e7f8f681d1c4a1c0c9b8d23892e37cbbef013bf3d8906fd4311c51d9819d7.py
267
- divs_counts = frame.eval_on_selector_all("div", "(divs, min) => divs.length >= min", 10)
268
-
254
+ ```ruby
255
+ divs_counts = frame.eval_on_selector_all("div", "(divs, min) => divs.length >= min", arg: 10)
269
256
  ```
270
257
 
271
258
 
@@ -285,28 +272,25 @@ If the function passed to the [Frame#evaluate](./frame#evaluate) returns a non-[
285
272
  [Frame#evaluate](./frame#evaluate) returns `undefined`. Playwright also supports transferring some additional values that are
286
273
  not serializable by `JSON`: `-0`, `NaN`, `Infinity`, `-Infinity`.
287
274
 
288
- ```python sync title=example_15a235841cd1bc56fad6e3c8aaea2a30e352fedd8238017f22f97fc70e058d2b.py
289
- result = frame.evaluate("([x, y]) => Promise.resolve(x * y)", [7, 8])
290
- print(result) # prints "56"
291
-
275
+ ```ruby
276
+ result = frame.evaluate("([x, y]) => Promise.resolve(x * y)", arg: [7, 8])
277
+ puts result # => "56"
292
278
  ```
293
279
 
294
280
  A string can also be passed in instead of a function.
295
281
 
296
- ```python sync title=example_9c73167b900498bca191abc2ce2627e063f84b0abc8ce3a117416cb734602760.py
297
- print(frame.evaluate("1 + 2")) # prints "3"
282
+ ```ruby
283
+ puts frame.evaluate("1 + 2") # => 3
298
284
  x = 10
299
- print(frame.evaluate(f"1 + {x}")) # prints "11"
300
-
285
+ puts frame.evaluate("1 + #{x}") # => "11"
301
286
  ```
302
287
 
303
288
  [ElementHandle](./element_handle) instances can be passed as an argument to the [Frame#evaluate](./frame#evaluate):
304
289
 
305
- ```python sync title=example_05568c81173717fa6841099571d8a66e14fc0853e01684630d1622baedc25f67.py
290
+ ```ruby
306
291
  body_handle = frame.query_selector("body")
307
- html = frame.evaluate("([body, suffix]) => body.innerHTML + suffix", [body_handle, "hello"])
308
- body_handle.dispose()
309
-
292
+ html = frame.evaluate("([body, suffix]) => body.innerHTML + suffix", arg: [body_handle, "hello"])
293
+ body_handle.dispose
310
294
  ```
311
295
 
312
296
 
@@ -325,10 +309,9 @@ The only difference between [Frame#evaluate](./frame#evaluate) and [Frame#evalua
325
309
  If the function, passed to the [Frame#evaluate_handle](./frame#evaluate_handle), returns a [Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise), then
326
310
  [Frame#evaluate_handle](./frame#evaluate_handle) would wait for the promise to resolve and return its value.
327
311
 
328
- ```python sync title=example_a1c8e837e826079359d01d6f7eecc64092a45d8c74280d23ee9039c379132c51.py
312
+ ```ruby
329
313
  a_window_handle = frame.evaluate_handle("Promise.resolve(window)")
330
314
  a_window_handle # handle for the window object.
331
-
332
315
  ```
333
316
 
334
317
  A string can also be passed in instead of a function.
@@ -393,11 +376,10 @@ frame.
393
376
 
394
377
  This method throws an error if the frame has been detached before `frameElement()` returns.
395
378
 
396
- ```python sync title=example_e6b4fdef29a401d84b17acfa319bee08f39e1f28e07c435463622220c6a24747.py
397
- frame_element = frame.frame_element()
398
- content_frame = frame_element.content_frame()
399
- assert frame == content_frame
400
-
379
+ ```ruby
380
+ frame_element = frame.frame_element
381
+ content_frame = frame_element.content_frame
382
+ puts frame == content_frame # => true
401
383
  ```
402
384
 
403
385
 
@@ -658,14 +640,13 @@ Returns the array of option values that have been successfully selected.
658
640
 
659
641
  Triggers a `change` and `input` event once all the provided options have been selected.
660
642
 
661
- ```python sync title=example_230c12044664b222bf35d6163b1e415c011d87d9911a4d39648c7f601b344a31.py
643
+ ```ruby
662
644
  # single selection matching the value
663
- frame.select_option("select#colors", "blue")
645
+ frame.select_option("select#colors", value: "blue")
664
646
  # single selection matching both the label
665
- frame.select_option("select#colors", label="blue")
647
+ frame.select_option("select#colors", label: "blue")
666
648
  # multiple selection
667
- frame.select_option("select#colors", value=["red", "green", "blue"])
668
-
649
+ frame.select_option("select#colors", value: ["red", "green", "blue"])
669
650
  ```
670
651
 
671
652
 
@@ -756,10 +737,9 @@ send fine-grained keyboard events. To fill values in form fields, use [Frame#fil
756
737
 
757
738
  To press a special key, like `Control` or `ArrowDown`, use [Keyboard#press](./keyboard#press).
758
739
 
759
- ```python sync title=example_beae7f0d11663c3c98b9d3a8e6ab76b762578cf2856e3b04ad8e42bfb23bb1e1.py
740
+ ```ruby
760
741
  frame.type("#mytextarea", "hello") # types instantly
761
- frame.type("#mytextarea", "world", delay=100) # types slower, like a user
762
-
742
+ frame.type("#mytextarea", "world", delay: 100) # types slower, like a user
763
743
  ```
764
744
 
765
745
 
@@ -809,28 +789,16 @@ Returns when the `expression` returns a truthy value, returns that value.
809
789
 
810
790
  The [Frame#wait_for_function](./frame#wait_for_function) can be used to observe viewport size change:
811
791
 
812
- ```python sync title=example_2f82dcf15fa9338be87a4faf7fe7de3c542040924db1e1ad1c98468ec0f425ce.py
813
- from playwright.sync_api import sync_playwright
814
-
815
- def run(playwright):
816
- webkit = playwright.webkit
817
- browser = webkit.launch()
818
- page = browser.new_page()
819
- page.evaluate("window.x = 0; setTimeout(() => { window.x = 100 }, 1000);")
820
- page.main_frame.wait_for_function("() => window.x > 0")
821
- browser.close()
822
-
823
- with sync_playwright() as playwright:
824
- run(playwright)
825
-
792
+ ```ruby
793
+ frame.evaluate("window.x = 0; setTimeout(() => { window.x = 100 }, 1000);")
794
+ frame.wait_for_function("() => window.x > 0")
826
795
  ```
827
796
 
828
797
  To pass an argument to the predicate of `frame.waitForFunction` function:
829
798
 
830
- ```python sync title=example_8b95be0fb4d149890f7817d9473428a50dc631d3a75baf89846648ca6a157562.py
799
+ ```ruby
831
800
  selector = ".foo"
832
- frame.wait_for_function("selector => !!document.querySelector(selector)", selector)
833
-
801
+ frame.wait_for_function("selector => !!document.querySelector(selector)", arg: selector)
834
802
  ```
835
803
 
836
804
 
@@ -846,10 +814,9 @@ Waits for the required load state to be reached.
846
814
  This returns when the frame reaches a required load state, `load` by default. The navigation must have been committed
847
815
  when this method is called. If current document has already reached the required state, resolves immediately.
848
816
 
849
- ```python sync title=example_fe41b79b58d046cda4673ededd4d216cb97a63204fcba69375ce8a84ea3f6894.py
817
+ ```ruby
850
818
  frame.click("button") # click triggers navigation.
851
- frame.wait_for_load_state() # the promise resolves after "load" event.
852
-
819
+ frame.wait_for_load_state # the promise resolves after "load" event.
853
820
  ```
854
821
 
855
822
 
@@ -867,11 +834,10 @@ History API usage, the navigation will resolve with `null`.
867
834
  This method waits for the frame to navigate to a new URL. It is useful for when you run code which will indirectly cause
868
835
  the frame to navigate. Consider this example:
869
836
 
870
- ```python sync title=example_03f0ac17eb6c1ce8780cfa83c4ae15a9ddbfde3f96c96f36fdf3fbf9aac721f7.py
871
- with frame.expect_navigation():
872
- frame.click("a.delayed-navigation") # clicking the link will indirectly cause a navigation
873
- # Resolves after navigation has finished
874
-
837
+ ```ruby
838
+ frame.expect_navigation do
839
+ frame.click("a.delayed-navigation") # clicking the link will indirectly cause a navigation
840
+ end # Resolves after navigation has finished
875
841
  ```
876
842
 
877
843
  > NOTE: Usage of the [History API](https://developer.mozilla.org/en-US/docs/Web/API/History_API) to change the URL is
@@ -892,22 +858,13 @@ selector doesn't satisfy the condition for the `timeout` milliseconds, the funct
892
858
 
893
859
  This method works across navigations:
894
860
 
895
- ```python sync title=example_a5b9dd4745d45ac630e5953be1c1815ae8e8ab03399fb35f45ea77c434f17eea.py
896
- from playwright.sync_api import sync_playwright
897
-
898
- def run(playwright):
899
- chromium = playwright.chromium
900
- browser = chromium.launch()
901
- page = browser.new_page()
902
- for current_url in ["https://google.com", "https://bbc.com"]:
903
- page.goto(current_url, wait_until="domcontentloaded")
904
- element = page.main_frame.wait_for_selector("img")
905
- print("Loaded image: " + str(element.get_attribute("src")))
906
- browser.close()
907
-
908
- with sync_playwright() as playwright:
909
- run(playwright)
910
-
861
+ ```ruby
862
+ %w[https://google.com https://bbc.com].each do |current_url|
863
+ page.goto(current_url, waitUntil: "domcontentloaded")
864
+ frame = page.main_frame
865
+ element = frame.wait_for_selector("img")
866
+ puts "Loaded image: #{element["src"]}"
867
+ end
911
868
  ```
912
869
 
913
870
 
@@ -931,10 +888,9 @@ def wait_for_url(url, timeout: nil, waitUntil: nil)
931
888
 
932
889
  Waits for the frame to navigate to the given URL.
933
890
 
934
- ```python sync title=example_86a9a19ec4c41e1a5ac302fbca9a3d3d6dca3fe3314e065b8062ddf5f75abfbd.py
891
+ ```ruby
935
892
  frame.click("a.delayed-navigation") # clicking the link will indirectly cause a navigation
936
893
  frame.wait_for_url("**/target.html")
937
-
938
894
  ```
939
895
 
940
896
 
@@ -253,8 +253,8 @@ def evaluate_all(expression, arg: nil)
253
253
  The method finds all elements matching the specified locator and passes an array of matched elements as a first argument
254
254
  to `expression`. Returns the result of `expression` invocation.
255
255
 
256
- If `expression` returns a [Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise), then [`Locator.evaluateAll`] would wait for the promise to resolve and return its
257
- value.
256
+ If `expression` returns a [Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise), then [Locator#evaluate_all](./locator#evaluate_all) would wait for the promise to resolve and
257
+ return its value.
258
258
 
259
259
  Examples:
260
260
 
@@ -8,16 +8,15 @@ The Mouse class operates in main-frame CSS pixels relative to the top-left corne
8
8
 
9
9
  Every `page` object has its own Mouse, accessible with [Page#mouse](./page#mouse).
10
10
 
11
- ```python sync title=example_ba01da1f358cafb4c22b792488ff2f3de4dbd82d4ee1cc4050e3f0c24a2bd7dd.py
11
+ ```ruby
12
12
  # using ‘page.mouse’ to trace a 100x100 square.
13
13
  page.mouse.move(0, 0)
14
- page.mouse.down()
14
+ page.mouse.down
15
15
  page.mouse.move(0, 100)
16
16
  page.mouse.move(100, 100)
17
17
  page.mouse.move(100, 0)
18
18
  page.mouse.move(0, 0)
19
- page.mouse.up()
20
-
19
+ page.mouse.up
21
20
  ```
22
21
 
23
22
 
@@ -28,9 +28,8 @@ The method returns `null` unless this request has failed, as reported by `reques
28
28
 
29
29
  Example of logging of all the failed requests:
30
30
 
31
- ```py title=example_5f3f4534ab17f584cfd41ca38448ce7de9490b6588e29e73116ede3cb15a25a5.py
32
- page.on("requestfailed", lambda request: print(request.url + " " + request.failure))
33
-
31
+ ```ruby
32
+ page.on("requestfailed", ->(request) { puts "#{request.url} #{request.failure}" })
34
33
  ```
35
34
 
36
35
 
@@ -108,18 +107,17 @@ construct the whole redirect chain by repeatedly calling `redirectedFrom()`.
108
107
 
109
108
  For example, if the website `http://example.com` redirects to `https://example.com`:
110
109
 
111
- ```python sync title=example_89568fc86bf623eef37b68c6659b1a8524647c8365bb32a7a8af63bd86111075.py
112
- response = page.goto("http://example.com")
113
- print(response.request.redirected_from.url) # "http://example.com"
114
-
110
+ ```ruby
111
+ response = page.goto("http://github.com")
112
+ puts response.url # => "https://github.com"
113
+ puts response.request.redirected_from&.url # => "http://github.com"
115
114
  ```
116
115
 
117
116
  If the website `https://google.com` has no redirects:
118
117
 
119
- ```python sync title=example_6d7b3fbf8d69dbe639b71fedc5a8977777fca29dfb16d38012bb07c496342472.py
118
+ ```ruby
120
119
  response = page.goto("https://google.com")
121
- print(response.request.redirected_from) # None
122
-
120
+ puts response.request.redirected_from&.url # => nil
123
121
  ```
124
122
 
125
123
 
@@ -134,9 +132,8 @@ New request issued by the browser if the server responded with redirect.
134
132
 
135
133
  This method is the opposite of [Request#redirected_from](./request#redirected_from):
136
134
 
137
- ```py title=example_922623f4033e7ec2158787e54a8554655f7e1e20a024e4bf4f69337f781ab88a.py
138
- assert request.redirected_from.redirected_to == request
139
-
135
+ ```ruby
136
+ request.redirected_from.redirected_to # equals to request
140
137
  ```
141
138
 
142
139
 
@@ -169,12 +166,11 @@ Returns resource timing information for given request. Most of the timing values
169
166
  `responseEnd` becomes available when request finishes. Find more information at
170
167
  [Resource Timing API](https://developer.mozilla.org/en-US/docs/Web/API/PerformanceResourceTiming).
171
168
 
172
- ```python sync title=example_e2a297fe95fd0699b6a856c3be2f28106daa2615c0f4d6084f5012682a619d20.py
173
- with page.expect_event("requestfinished") as request_info:
174
- page.goto("http://example.com")
175
- request = request_info.value
176
- print(request.timing)
177
-
169
+ ```ruby
170
+ request = page.expect_event("requestfinished") do
171
+ page.goto("https://example.com")
172
+ end
173
+ puts request.timing
178
174
  ```
179
175
 
180
176
 
@@ -9,13 +9,14 @@ Playwright script runs.
9
9
 
10
10
  Start with specifying the folder traces will be stored in:
11
11
 
12
- ```python sync title=example_a767dfb400d98aef50f2767b94171d23474ea1ac1cf9b4d75d412936208e652d.py
13
- browser = chromium.launch()
14
- context = browser.new_context()
15
- context.tracing.start(screenshots=True, snapshots=True)
16
- page.goto("https://playwright.dev")
17
- context.tracing.stop(path = "trace.zip")
18
-
12
+ ```ruby
13
+ browser.new_page do |page|
14
+ context = page.context
15
+
16
+ context.tracing.start(screenshots: true, snapshots: true)
17
+ page.goto('https://playwright.dev')
18
+ context.tracing.stop(path: 'trace.zip')
19
+ end
19
20
  ```
20
21
 
21
22
 
@@ -28,12 +29,12 @@ def start(name: nil, screenshots: nil, snapshots: nil)
28
29
 
29
30
  Start tracing.
30
31
 
31
- ```python sync title=example_e611abc8b1066118d0c87eae1bbbb08df655f36d50a94402fc56b8713150997b.py
32
- context.tracing.start(name="trace", screenshots=True, snapshots=True)
33
- page.goto("https://playwright.dev")
34
- context.tracing.stop()
35
- context.tracing.stop(path = "trace.zip")
32
+ ```ruby
33
+ context = page.context
36
34
 
35
+ context.tracing.start(name: 'trace', screenshots: true, snapshots: true)
36
+ page.goto('https://playwright.dev')
37
+ context.tracing.stop(path: 'trace.zip')
37
38
  ```
38
39
 
39
40
 
@@ -100,14 +100,14 @@ module Playwright
100
100
  request_start:,
101
101
  response_start:)
102
102
 
103
- @timing["startTime"] = start_time
104
- @timing["domainLookupStart"] = domain_lookup_start
105
- @timing["domainLookupEnd"] = domain_lookup_end
106
- @timing["connectStart"] = connect_start
107
- @timing["secureConnectionStart"] = secure_connection_start
108
- @timing["connectEnd"] = connect_end
109
- @timing["requestStart"] = request_start
110
- @timing["responseStart"] = response_start
103
+ @timing[:startTime] = start_time
104
+ @timing[:domainLookupStart] = domain_lookup_start
105
+ @timing[:domainLookupEnd] = domain_lookup_end
106
+ @timing[:connectStart] = connect_start
107
+ @timing[:secureConnectionStart] = secure_connection_start
108
+ @timing[:connectEnd] = connect_end
109
+ @timing[:requestStart] = request_start
110
+ @timing[:responseStart] = response_start
111
111
  end
112
112
 
113
113
  private def update_headers(headers)
@@ -142,7 +142,7 @@ module Playwright
142
142
  LocatorImpl.new(
143
143
  frame: @frame,
144
144
  timeout_settings: @timeout_settings,
145
- selector: "#{@selector} >> _nth=first",
145
+ selector: "#{@selector} >> nth=0",
146
146
  )
147
147
  end
148
148
 
@@ -150,7 +150,7 @@ module Playwright
150
150
  LocatorImpl.new(
151
151
  frame: @frame,
152
152
  timeout_settings: @timeout_settings,
153
- selector: "#{@selector} >> _nth=last",
153
+ selector: "#{@selector} >> nth=-1",
154
154
  )
155
155
  end
156
156
 
@@ -158,7 +158,7 @@ module Playwright
158
158
  LocatorImpl.new(
159
159
  frame: @frame,
160
160
  timeout_settings: @timeout_settings,
161
- selector: "#{@selector} >> _nth=#{index}",
161
+ selector: "#{@selector} >> nth=#{index}",
162
162
  )
163
163
  end
164
164
 
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Playwright
4
- VERSION = '1.14.beta2'
4
+ VERSION = '1.14.beta3'
5
5
  COMPATIBLE_PLAYWRIGHT_VERSION = '1.14.0'
6
6
  end
@@ -1,6 +1,19 @@
1
1
  module Playwright
2
- # Playwright has **experimental** support for Android automation. See [here](./mobile.md) for more information. You can
3
- # access android namespace via:
2
+ # Playwright has **experimental** support for Android automation. This includes Chrome for Android and Android WebView.
3
+ #
4
+ # *Requirements*
5
+ # - Android device or AVD Emulator.
6
+ # - [ADB daemon](https://developer.android.com/studio/command-line/adb) running and authenticated with your device.
7
+ # Typically running `adb devices` is all you need to do.
8
+ # - [`Chrome 87`](https://play.google.com/store/apps/details?id=com.android.chrome) or newer installed on the device
9
+ # - "Enable command line on non-rooted devices" enabled in `chrome://flags`.
10
+ #
11
+ # *Known limitations*
12
+ # - Raw USB operation is not yet supported, so you need ADB.
13
+ # - Device needs to be awake to produce screenshots. Enabling "Stay awake" developer mode will help.
14
+ # - We didn't run all the tests against the device, so not everything works.
15
+ #
16
+ # *How to run*
4
17
  #
5
18
  # An example of the Android automation script would be:
6
19
  #
@@ -197,8 +197,8 @@ module Playwright
197
197
  # The method finds all elements matching the specified locator and passes an array of matched elements as a first argument
198
198
  # to `expression`. Returns the result of `expression` invocation.
199
199
  #
200
- # If `expression` returns a [Promise], then [`Locator.evaluateAll`] would wait for the promise to resolve and return its
201
- # value.
200
+ # If `expression` returns a [Promise], then [`method: Locator.evaluateAll`] would wait for the promise to resolve and
201
+ # return its value.
202
202
  #
203
203
  # Examples:
204
204
  #
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.14.beta2
4
+ version: 1.14.beta3
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-06 00:00:00.000000000 Z
11
+ date: 2021-08-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: concurrent-ruby