Packages

Playwright is an Elixir library to automate Chromium, Firefox and WebKit browsers with a single API. Playwright delivers automation that is ever-green, capable, reliable and fast.

Current section

Files

Jump to
playwrightais lib playwright binding_call.ex
Raw

lib/playwright/binding_call.ex

defmodule Playwright.BindingCall do
@moduledoc false
use Playwright.ChannelOwner
import Playwright.Helpers.Serialization
alias Playwright.BindingCall
@property :args
@property :frame
@property :handle
@property :name
def call(%BindingCall{session: session} = binding_call, func) do
Task.start_link(fn ->
frame = Channel.find(session, {:guid, binding_call.frame.guid})
source = %{
context: "TBD",
frame: frame,
page: "TBD"
}
result = func.(source, deserialize(binding_call.args))
Channel.post(session, {:guid, binding_call.guid}, :resolve, %{result: serialize(result)})
end)
end
end