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.



188
189
190
191
# File 'lib/browserctl/workflow.rb', line 188

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

Instance Method Details

#click(selector = nil, ref: nil) ⇒ Object



199
200
201
# File 'lib/browserctl/workflow.rb', line 199

def click(selector = nil, ref: nil)
  unwrap @client.click(@name, selector, ref: ref)
end

#delete_cookiesObject



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

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

#devtoolsObject



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

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

#dialog_accept(text: nil) ⇒ Object



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

def dialog_accept(text: nil) = unwrap @client.dialog_accept(@name, text: text)

#dialog_dismissObject



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

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

#evaluate(expr) ⇒ Object



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

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

#fill(selector = nil, value = nil, ref: nil) ⇒ Object



195
196
197
# File 'lib/browserctl/workflow.rb', line 195

def fill(selector = nil, value = nil, ref: nil)
  unwrap @client.fill(@name, selector, value, ref: ref)
end

#hover(selector = nil, ref: nil) ⇒ Object



221
222
223
# File 'lib/browserctl/workflow.rb', line 221

def hover(selector = nil, ref: nil)
  unwrap @client.hover(@name, selector, ref: ref)
end


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

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

#press(key) ⇒ Object



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

def press(key) = unwrap @client.press(@name, key)

#screenshotObject



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

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

#select(selector = nil, value = nil, ref: nil) ⇒ Object



229
230
231
# File 'lib/browserctl/workflow.rb', line 229

def select(selector = nil, value = nil, ref: nil)
  unwrap @client.select(@name, selector, value, ref: ref)
end

#snapshotObject



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

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

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



211
212
213
# File 'lib/browserctl/workflow.rb', line 211

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

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



215
216
217
# File 'lib/browserctl/workflow.rb', line 215

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

#upload(selector = nil, path = nil, ref: nil) ⇒ Object



225
226
227
# File 'lib/browserctl/workflow.rb', line 225

def upload(selector = nil, path = nil, ref: nil)
  unwrap @client.upload(@name, selector, path, ref: ref)
end

#urlObject



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

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

#wait(sel, timeout: 30) ⇒ Object



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

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