playwright-ruby-client 0.3.0 → 0.5.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +17 -5
- data/docs/api_coverage.md +14 -25
- data/lib/playwright/channel.rb +19 -9
- data/lib/playwright/channel_owners/artifact.rb +30 -0
- data/lib/playwright/channel_owners/browser.rb +21 -0
- data/lib/playwright/channel_owners/browser_context.rb +5 -0
- data/lib/playwright/channel_owners/browser_type.rb +28 -0
- data/lib/playwright/channel_owners/element_handle.rb +1 -1
- data/lib/playwright/channel_owners/frame.rb +25 -2
- data/lib/playwright/channel_owners/js_handle.rb +2 -2
- data/lib/playwright/channel_owners/page.rb +78 -15
- data/lib/playwright/channel_owners/playwright.rb +22 -29
- data/lib/playwright/channel_owners/stream.rb +15 -0
- data/lib/playwright/connection.rb +11 -32
- data/lib/playwright/download.rb +27 -0
- data/lib/playwright/errors.rb +6 -0
- data/lib/playwright/events.rb +2 -5
- data/lib/playwright/keyboard_impl.rb +1 -1
- data/lib/playwright/mouse_impl.rb +41 -0
- data/lib/playwright/route_handler_entry.rb +1 -9
- data/lib/playwright/transport.rb +27 -6
- data/lib/playwright/url_matcher.rb +1 -1
- data/lib/playwright/utils.rb +8 -0
- data/lib/playwright/version.rb +1 -1
- data/lib/playwright/video.rb +51 -0
- data/lib/playwright/wait_helper.rb +2 -2
- data/lib/playwright.rb +47 -9
- data/lib/playwright_api/accessibility.rb +39 -1
- data/lib/playwright_api/android.rb +10 -10
- data/lib/playwright_api/android_device.rb +10 -9
- data/lib/playwright_api/browser.rb +83 -8
- data/lib/playwright_api/browser_context.rb +163 -15
- data/lib/playwright_api/browser_type.rb +35 -4
- data/lib/playwright_api/console_message.rb +6 -6
- data/lib/playwright_api/dialog.rb +28 -8
- data/lib/playwright_api/element_handle.rb +111 -37
- data/lib/playwright_api/file_chooser.rb +5 -0
- data/lib/playwright_api/frame.rb +228 -37
- data/lib/playwright_api/js_handle.rb +26 -3
- data/lib/playwright_api/keyboard.rb +48 -1
- data/lib/playwright_api/mouse.rb +26 -5
- data/lib/playwright_api/page.rb +456 -48
- data/lib/playwright_api/playwright.rb +26 -9
- data/lib/playwright_api/request.rb +34 -6
- data/lib/playwright_api/response.rb +8 -8
- data/lib/playwright_api/route.rb +30 -6
- data/lib/playwright_api/selectors.rb +32 -6
- data/lib/playwright_api/touchscreen.rb +1 -1
- data/lib/playwright_api/worker.rb +25 -1
- data/playwright.gemspec +4 -2
- metadata +37 -14
- data/lib/playwright/channel_owners/chromium_browser.rb +0 -8
- data/lib/playwright/channel_owners/chromium_browser_context.rb +0 -8
- data/lib/playwright/channel_owners/download.rb +0 -27
- data/lib/playwright/channel_owners/firefox_browser.rb +0 -8
- data/lib/playwright/channel_owners/webkit_browser.rb +0 -8
- data/lib/playwright_api/binding_call.rb +0 -32
- data/lib/playwright_api/chromium_browser_context.rb +0 -59
- data/lib/playwright_api/download.rb +0 -95
- data/lib/playwright_api/video.rb +0 -24
@@ -15,6 +15,23 @@ module Playwright
|
|
15
15
|
# })();
|
16
16
|
# ```
|
17
17
|
#
|
18
|
+
# ```java
|
19
|
+
# import com.microsoft.playwright.*;
|
20
|
+
#
|
21
|
+
# public class Example {
|
22
|
+
# public static void main(String[] args) {
|
23
|
+
# try (Playwright playwright = Playwright.create()) {
|
24
|
+
# BrowserType chromium = playwright.chromium();
|
25
|
+
# Browser browser = chromium.launch();
|
26
|
+
# Page page = browser.newPage();
|
27
|
+
# page.navigate("http://example.com");
|
28
|
+
# // other actions...
|
29
|
+
# browser.close();
|
30
|
+
# }
|
31
|
+
# }
|
32
|
+
# }
|
33
|
+
# ```
|
34
|
+
#
|
18
35
|
# ```python async
|
19
36
|
# import asyncio
|
20
37
|
# from playwright.async_api import async_playwright
|
@@ -49,7 +66,7 @@ module Playwright
|
|
49
66
|
# ```
|
50
67
|
class Playwright < PlaywrightApi
|
51
68
|
|
52
|
-
# This object can be used to launch or connect to Chromium, returning instances of `
|
69
|
+
# This object can be used to launch or connect to Chromium, returning instances of `Browser`.
|
53
70
|
def chromium # property
|
54
71
|
wrap_impl(@impl.chromium)
|
55
72
|
end
|
@@ -113,7 +130,7 @@ module Playwright
|
|
113
130
|
wrap_impl(@impl.devices)
|
114
131
|
end
|
115
132
|
|
116
|
-
# This object can be used to launch or connect to Firefox, returning instances of `
|
133
|
+
# This object can be used to launch or connect to Firefox, returning instances of `Browser`.
|
117
134
|
def firefox # property
|
118
135
|
wrap_impl(@impl.firefox)
|
119
136
|
end
|
@@ -124,7 +141,7 @@ module Playwright
|
|
124
141
|
wrap_impl(@impl.selectors)
|
125
142
|
end
|
126
143
|
|
127
|
-
# This object can be used to launch or connect to WebKit, returning instances of `
|
144
|
+
# This object can be used to launch or connect to WebKit, returning instances of `Browser`.
|
128
145
|
def webkit # property
|
129
146
|
wrap_impl(@impl.webkit)
|
130
147
|
end
|
@@ -159,12 +176,6 @@ module Playwright
|
|
159
176
|
wrap_impl(@impl.electron)
|
160
177
|
end
|
161
178
|
|
162
|
-
# -- inherited from EventEmitter --
|
163
|
-
# @nodoc
|
164
|
-
def off(event, callback)
|
165
|
-
event_emitter_proxy.off(event, callback)
|
166
|
-
end
|
167
|
-
|
168
179
|
# -- inherited from EventEmitter --
|
169
180
|
# @nodoc
|
170
181
|
def once(event, callback)
|
@@ -177,6 +188,12 @@ module Playwright
|
|
177
188
|
event_emitter_proxy.on(event, callback)
|
178
189
|
end
|
179
190
|
|
191
|
+
# -- inherited from EventEmitter --
|
192
|
+
# @nodoc
|
193
|
+
def off(event, callback)
|
194
|
+
event_emitter_proxy.off(event, callback)
|
195
|
+
end
|
196
|
+
|
180
197
|
private def event_emitter_proxy
|
181
198
|
@event_emitter_proxy ||= EventEmitterProxy.new(self, @impl)
|
182
199
|
end
|
@@ -25,6 +25,12 @@ module Playwright
|
|
25
25
|
# });
|
26
26
|
# ```
|
27
27
|
#
|
28
|
+
# ```java
|
29
|
+
# page.onRequestFailed(request -> {
|
30
|
+
# System.out.println(request.url() + " " + request.failure());
|
31
|
+
# });
|
32
|
+
# ```
|
33
|
+
#
|
28
34
|
# ```py
|
29
35
|
# page.on("requestfailed", lambda request: print(request.url + " " + request.failure))
|
30
36
|
# ```
|
@@ -84,6 +90,11 @@ module Playwright
|
|
84
90
|
# console.log(response.request().redirectedFrom().url()); // 'http://example.com'
|
85
91
|
# ```
|
86
92
|
#
|
93
|
+
# ```java
|
94
|
+
# Response response = page.navigate("http://example.com");
|
95
|
+
# System.out.println(response.request().redirectedFrom().url()); // "http://example.com"
|
96
|
+
# ```
|
97
|
+
#
|
87
98
|
# ```python async
|
88
99
|
# response = await page.goto("http://example.com")
|
89
100
|
# print(response.request.redirected_from.url) # "http://example.com"
|
@@ -102,6 +113,11 @@ module Playwright
|
|
102
113
|
# console.log(response.request().redirectedFrom()); // null
|
103
114
|
# ```
|
104
115
|
#
|
116
|
+
# ```java
|
117
|
+
# Response response = page.navigate("https://google.com");
|
118
|
+
# System.out.println(response.request().redirectedFrom()); // null
|
119
|
+
# ```
|
120
|
+
#
|
105
121
|
# ```python async
|
106
122
|
# response = await page.goto("https://google.com")
|
107
123
|
# print(response.request.redirected_from) # None
|
@@ -124,6 +140,10 @@ module Playwright
|
|
124
140
|
# console.log(request.redirectedFrom().redirectedTo() === request); // true
|
125
141
|
# ```
|
126
142
|
#
|
143
|
+
# ```java
|
144
|
+
# System.out.println(request.redirectedFrom().redirectedTo() == request); // true
|
145
|
+
# ```
|
146
|
+
#
|
127
147
|
# ```py
|
128
148
|
# assert request.redirected_from.redirected_to == request
|
129
149
|
# ```
|
@@ -156,6 +176,14 @@ module Playwright
|
|
156
176
|
# console.log(request.timing());
|
157
177
|
# ```
|
158
178
|
#
|
179
|
+
# ```java
|
180
|
+
# page.onRequestFinished(request -> {
|
181
|
+
# Timing timing = request.timing();
|
182
|
+
# System.out.println(timing.responseEnd - timing.startTime);
|
183
|
+
# });
|
184
|
+
# page.navigate("http://example.com");
|
185
|
+
# ```
|
186
|
+
#
|
159
187
|
# ```python async
|
160
188
|
# async with page.expect_event("requestfinished") as request_info:
|
161
189
|
# await page.goto("http://example.com")
|
@@ -178,12 +206,6 @@ module Playwright
|
|
178
206
|
wrap_impl(@impl.url)
|
179
207
|
end
|
180
208
|
|
181
|
-
# -- inherited from EventEmitter --
|
182
|
-
# @nodoc
|
183
|
-
def off(event, callback)
|
184
|
-
event_emitter_proxy.off(event, callback)
|
185
|
-
end
|
186
|
-
|
187
209
|
# -- inherited from EventEmitter --
|
188
210
|
# @nodoc
|
189
211
|
def once(event, callback)
|
@@ -196,6 +218,12 @@ module Playwright
|
|
196
218
|
event_emitter_proxy.on(event, callback)
|
197
219
|
end
|
198
220
|
|
221
|
+
# -- inherited from EventEmitter --
|
222
|
+
# @nodoc
|
223
|
+
def off(event, callback)
|
224
|
+
event_emitter_proxy.off(event, callback)
|
225
|
+
end
|
226
|
+
|
199
227
|
private def event_emitter_proxy
|
200
228
|
@event_emitter_proxy ||= EventEmitterProxy.new(self, @impl)
|
201
229
|
end
|
@@ -59,20 +59,14 @@ module Playwright
|
|
59
59
|
wrap_impl(@impl.url)
|
60
60
|
end
|
61
61
|
|
62
|
-
# @nodoc
|
63
|
-
def ok?
|
64
|
-
wrap_impl(@impl.ok?)
|
65
|
-
end
|
66
|
-
|
67
62
|
# @nodoc
|
68
63
|
def after_initialize
|
69
64
|
wrap_impl(@impl.after_initialize)
|
70
65
|
end
|
71
66
|
|
72
|
-
# -- inherited from EventEmitter --
|
73
67
|
# @nodoc
|
74
|
-
def
|
75
|
-
|
68
|
+
def ok?
|
69
|
+
wrap_impl(@impl.ok?)
|
76
70
|
end
|
77
71
|
|
78
72
|
# -- inherited from EventEmitter --
|
@@ -87,6 +81,12 @@ module Playwright
|
|
87
81
|
event_emitter_proxy.on(event, callback)
|
88
82
|
end
|
89
83
|
|
84
|
+
# -- inherited from EventEmitter --
|
85
|
+
# @nodoc
|
86
|
+
def off(event, callback)
|
87
|
+
event_emitter_proxy.off(event, callback)
|
88
|
+
end
|
89
|
+
|
90
90
|
private def event_emitter_proxy
|
91
91
|
@event_emitter_proxy ||= EventEmitterProxy.new(self, @impl)
|
92
92
|
end
|
data/lib/playwright_api/route.rb
CHANGED
@@ -23,6 +23,16 @@ module Playwright
|
|
23
23
|
# });
|
24
24
|
# ```
|
25
25
|
#
|
26
|
+
# ```java
|
27
|
+
# page.route("**/*", route -> {
|
28
|
+
# // Override headers
|
29
|
+
# Map<String, String> headers = new HashMap<>(route.request().headers());
|
30
|
+
# headers.put("foo", "bar"); // set "foo" header
|
31
|
+
# headers.remove("origin"); // remove "origin" header
|
32
|
+
# route.resume(new Route.ResumeOptions().setHeaders(headers));
|
33
|
+
# });
|
34
|
+
# ```
|
35
|
+
#
|
26
36
|
# ```python async
|
27
37
|
# async def handle(route, request):
|
28
38
|
# # override headers
|
@@ -67,6 +77,15 @@ module Playwright
|
|
67
77
|
# });
|
68
78
|
# ```
|
69
79
|
#
|
80
|
+
# ```java
|
81
|
+
# page.route("**/*", route -> {
|
82
|
+
# route.fulfill(new Route.FulfillOptions()
|
83
|
+
# .setStatus(404)
|
84
|
+
# .setContentType("text/plain")
|
85
|
+
# .setBody("Not Found!"));
|
86
|
+
# });
|
87
|
+
# ```
|
88
|
+
#
|
70
89
|
# ```python async
|
71
90
|
# await page.route("**/*", lambda route: route.fulfill(
|
72
91
|
# status=404,
|
@@ -88,6 +107,11 @@ module Playwright
|
|
88
107
|
# await page.route('**/xhr_endpoint', route => route.fulfill({ path: 'mock_data.json' }));
|
89
108
|
# ```
|
90
109
|
#
|
110
|
+
# ```java
|
111
|
+
# page.route("**/xhr_endpoint", route -> route.fulfill(
|
112
|
+
# new Route.FulfillOptions().setPath(Paths.get("mock_data.json")));
|
113
|
+
# ```
|
114
|
+
#
|
91
115
|
# ```python async
|
92
116
|
# await page.route("**/xhr_endpoint", lambda route: route.fulfill(path="mock_data.json"))
|
93
117
|
# ```
|
@@ -109,12 +133,6 @@ module Playwright
|
|
109
133
|
wrap_impl(@impl.request)
|
110
134
|
end
|
111
135
|
|
112
|
-
# -- inherited from EventEmitter --
|
113
|
-
# @nodoc
|
114
|
-
def off(event, callback)
|
115
|
-
event_emitter_proxy.off(event, callback)
|
116
|
-
end
|
117
|
-
|
118
136
|
# -- inherited from EventEmitter --
|
119
137
|
# @nodoc
|
120
138
|
def once(event, callback)
|
@@ -127,6 +145,12 @@ module Playwright
|
|
127
145
|
event_emitter_proxy.on(event, callback)
|
128
146
|
end
|
129
147
|
|
148
|
+
# -- inherited from EventEmitter --
|
149
|
+
# @nodoc
|
150
|
+
def off(event, callback)
|
151
|
+
event_emitter_proxy.off(event, callback)
|
152
|
+
end
|
153
|
+
|
130
154
|
private def event_emitter_proxy
|
131
155
|
@event_emitter_proxy ||= EventEmitterProxy.new(self, @impl)
|
132
156
|
end
|
@@ -41,6 +41,32 @@ module Playwright
|
|
41
41
|
# })();
|
42
42
|
# ```
|
43
43
|
#
|
44
|
+
# ```java
|
45
|
+
# // Script that evaluates to a selector engine instance.
|
46
|
+
# String createTagNameEngine = "{\n" +
|
47
|
+
# " // Returns the first element matching given selector in the root's subtree.\n" +
|
48
|
+
# " query(root, selector) {\n" +
|
49
|
+
# " return root.querySelector(selector);\n" +
|
50
|
+
# " },\n" +
|
51
|
+
# " // Returns all elements matching given selector in the root's subtree.\n" +
|
52
|
+
# " queryAll(root, selector) {\n" +
|
53
|
+
# " return Array.from(root.querySelectorAll(selector));\n" +
|
54
|
+
# " }\n" +
|
55
|
+
# "}";
|
56
|
+
# // Register the engine. Selectors will be prefixed with "tag=".
|
57
|
+
# playwright.selectors().register("tag", createTagNameEngine);
|
58
|
+
# Browser browser = playwright.firefox().launch();
|
59
|
+
# Page page = browser.newPage();
|
60
|
+
# page.setContent("<div><button>Click me</button></div>");
|
61
|
+
# // Use the selector prefixed with its name.
|
62
|
+
# ElementHandle button = page.querySelector("tag=button");
|
63
|
+
# // Combine it with other selector engines.
|
64
|
+
# page.click("tag=div >> text=\"Click me\"");
|
65
|
+
# // Can use it in any methods supporting selectors.
|
66
|
+
# int buttonCount = (int) page.evalOnSelectorAll("tag=button", "buttons => buttons.length");
|
67
|
+
# browser.close();
|
68
|
+
# ```
|
69
|
+
#
|
44
70
|
# ```python async
|
45
71
|
# # FIXME: add snippet
|
46
72
|
# ```
|
@@ -52,12 +78,6 @@ module Playwright
|
|
52
78
|
wrap_impl(@impl.register(unwrap_impl(name), contentScript: unwrap_impl(contentScript), path: unwrap_impl(path), script: unwrap_impl(script)))
|
53
79
|
end
|
54
80
|
|
55
|
-
# -- inherited from EventEmitter --
|
56
|
-
# @nodoc
|
57
|
-
def off(event, callback)
|
58
|
-
event_emitter_proxy.off(event, callback)
|
59
|
-
end
|
60
|
-
|
61
81
|
# -- inherited from EventEmitter --
|
62
82
|
# @nodoc
|
63
83
|
def once(event, callback)
|
@@ -70,6 +90,12 @@ module Playwright
|
|
70
90
|
event_emitter_proxy.on(event, callback)
|
71
91
|
end
|
72
92
|
|
93
|
+
# -- inherited from EventEmitter --
|
94
|
+
# @nodoc
|
95
|
+
def off(event, callback)
|
96
|
+
event_emitter_proxy.off(event, callback)
|
97
|
+
end
|
98
|
+
|
73
99
|
private def event_emitter_proxy
|
74
100
|
@event_emitter_proxy ||= EventEmitterProxy.new(self, @impl)
|
75
101
|
end
|
@@ -1,6 +1,6 @@
|
|
1
1
|
module Playwright
|
2
2
|
# The Touchscreen class operates in main-frame CSS pixels relative to the top-left corner of the viewport. Methods on the
|
3
|
-
# touchscreen can only be used in browser contexts that have been
|
3
|
+
# touchscreen can only be used in browser contexts that have been initialized with `hasTouch` set to true.
|
4
4
|
class Touchscreen < PlaywrightApi
|
5
5
|
|
6
6
|
# Dispatches a `touchstart` and `touchend` event with a single touch at the position (`x`,`y`).
|
@@ -15,6 +15,16 @@ module Playwright
|
|
15
15
|
# console.log(' ' + worker.url());
|
16
16
|
# ```
|
17
17
|
#
|
18
|
+
# ```java
|
19
|
+
# page.onWorker(worker -> {
|
20
|
+
# System.out.println("Worker created: " + worker.url());
|
21
|
+
# worker.onClose(worker1 -> System.out.println("Worker destroyed: " + worker1.url()));
|
22
|
+
# });
|
23
|
+
# System.out.println("Current workers:");
|
24
|
+
# for (Worker worker : page.workers())
|
25
|
+
# System.out.println(" " + worker.url());
|
26
|
+
# ```
|
27
|
+
#
|
18
28
|
# ```py
|
19
29
|
# def handle_worker(worker):
|
20
30
|
# print("worker created: " + worker.url)
|
@@ -26,6 +36,20 @@ module Playwright
|
|
26
36
|
# for worker in page.workers:
|
27
37
|
# print(" " + worker.url)
|
28
38
|
# ```
|
39
|
+
#
|
40
|
+
# ```csharp
|
41
|
+
# Page.Worker += (_, worker) =>
|
42
|
+
# {
|
43
|
+
# Console.WriteLine($"Worker created: {worker.Url}");
|
44
|
+
# worker.Close += (_, _) => Console.WriteLine($"Worker closed {worker.Url}");
|
45
|
+
# };
|
46
|
+
#
|
47
|
+
# Console.WriteLine("Current Workers:");
|
48
|
+
# foreach(var pageWorker in Page.Workers)
|
49
|
+
# {
|
50
|
+
# Console.WriteLine($"\tWorker: {pageWorker.Url}");
|
51
|
+
# }
|
52
|
+
# ```
|
29
53
|
class Worker < PlaywrightApi
|
30
54
|
|
31
55
|
# Returns the return value of `expression`.
|
@@ -34,7 +58,7 @@ module Playwright
|
|
34
58
|
# wait for the promise to resolve and return its value.
|
35
59
|
#
|
36
60
|
# If the function passed to the [`method: Worker.evaluate`] returns a non-[Serializable] value, then
|
37
|
-
# [`method: Worker.evaluate`] returns `undefined`. Playwright also supports transferring some
|
61
|
+
# [`method: Worker.evaluate`] returns `undefined`. Playwright also supports transferring some additional values that are
|
38
62
|
# not serializable by `JSON`: `-0`, `NaN`, `Infinity`, `-Infinity`.
|
39
63
|
def evaluate(expression, arg: nil)
|
40
64
|
raise NotImplementedError.new('evaluate is not implemented yet.')
|
data/playwright.gemspec
CHANGED
@@ -17,20 +17,22 @@ Gem::Specification.new do |spec|
|
|
17
17
|
|
18
18
|
spec.files = Dir.chdir(File.expand_path(__dir__)) do
|
19
19
|
`git ls-files -z`.split("\x0").reject do |f|
|
20
|
-
f.match(%r{^(test|spec|features)/}) || f.include?(".git") || f.start_with?("development/")
|
20
|
+
f.match(%r{^(test|spec|features)/}) || f.include?(".git") || f.include?(".circleci") || f.start_with?("development/")
|
21
21
|
end
|
22
22
|
end + `find lib/playwright_api -name *.rb -type f`.split("\n")
|
23
23
|
spec.bindir = 'exe'
|
24
24
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
25
25
|
spec.require_paths = ['lib']
|
26
26
|
|
27
|
-
spec.add_dependency 'concurrent-ruby'
|
27
|
+
spec.add_dependency 'concurrent-ruby', '>= 1.1.6'
|
28
28
|
spec.add_dependency 'mime-types', '>= 3.0'
|
29
29
|
spec.add_development_dependency 'bundler', '~> 2.2.3'
|
30
|
+
spec.add_development_dependency 'chunky_png'
|
30
31
|
spec.add_development_dependency 'dry-inflector'
|
31
32
|
spec.add_development_dependency 'pry-byebug'
|
32
33
|
spec.add_development_dependency 'rake', '~> 13.0.3'
|
33
34
|
spec.add_development_dependency 'rspec', '~> 3.10.0 '
|
35
|
+
spec.add_development_dependency 'rspec_junit_formatter' # for CircleCI.
|
34
36
|
spec.add_development_dependency 'rubocop', '~> 1.7.0'
|
35
37
|
spec.add_development_dependency 'rubocop-rspec'
|
36
38
|
spec.add_development_dependency 'sinatra'
|
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.
|
4
|
+
version: 0.5.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- YusukeIwaki
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-04-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: concurrent-ruby
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: 1.1.6
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
26
|
+
version: 1.1.6
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: mime-types
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -52,6 +52,20 @@ dependencies:
|
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: 2.2.3
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: chunky_png
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
55
69
|
- !ruby/object:Gem::Dependency
|
56
70
|
name: dry-inflector
|
57
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -108,6 +122,20 @@ dependencies:
|
|
108
122
|
- - "~>"
|
109
123
|
- !ruby/object:Gem::Version
|
110
124
|
version: 3.10.0
|
125
|
+
- !ruby/object:Gem::Dependency
|
126
|
+
name: rspec_junit_formatter
|
127
|
+
requirement: !ruby/object:Gem::Requirement
|
128
|
+
requirements:
|
129
|
+
- - ">="
|
130
|
+
- !ruby/object:Gem::Version
|
131
|
+
version: '0'
|
132
|
+
type: :development
|
133
|
+
prerelease: false
|
134
|
+
version_requirements: !ruby/object:Gem::Requirement
|
135
|
+
requirements:
|
136
|
+
- - ">="
|
137
|
+
- !ruby/object:Gem::Version
|
138
|
+
version: '0'
|
111
139
|
- !ruby/object:Gem::Dependency
|
112
140
|
name: rubocop
|
113
141
|
requirement: !ruby/object:Gem::Requirement
|
@@ -187,18 +215,15 @@ files:
|
|
187
215
|
- lib/playwright/channel_owner.rb
|
188
216
|
- lib/playwright/channel_owners/android.rb
|
189
217
|
- lib/playwright/channel_owners/android_device.rb
|
218
|
+
- lib/playwright/channel_owners/artifact.rb
|
190
219
|
- lib/playwright/channel_owners/binding_call.rb
|
191
220
|
- lib/playwright/channel_owners/browser.rb
|
192
221
|
- lib/playwright/channel_owners/browser_context.rb
|
193
222
|
- lib/playwright/channel_owners/browser_type.rb
|
194
|
-
- lib/playwright/channel_owners/chromium_browser.rb
|
195
|
-
- lib/playwright/channel_owners/chromium_browser_context.rb
|
196
223
|
- lib/playwright/channel_owners/console_message.rb
|
197
224
|
- lib/playwright/channel_owners/dialog.rb
|
198
|
-
- lib/playwright/channel_owners/download.rb
|
199
225
|
- lib/playwright/channel_owners/electron.rb
|
200
226
|
- lib/playwright/channel_owners/element_handle.rb
|
201
|
-
- lib/playwright/channel_owners/firefox_browser.rb
|
202
227
|
- lib/playwright/channel_owners/frame.rb
|
203
228
|
- lib/playwright/channel_owners/js_handle.rb
|
204
229
|
- lib/playwright/channel_owners/page.rb
|
@@ -207,8 +232,9 @@ files:
|
|
207
232
|
- lib/playwright/channel_owners/response.rb
|
208
233
|
- lib/playwright/channel_owners/route.rb
|
209
234
|
- lib/playwright/channel_owners/selectors.rb
|
210
|
-
- lib/playwright/channel_owners/
|
235
|
+
- lib/playwright/channel_owners/stream.rb
|
211
236
|
- lib/playwright/connection.rb
|
237
|
+
- lib/playwright/download.rb
|
212
238
|
- lib/playwright/errors.rb
|
213
239
|
- lib/playwright/event_emitter.rb
|
214
240
|
- lib/playwright/event_emitter_proxy.rb
|
@@ -232,6 +258,7 @@ files:
|
|
232
258
|
- lib/playwright/url_matcher.rb
|
233
259
|
- lib/playwright/utils.rb
|
234
260
|
- lib/playwright/version.rb
|
261
|
+
- lib/playwright/video.rb
|
235
262
|
- lib/playwright/wait_helper.rb
|
236
263
|
- lib/playwright_api/accessibility.rb
|
237
264
|
- lib/playwright_api/android.rb
|
@@ -239,15 +266,12 @@ files:
|
|
239
266
|
- lib/playwright_api/android_input.rb
|
240
267
|
- lib/playwright_api/android_socket.rb
|
241
268
|
- lib/playwright_api/android_web_view.rb
|
242
|
-
- lib/playwright_api/binding_call.rb
|
243
269
|
- lib/playwright_api/browser.rb
|
244
270
|
- lib/playwright_api/browser_context.rb
|
245
271
|
- lib/playwright_api/browser_type.rb
|
246
272
|
- lib/playwright_api/cdp_session.rb
|
247
|
-
- lib/playwright_api/chromium_browser_context.rb
|
248
273
|
- lib/playwright_api/console_message.rb
|
249
274
|
- lib/playwright_api/dialog.rb
|
250
|
-
- lib/playwright_api/download.rb
|
251
275
|
- lib/playwright_api/element_handle.rb
|
252
276
|
- lib/playwright_api/file_chooser.rb
|
253
277
|
- lib/playwright_api/frame.rb
|
@@ -261,7 +285,6 @@ files:
|
|
261
285
|
- lib/playwright_api/route.rb
|
262
286
|
- lib/playwright_api/selectors.rb
|
263
287
|
- lib/playwright_api/touchscreen.rb
|
264
|
-
- lib/playwright_api/video.rb
|
265
288
|
- lib/playwright_api/web_socket.rb
|
266
289
|
- lib/playwright_api/worker.rb
|
267
290
|
- playwright.gemspec
|
@@ -284,7 +307,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
284
307
|
- !ruby/object:Gem::Version
|
285
308
|
version: '0'
|
286
309
|
requirements: []
|
287
|
-
rubygems_version: 3.2.
|
310
|
+
rubygems_version: 3.2.15
|
288
311
|
signing_key:
|
289
312
|
specification_version: 4
|
290
313
|
summary: The Ruby binding of playwright driver
|
@@ -1,27 +0,0 @@
|
|
1
|
-
module Playwright
|
2
|
-
define_channel_owner :Download do
|
3
|
-
def url
|
4
|
-
@initializer['url']
|
5
|
-
end
|
6
|
-
|
7
|
-
def suggested_filename
|
8
|
-
@initializer['suggestedFilename']
|
9
|
-
end
|
10
|
-
|
11
|
-
def delete
|
12
|
-
@channel.send_message_to_server('delete')
|
13
|
-
end
|
14
|
-
|
15
|
-
def failure
|
16
|
-
@channel.send_message_to_server('failure')
|
17
|
-
end
|
18
|
-
|
19
|
-
def path
|
20
|
-
@channel.send_message_to_server('path')
|
21
|
-
end
|
22
|
-
|
23
|
-
def save_as(path)
|
24
|
-
@channel.send_message_to_server('saveAs', path: path)
|
25
|
-
end
|
26
|
-
end
|
27
|
-
end
|
@@ -1,32 +0,0 @@
|
|
1
|
-
module Playwright
|
2
|
-
# @nodoc
|
3
|
-
class BindingCall < PlaywrightApi
|
4
|
-
|
5
|
-
# @nodoc
|
6
|
-
def name
|
7
|
-
wrap_impl(@impl.name)
|
8
|
-
end
|
9
|
-
|
10
|
-
# -- inherited from EventEmitter --
|
11
|
-
# @nodoc
|
12
|
-
def off(event, callback)
|
13
|
-
event_emitter_proxy.off(event, callback)
|
14
|
-
end
|
15
|
-
|
16
|
-
# -- inherited from EventEmitter --
|
17
|
-
# @nodoc
|
18
|
-
def once(event, callback)
|
19
|
-
event_emitter_proxy.once(event, callback)
|
20
|
-
end
|
21
|
-
|
22
|
-
# -- inherited from EventEmitter --
|
23
|
-
# @nodoc
|
24
|
-
def on(event, callback)
|
25
|
-
event_emitter_proxy.on(event, callback)
|
26
|
-
end
|
27
|
-
|
28
|
-
private def event_emitter_proxy
|
29
|
-
@event_emitter_proxy ||= EventEmitterProxy.new(self, @impl)
|
30
|
-
end
|
31
|
-
end
|
32
|
-
end
|