playwright-ruby-client 0.5.4 → 0.5.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/docs/api_coverage.md +1 -1
- data/lib/playwright/channel_owner.rb +3 -0
- data/lib/playwright/channel_owners/element_handle.rb +1 -3
- data/lib/playwright/channel_owners/frame.rb +6 -3
- data/lib/playwright/channel_owners/page.rb +6 -0
- data/lib/playwright/playwright_api.rb +3 -7
- data/lib/playwright/select_option_values.rb +31 -22
- data/lib/playwright/version.rb +1 -1
- data/lib/playwright_api/browser_context.rb +6 -6
- data/lib/playwright_api/frame.rb +1 -1
- data/lib/playwright_api/page.rb +7 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3b7f34abdba6ed3f1707276a9e126f10fa4760e8ba77176e39d29ecef55c1617
|
4
|
+
data.tar.gz: 435174fa3e28d3bd77a342d7d187879b7053747ce99a51e2757c2eda82f62ed0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 78d221fda16df66fb56bdb83f71b6f37d24652e76dbfbcd0f15f757ccbae433419435302eda19c873d376ef4d9cf9da05a72f6fbdfd453d4bf264ac5345922c4
|
7
|
+
data.tar.gz: b51da239dce6d264cdf4927ddeb7ae5afdd5429285328ca5c52720fda22babc0e93a5920a1d3df40e3c2a56efbe5fa46466f190f2c155ca7c9ffc54d6bc2270f
|
data/docs/api_coverage.md
CHANGED
@@ -149,10 +149,8 @@ module Playwright
|
|
149
149
|
value: value,
|
150
150
|
label: label,
|
151
151
|
).as_params
|
152
|
-
params = base_params
|
152
|
+
params = base_params.merge({ noWaitAfter: noWaitAfter, timeout: timeout }.compact)
|
153
153
|
@channel.send_message_to_server('selectOption', params)
|
154
|
-
|
155
|
-
nil
|
156
154
|
end
|
157
155
|
|
158
156
|
def tap_point(
|
@@ -126,6 +126,11 @@ module Playwright
|
|
126
126
|
nil
|
127
127
|
end
|
128
128
|
|
129
|
+
def frame_element
|
130
|
+
resp = @channel.send_message_to_server('frameElement')
|
131
|
+
ChannelOwners::ElementHandle.from(resp)
|
132
|
+
end
|
133
|
+
|
129
134
|
def evaluate(pageFunction, arg: nil)
|
130
135
|
if JavaScript.function?(pageFunction)
|
131
136
|
JavaScript::Function.new(pageFunction, arg).evaluate(@channel)
|
@@ -421,10 +426,8 @@ module Playwright
|
|
421
426
|
value: value,
|
422
427
|
label: label,
|
423
428
|
).as_params
|
424
|
-
params = base_params
|
429
|
+
params = base_params.merge({ selector: selector, noWaitAfter: noWaitAfter, timeout: timeout }.compact)
|
425
430
|
@channel.send_message_to_server('selectOption', params)
|
426
|
-
|
427
|
-
nil
|
428
431
|
end
|
429
432
|
|
430
433
|
def set_input_files(selector, files, noWaitAfter: nil, timeout: nil)
|
@@ -14,7 +14,7 @@ module Playwright
|
|
14
14
|
when ApiImplementation
|
15
15
|
ApiImplementationWrapper.new(channel_owner_or_api_implementation).wrap
|
16
16
|
else
|
17
|
-
|
17
|
+
channel_owner_or_api_implementation
|
18
18
|
end
|
19
19
|
end
|
20
20
|
|
@@ -31,7 +31,7 @@ module Playwright
|
|
31
31
|
def wrap
|
32
32
|
api_class = detect_class_for(@impl.class)
|
33
33
|
if api_class
|
34
|
-
api_class.new(@impl)
|
34
|
+
@impl._api ||= api_class.new(@impl)
|
35
35
|
else
|
36
36
|
raise NotImplementedError.new("Playwright::#{expected_class_name_for(@impl.class)} is not implemented")
|
37
37
|
end
|
@@ -101,10 +101,6 @@ module Playwright
|
|
101
101
|
@impl = impl
|
102
102
|
end
|
103
103
|
|
104
|
-
def ==(other)
|
105
|
-
@impl.to_s == other.instance_variable_get(:'@impl').to_s
|
106
|
-
end
|
107
|
-
|
108
104
|
# @param block [Proc]
|
109
105
|
private def wrap_block_call(block)
|
110
106
|
return nil unless block.is_a?(Proc)
|
@@ -119,7 +115,7 @@ module Playwright
|
|
119
115
|
if object.is_a?(Array)
|
120
116
|
object.map { |obj| wrap_impl(obj) }
|
121
117
|
else
|
122
|
-
::Playwright::PlaywrightApi.wrap(object)
|
118
|
+
::Playwright::PlaywrightApi.wrap(object)
|
123
119
|
end
|
124
120
|
end
|
125
121
|
|
@@ -1,18 +1,30 @@
|
|
1
1
|
module Playwright
|
2
2
|
class SelectOptionValues
|
3
3
|
def initialize(element: nil, index: nil, value: nil, label: nil)
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
4
|
+
params = {}
|
5
|
+
|
6
|
+
options = []
|
7
|
+
if value
|
8
|
+
options.concat(convert(:value, value))
|
9
|
+
end
|
10
|
+
|
11
|
+
if index
|
12
|
+
options.concat(convert(:index, index))
|
13
|
+
end
|
14
|
+
|
15
|
+
if label
|
16
|
+
options.concat(convert(:label, label))
|
17
|
+
end
|
18
|
+
|
19
|
+
unless options.empty?
|
20
|
+
params[:options] = options
|
21
|
+
end
|
22
|
+
|
23
|
+
if element
|
24
|
+
params[:elements] = convert(:element, element)
|
25
|
+
end
|
26
|
+
|
27
|
+
@params = params
|
16
28
|
end
|
17
29
|
|
18
30
|
# @return [Hash]
|
@@ -20,22 +32,19 @@ module Playwright
|
|
20
32
|
@params
|
21
33
|
end
|
22
34
|
|
23
|
-
private def convert(values)
|
24
|
-
return convert([values]) unless values.is_a?(Enumerable)
|
25
|
-
return
|
35
|
+
private def convert(key, values)
|
36
|
+
return convert(key, [values]) unless values.is_a?(Enumerable)
|
37
|
+
return [] if values.empty?
|
26
38
|
values.each_with_index do |value, index|
|
27
|
-
unless
|
39
|
+
unless value
|
28
40
|
raise ArgumentError.new("options[#{index}]: expected object, got null")
|
29
41
|
end
|
30
42
|
end
|
31
43
|
|
32
|
-
|
33
|
-
|
34
|
-
{ elements: values.map(&:channel) }
|
35
|
-
when String
|
36
|
-
{ options: values.map { |value| { value: value } } }
|
44
|
+
if key == :element
|
45
|
+
values.map(&:channel)
|
37
46
|
else
|
38
|
-
{
|
47
|
+
values.map { |value| { key => value } }
|
39
48
|
end
|
40
49
|
end
|
41
50
|
end
|
data/lib/playwright/version.rb
CHANGED
@@ -730,13 +730,13 @@ module Playwright
|
|
730
730
|
end
|
731
731
|
|
732
732
|
# @nodoc
|
733
|
-
def
|
734
|
-
wrap_impl(@impl.
|
733
|
+
def browser=(req)
|
734
|
+
wrap_impl(@impl.browser=(unwrap_impl(req)))
|
735
735
|
end
|
736
736
|
|
737
737
|
# @nodoc
|
738
|
-
def
|
739
|
-
wrap_impl(@impl.
|
738
|
+
def owner_page=(req)
|
739
|
+
wrap_impl(@impl.owner_page=(unwrap_impl(req)))
|
740
740
|
end
|
741
741
|
|
742
742
|
# @nodoc
|
@@ -745,8 +745,8 @@ module Playwright
|
|
745
745
|
end
|
746
746
|
|
747
747
|
# @nodoc
|
748
|
-
def
|
749
|
-
wrap_impl(@impl.
|
748
|
+
def options=(req)
|
749
|
+
wrap_impl(@impl.options=(unwrap_impl(req)))
|
750
750
|
end
|
751
751
|
|
752
752
|
# -- inherited from EventEmitter --
|
data/lib/playwright_api/frame.rb
CHANGED
data/lib/playwright_api/page.rb
CHANGED
@@ -2268,6 +2268,11 @@ module Playwright
|
|
2268
2268
|
raise NotImplementedError.new('wait_for_event is not implemented yet.')
|
2269
2269
|
end
|
2270
2270
|
|
2271
|
+
# @nodoc
|
2272
|
+
def owned_context=(req)
|
2273
|
+
wrap_impl(@impl.owned_context=(unwrap_impl(req)))
|
2274
|
+
end
|
2275
|
+
|
2271
2276
|
# @nodoc
|
2272
2277
|
def start_js_coverage(resetOnNavigation: nil, reportAnonymousScripts: nil)
|
2273
2278
|
wrap_impl(@impl.start_js_coverage(resetOnNavigation: unwrap_impl(resetOnNavigation), reportAnonymousScripts: unwrap_impl(reportAnonymousScripts)))
|
@@ -2289,8 +2294,8 @@ module Playwright
|
|
2289
2294
|
end
|
2290
2295
|
|
2291
2296
|
# @nodoc
|
2292
|
-
def
|
2293
|
-
wrap_impl(@impl.
|
2297
|
+
def guid
|
2298
|
+
wrap_impl(@impl.guid)
|
2294
2299
|
end
|
2295
2300
|
|
2296
2301
|
# -- inherited from EventEmitter --
|
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: 0.5.
|
4
|
+
version: 0.5.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- YusukeIwaki
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-05-
|
11
|
+
date: 2021-05-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: concurrent-ruby
|