Class: Browserctl::PageProxy

Inherits:
Object
  • Object
show all
Defined in:
lib/browserctl/workflow.rb

Instance Method Summary collapse

Constructor Details

#initialize(name, client) ⇒ PageProxy

Returns a new instance of PageProxy.



116
117
118
119
# File 'lib/browserctl/workflow.rb', line 116

def initialize(name, client)
  @name   = name
  @client = client
end

Instance Method Details

#click(sel) ⇒ Object



123
# File 'lib/browserctl/workflow.rb', line 123

def click(sel)                = unwrap @client.click(@name, sel)

#delete_cookiesObject



127
# File 'lib/browserctl/workflow.rb', line 127

def delete_cookies             = unwrap @client.delete_cookies(@name)

#devtoolsObject



128
# File 'lib/browserctl/workflow.rb', line 128

def devtools                   = @client.devtools(@name)[:devtools_url]

#evaluate(expr) ⇒ Object



130
# File 'lib/browserctl/workflow.rb', line 130

def evaluate(expr)             = @client.evaluate(@name, expr)[:result]

#fill(sel, val) ⇒ Object



122
# File 'lib/browserctl/workflow.rb', line 122

def fill(sel, val)            = unwrap @client.fill(@name, sel, val)


121
# File 'lib/browserctl/workflow.rb', line 121

def navigate(url)             = unwrap @client.navigate(@name, url)

#screenshotObject



125
# File 'lib/browserctl/workflow.rb', line 125

def screenshot(**)            = unwrap @client.screenshot(@name, **)

#snapshotObject



124
# File 'lib/browserctl/workflow.rb', line 124

def snapshot(**)              = unwrap @client.snapshot(@name, **)

#storage_get(key, store: "local") ⇒ Object



132
133
134
# File 'lib/browserctl/workflow.rb', line 132

def storage_get(key, store: "local")
  @client.storage_get(@name, key, store: store)[:value]
end

#storage_set(key, value, store: "local") ⇒ Object



136
137
138
# File 'lib/browserctl/workflow.rb', line 136

def storage_set(key, value, store: "local")
  unwrap @client.storage_set(@name, key, value, store: store)
end

#urlObject



129
# File 'lib/browserctl/workflow.rb', line 129

def url                        = @client.url(@name)[:url]

#wait(sel, timeout: 30) ⇒ Object



126
# File 'lib/browserctl/workflow.rb', line 126

def wait(sel, timeout: 30)    = unwrap @client.wait(@name, sel, timeout: timeout)