Module: Playwright
- Defined in:
- lib/playwright.rb,
lib/playwright.rb,
lib/playwright/utils.rb,
lib/playwright/errors.rb,
lib/playwright/events.rb,
lib/playwright/channel.rb,
lib/playwright/version.rb,
lib/playwright_api/page.rb,
lib/playwright/transport.rb,
lib/playwright_api/frame.rb,
lib/playwright_api/mouse.rb,
lib/playwright_api/route.rb,
lib/playwright_api/video.rb,
lib/playwright/connection.rb,
lib/playwright/input_type.rb,
lib/playwright/javascript.rb,
lib/playwright_api/dialog.rb,
lib/playwright_api/worker.rb,
lib/playwright/url_matcher.rb,
lib/playwright/wait_helper.rb,
lib/playwright_api/browser.rb,
lib/playwright_api/request.rb,
lib/playwright_api/download.rb,
lib/playwright_api/keyboard.rb,
lib/playwright_api/response.rb,
lib/playwright/channel_owner.rb,
lib/playwright/event_emitter.rb,
lib/playwright_api/js_handle.rb,
lib/playwright_api/selectors.rb,
lib/playwright/playwright_api.rb,
lib/playwright_api/playwright.rb,
lib/playwright_api/web_socket.rb,
lib/playwright_api/cdp_session.rb,
lib/playwright_api/touchscreen.rb,
lib/playwright/timeout_settings.rb,
lib/playwright_api/binding_call.rb,
lib/playwright_api/browser_type.rb,
lib/playwright_api/file_chooser.rb,
lib/playwright/input_types/mouse.rb,
lib/playwright_api/accessibility.rb,
lib/playwright_api/element_handle.rb,
lib/playwright/channel_owners/page.rb,
lib/playwright/javascript/function.rb,
lib/playwright_api/browser_context.rb,
lib/playwright_api/console_message.rb,
lib/playwright/channel_owners/frame.rb,
lib/playwright/input_types/keyboard.rb,
lib/playwright/javascript/expression.rb,
lib/playwright/channel_owners/android.rb,
lib/playwright/channel_owners/browser.rb,
lib/playwright/channel_owners/request.rb,
lib/playwright/channel_owners/electron.rb,
lib/playwright/channel_owners/response.rb,
lib/playwright/input_types/touchscreen.rb,
lib/playwright/javascript/value_parser.rb,
lib/playwright/channel_owners/js_handle.rb,
lib/playwright/channel_owners/selectors.rb,
lib/playwright/channel_owners/playwright.rb,
lib/playwright/channel_owners/binding_call.rb,
lib/playwright/channel_owners/browser_type.rb,
lib/playwright/javascript/value_serializer.rb,
lib/playwright_api/chromium_browser_context.rb,
lib/playwright/channel_owners/element_handle.rb,
lib/playwright/channel_owners/webkit_browser.rb,
lib/playwright/channel_owners/browser_context.rb,
lib/playwright/channel_owners/console_message.rb,
lib/playwright/channel_owners/firefox_browser.rb,
lib/playwright/channel_owners/chromium_browser.rb,
lib/playwright/channel_owners/chromium_browser_context.rb
Overview
Defined Under Namespace
Modules: ChannelOwners, EventEmitter, EventListenerInterface, Events, InputTypes, JavaScript, Utils
Classes: Accessibility, BindingCall, Browser, BrowserContext, BrowserType, CDPSession, Channel, ChannelOwner, ChromiumBrowserContext, Connection, ConsoleMessage, Dialog, Download, ElementHandle, Error, EventEmitterCallback, EventEmitterOnceCallback, FileChooser, Frame, InputType, JSHandle, Keyboard, Mouse, Page, Playwright, PlaywrightApi, Request, Response, RootChannelOwner, Route, Selectors, TimeoutError, TimeoutSettings, Touchscreen, Transport, UrlMatcher, Video, WaitHelper, WebSocket, Worker
Constant Summary
collapse
- VERSION =
'0.0.6'
Class Method Summary
collapse
Class Method Details
.create(playwright_cli_executable_path:, &block) ⇒ Object
31
32
33
34
35
36
37
38
39
40
41
42
43
44
|
# File 'lib/playwright.rb', line 31
module_function def create(playwright_cli_executable_path:, &block)
raise ArgumentError.new("block must be provided") unless block
connection = Connection.new(playwright_cli_executable_path: playwright_cli_executable_path)
playwright_promise = connection.async_wait_for_object_with_known_name('Playwright')
Thread.new { connection.run }
playwright = PlaywrightApi.from_channel_owner(playwright_promise.value!)
begin
block.call(playwright)
ensure
connection.stop
end
end
|
.define_channel_owner(class_name, &block) ⇒ Object
85
86
87
88
89
|
# File 'lib/playwright/channel_owner.rb', line 85
def self.define_channel_owner(class_name, &block)
klass = Class.new(ChannelOwner)
klass.class_eval(&block) if block
ChannelOwners.const_set(class_name, klass)
end
|
11
12
13
14
15
|
# File 'lib/playwright/input_type.rb', line 11
def self.define_input_type(class_name, &block)
klass = Class.new(InputType)
klass.class_eval(&block) if block
InputTypes.const_set(class_name, klass)
end
|