playwright-ruby-client 1.38.0 → 1.39.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.
- checksums.yaml +4 -4
- data/documentation/docs/api/download.md +9 -10
- data/documentation/docs/api/locator.md +33 -9
- data/documentation/docs/api/locator_assertions.md +642 -0
- data/documentation/docs/api/page.md +1 -1
- data/documentation/docs/include/api_coverage.md +43 -0
- data/lib/playwright/channel.rb +9 -1
- data/lib/playwright/channel_owner.rb +7 -2
- data/lib/playwright/channel_owners/browser_context.rb +1 -1
- data/lib/playwright/channel_owners/local_utils.rb +27 -0
- data/lib/playwright/channel_owners/playwright.rb +1 -24
- data/lib/playwright/connection.rb +1 -1
- data/lib/playwright/console_message_impl.rb +29 -0
- data/lib/playwright/errors.rb +2 -0
- data/lib/playwright/javascript/value_serializer.rb +1 -1
- data/lib/playwright/locator_assertions_impl.rb +417 -0
- data/lib/playwright/locator_impl.rb +24 -5
- data/lib/playwright/test.rb +68 -0
- data/lib/playwright/version.rb +2 -2
- data/lib/playwright_api/browser.rb +2 -2
- data/lib/playwright_api/browser_context.rb +4 -4
- data/lib/playwright_api/browser_type.rb +2 -2
- data/lib/playwright_api/console_message.rb +0 -22
- data/lib/playwright_api/dialog.rb +2 -2
- data/lib/playwright_api/element_handle.rb +1 -1
- data/lib/playwright_api/frame.rb +7 -7
- data/lib/playwright_api/locator.rb +31 -0
- data/lib/playwright_api/locator_assertions.rb +551 -0
- data/lib/playwright_api/page.rb +23 -23
- data/lib/playwright_api/playwright.rb +4 -4
- data/lib/playwright_api/selectors.rb +2 -2
- data/sig/playwright.rbs +43 -0
- metadata +8 -4
- data/lib/playwright/channel_owners/console_message.rb +0 -25
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: e9c0bd246e9fc2ccd9358b60aa056266dfcee1f3fd2ee0174ae7a23173a1a9cb
|
|
4
|
+
data.tar.gz: 7e68e6e420040c24cdb9514dcde89ec6a2fd68ceda91b9590ed367ef5b1e52b7
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e67763b081ab137ab5da3cfbb0e397a664b4489574a3368e0059566b0e6c519d8685e252bedf76213cd7a8cad34cde3e0b2c4587adcc2241b255095ad1ffa3c7
|
|
7
|
+
data.tar.gz: 675f7ad040dace09c78d5d12672999d7c5a6d2ae067c89a078dd75e6f866db53191d1890a76d816f8aef797d83f0b12ed7d1311c3cbf00c90f62d38cfb407e62
|
|
@@ -12,16 +12,16 @@ browser context is closed.
|
|
|
12
12
|
|
|
13
13
|
Download event is emitted once the download starts. Download path becomes available once download completes.
|
|
14
14
|
|
|
15
|
-
```
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
page.get_by_text("Download file").click()
|
|
20
|
-
download = download_info.value
|
|
15
|
+
```ruby
|
|
16
|
+
download = page.expect_download do
|
|
17
|
+
page.get_by_text("Download file").click
|
|
18
|
+
end
|
|
21
19
|
|
|
22
20
|
# Wait for the download process to complete and save the downloaded file somewhere
|
|
23
|
-
|
|
21
|
+
path = File.join(download_dir, download.suggested_filename)
|
|
22
|
+
download.save_as(path)
|
|
24
23
|
|
|
24
|
+
path
|
|
25
25
|
```
|
|
26
26
|
|
|
27
27
|
## cancel
|
|
@@ -86,9 +86,8 @@ is still in progress. Will wait for the download to finish if necessary.
|
|
|
86
86
|
|
|
87
87
|
**Usage**
|
|
88
88
|
|
|
89
|
-
```
|
|
90
|
-
download.save_as(
|
|
91
|
-
|
|
89
|
+
```ruby
|
|
90
|
+
download.save_as(File.join(download_dir, download.suggested_filename))
|
|
92
91
|
```
|
|
93
92
|
|
|
94
93
|
## suggested_filename
|
|
@@ -42,6 +42,8 @@ def all_inner_texts
|
|
|
42
42
|
|
|
43
43
|
Returns an array of `node.innerText` values for all matching nodes.
|
|
44
44
|
|
|
45
|
+
**NOTE**: If you need to assert text on the page, prefer [LocatorAssertions#to_have_text](./locator_assertions#to_have_text) with `useInnerText` option to avoid flakiness. See [assertions guide](https://playwright.dev/python/docs/test-assertions) for more details.
|
|
46
|
+
|
|
45
47
|
**Usage**
|
|
46
48
|
|
|
47
49
|
```ruby
|
|
@@ -57,6 +59,8 @@ def all_text_contents
|
|
|
57
59
|
|
|
58
60
|
Returns an array of `node.textContent` values for all matching nodes.
|
|
59
61
|
|
|
62
|
+
**NOTE**: If you need to assert text on the page, prefer [LocatorAssertions#to_have_text](./locator_assertions#to_have_text) to avoid flakiness. See [assertions guide](https://playwright.dev/python/docs/test-assertions) for more details.
|
|
63
|
+
|
|
60
64
|
**Usage**
|
|
61
65
|
|
|
62
66
|
```ruby
|
|
@@ -232,6 +236,8 @@ def count
|
|
|
232
236
|
|
|
233
237
|
Returns the number of elements matching the locator.
|
|
234
238
|
|
|
239
|
+
**NOTE**: If you need to assert the number of elements on the page, prefer [LocatorAssertions#to_have_count](./locator_assertions#to_have_count) to avoid flakiness. See [assertions guide](https://playwright.dev/python/docs/test-assertions) for more details.
|
|
240
|
+
|
|
235
241
|
**Usage**
|
|
236
242
|
|
|
237
243
|
```ruby
|
|
@@ -526,6 +532,8 @@ alias: `[]`
|
|
|
526
532
|
|
|
527
533
|
Returns the matching element's attribute value.
|
|
528
534
|
|
|
535
|
+
**NOTE**: If you need to assert an element's attribute, prefer [LocatorAssertions#to_have_attribute](./locator_assertions#to_have_attribute) to avoid flakiness. See [assertions guide](https://playwright.dev/python/docs/test-assertions) for more details.
|
|
536
|
+
|
|
529
537
|
## get_by_alt_text
|
|
530
538
|
|
|
531
539
|
```
|
|
@@ -808,6 +816,8 @@ def inner_text(timeout: nil)
|
|
|
808
816
|
|
|
809
817
|
Returns the [`element.innerText`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/innerText).
|
|
810
818
|
|
|
819
|
+
**NOTE**: If you need to assert text on the page, prefer [LocatorAssertions#to_have_text](./locator_assertions#to_have_text) with `useInnerText` option to avoid flakiness. See [assertions guide](https://playwright.dev/python/docs/test-assertions) for more details.
|
|
820
|
+
|
|
811
821
|
## input_value
|
|
812
822
|
|
|
813
823
|
```
|
|
@@ -817,6 +827,8 @@ def input_value(timeout: nil)
|
|
|
817
827
|
|
|
818
828
|
Returns the value for the matching `<input>` or `<textarea>` or `<select>` element.
|
|
819
829
|
|
|
830
|
+
**NOTE**: If you need to assert input value, prefer [LocatorAssertions#to_have_value](./locator_assertions#to_have_value) to avoid flakiness. See [assertions guide](https://playwright.dev/python/docs/test-assertions) for more details.
|
|
831
|
+
|
|
820
832
|
**Usage**
|
|
821
833
|
|
|
822
834
|
```ruby
|
|
@@ -836,6 +848,8 @@ def checked?(timeout: nil)
|
|
|
836
848
|
|
|
837
849
|
Returns whether the element is checked. Throws if the element is not a checkbox or radio input.
|
|
838
850
|
|
|
851
|
+
**NOTE**: If you need to assert that checkbox is checked, prefer [LocatorAssertions#to_be_checked](./locator_assertions#to_be_checked) to avoid flakiness. See [assertions guide](https://playwright.dev/python/docs/test-assertions) for more details.
|
|
852
|
+
|
|
839
853
|
**Usage**
|
|
840
854
|
|
|
841
855
|
```ruby
|
|
@@ -851,6 +865,8 @@ def disabled?(timeout: nil)
|
|
|
851
865
|
|
|
852
866
|
Returns whether the element is disabled, the opposite of [enabled](https://playwright.dev/python/docs/actionability#enabled).
|
|
853
867
|
|
|
868
|
+
**NOTE**: If you need to assert that an element is disabled, prefer [LocatorAssertions#to_be_disabled](./locator_assertions#to_be_disabled) to avoid flakiness. See [assertions guide](https://playwright.dev/python/docs/test-assertions) for more details.
|
|
869
|
+
|
|
854
870
|
**Usage**
|
|
855
871
|
|
|
856
872
|
```ruby
|
|
@@ -866,6 +882,8 @@ def editable?(timeout: nil)
|
|
|
866
882
|
|
|
867
883
|
Returns whether the element is [editable](https://playwright.dev/python/docs/actionability#editable).
|
|
868
884
|
|
|
885
|
+
**NOTE**: If you need to assert that an element is editable, prefer [LocatorAssertions#to_be_editable](./locator_assertions#to_be_editable) to avoid flakiness. See [assertions guide](https://playwright.dev/python/docs/test-assertions) for more details.
|
|
886
|
+
|
|
869
887
|
**Usage**
|
|
870
888
|
|
|
871
889
|
```ruby
|
|
@@ -881,6 +899,8 @@ def enabled?(timeout: nil)
|
|
|
881
899
|
|
|
882
900
|
Returns whether the element is [enabled](https://playwright.dev/python/docs/actionability#enabled).
|
|
883
901
|
|
|
902
|
+
**NOTE**: If you need to assert that an element is enabled, prefer [LocatorAssertions#to_be_enabled](./locator_assertions#to_be_enabled) to avoid flakiness. See [assertions guide](https://playwright.dev/python/docs/test-assertions) for more details.
|
|
903
|
+
|
|
884
904
|
**Usage**
|
|
885
905
|
|
|
886
906
|
```ruby
|
|
@@ -896,6 +916,8 @@ def hidden?(timeout: nil)
|
|
|
896
916
|
|
|
897
917
|
Returns whether the element is hidden, the opposite of [visible](https://playwright.dev/python/docs/actionability#visible).
|
|
898
918
|
|
|
919
|
+
**NOTE**: If you need to assert that element is hidden, prefer [LocatorAssertions#to_be_hidden](./locator_assertions#to_be_hidden) to avoid flakiness. See [assertions guide](https://playwright.dev/python/docs/test-assertions) for more details.
|
|
920
|
+
|
|
899
921
|
**Usage**
|
|
900
922
|
|
|
901
923
|
```ruby
|
|
@@ -911,6 +933,8 @@ def visible?(timeout: nil)
|
|
|
911
933
|
|
|
912
934
|
Returns whether the element is [visible](https://playwright.dev/python/docs/actionability#visible).
|
|
913
935
|
|
|
936
|
+
**NOTE**: If you need to assert that element is visible, prefer [LocatorAssertions#to_be_visible](./locator_assertions#to_be_visible) to avoid flakiness. See [assertions guide](https://playwright.dev/python/docs/test-assertions) for more details.
|
|
937
|
+
|
|
914
938
|
**Usage**
|
|
915
939
|
|
|
916
940
|
```ruby
|
|
@@ -1047,19 +1071,17 @@ To press a special key, like `Control` or `ArrowDown`, use [Locator#press](./loc
|
|
|
1047
1071
|
|
|
1048
1072
|
**Usage**
|
|
1049
1073
|
|
|
1050
|
-
```
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1074
|
+
```ruby
|
|
1075
|
+
element.press_sequentially("hello") # types instantly
|
|
1076
|
+
element.press_sequentially("world", delay: 100) # types slower, like a user
|
|
1054
1077
|
```
|
|
1055
1078
|
|
|
1056
1079
|
An example of typing into a text field and then submitting the form:
|
|
1057
1080
|
|
|
1058
|
-
```
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1081
|
+
```ruby
|
|
1082
|
+
element = page.get_by_label("Password")
|
|
1083
|
+
element.press_sequentially("my password")
|
|
1084
|
+
element.press("Enter")
|
|
1063
1085
|
```
|
|
1064
1086
|
|
|
1065
1087
|
## screenshot
|
|
@@ -1277,6 +1299,8 @@ def text_content(timeout: nil)
|
|
|
1277
1299
|
|
|
1278
1300
|
Returns the [`node.textContent`](https://developer.mozilla.org/en-US/docs/Web/API/Node/textContent).
|
|
1279
1301
|
|
|
1302
|
+
**NOTE**: If you need to assert text on the page, prefer [LocatorAssertions#to_have_text](./locator_assertions#to_have_text) to avoid flakiness. See [assertions guide](https://playwright.dev/python/docs/test-assertions) for more details.
|
|
1303
|
+
|
|
1280
1304
|
## type
|
|
1281
1305
|
|
|
1282
1306
|
```
|