Class: Browserctl::PageProxy
- Inherits:
-
Object
- Object
- Browserctl::PageProxy
- Defined in:
- lib/browserctl/workflow.rb
Instance Method Summary collapse
- #click(sel) ⇒ Object
- #delete_cookies ⇒ Object
- #devtools ⇒ Object
- #evaluate(expr) ⇒ Object
- #fill(sel, val) ⇒ Object
-
#initialize(name, client) ⇒ PageProxy
constructor
A new instance of PageProxy.
- #navigate(url) ⇒ Object
- #screenshot ⇒ Object
- #snapshot ⇒ Object
- #storage_get(key, store: "local") ⇒ Object
- #storage_set(key, value, store: "local") ⇒ Object
- #url ⇒ Object
- #wait(sel, timeout: 30) ⇒ Object
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_cookies ⇒ Object
127 |
# File 'lib/browserctl/workflow.rb', line 127 def = unwrap @client.(@name) |
#devtools ⇒ Object
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) |
#navigate(url) ⇒ Object
121 |
# File 'lib/browserctl/workflow.rb', line 121 def navigate(url) = unwrap @client.navigate(@name, url) |
#screenshot ⇒ Object
125 |
# File 'lib/browserctl/workflow.rb', line 125 def screenshot(**) = unwrap @client.screenshot(@name, **) |
#snapshot ⇒ Object
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 |
#url ⇒ Object
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) |