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
- #dialog_accept(text: nil) ⇒ Object
- #dialog_dismiss ⇒ Object
- #evaluate(expr) ⇒ Object
- #fill(sel, val) ⇒ Object
- #hover(selector) ⇒ Object
-
#initialize(name, client) ⇒ PageProxy
constructor
A new instance of PageProxy.
- #navigate(url) ⇒ Object
- #press(key) ⇒ Object
- #screenshot ⇒ Object
- #select(selector, value) ⇒ Object
- #snapshot ⇒ Object
- #storage_get(key, store: "local") ⇒ Object
- #storage_set(key, value, store: "local") ⇒ Object
- #upload(selector, path) ⇒ Object
- #url ⇒ Object
- #wait(sel, timeout: 30) ⇒ Object
Constructor Details
#initialize(name, client) ⇒ PageProxy
Returns a new instance of PageProxy.
174 175 176 177 |
# File 'lib/browserctl/workflow.rb', line 174 def initialize(name, client) @name = name @client = client end |
Instance Method Details
#click(sel) ⇒ Object
181 |
# File 'lib/browserctl/workflow.rb', line 181 def click(sel) = unwrap @client.click(@name, sel) |
#delete_cookies ⇒ Object
185 |
# File 'lib/browserctl/workflow.rb', line 185 def = unwrap @client.(@name) |
#devtools ⇒ Object
186 |
# File 'lib/browserctl/workflow.rb', line 186 def devtools = @client.devtools(@name)[:devtools_url] |
#dialog_accept(text: nil) ⇒ Object
202 |
# File 'lib/browserctl/workflow.rb', line 202 def dialog_accept(text: nil) = unwrap @client.dialog_accept(@name, text: text) |
#dialog_dismiss ⇒ Object
203 |
# File 'lib/browserctl/workflow.rb', line 203 def dialog_dismiss = unwrap @client.dialog_dismiss(@name) |
#evaluate(expr) ⇒ Object
188 |
# File 'lib/browserctl/workflow.rb', line 188 def evaluate(expr) = @client.evaluate(@name, expr)[:result] |
#fill(sel, val) ⇒ Object
180 |
# File 'lib/browserctl/workflow.rb', line 180 def fill(sel, val) = unwrap @client.fill(@name, sel, val) |
#hover(selector) ⇒ Object
199 |
# File 'lib/browserctl/workflow.rb', line 199 def hover(selector) = unwrap @client.hover(@name, selector) |
#navigate(url) ⇒ Object
179 |
# File 'lib/browserctl/workflow.rb', line 179 def navigate(url) = unwrap @client.navigate(@name, url) |
#press(key) ⇒ Object
198 |
# File 'lib/browserctl/workflow.rb', line 198 def press(key) = unwrap @client.press(@name, key) |
#screenshot ⇒ Object
183 |
# File 'lib/browserctl/workflow.rb', line 183 def screenshot(**) = unwrap @client.screenshot(@name, **) |
#select(selector, value) ⇒ Object
201 |
# File 'lib/browserctl/workflow.rb', line 201 def select(selector, value) = unwrap @client.select(@name, selector, value) |
#snapshot ⇒ Object
182 |
# File 'lib/browserctl/workflow.rb', line 182 def snapshot(**) = unwrap @client.snapshot(@name, **) |
#storage_get(key, store: "local") ⇒ Object
190 191 192 |
# File 'lib/browserctl/workflow.rb', line 190 def storage_get(key, store: "local") @client.storage_get(@name, key, store: store)[:value] end |
#storage_set(key, value, store: "local") ⇒ Object
194 195 196 |
# File 'lib/browserctl/workflow.rb', line 194 def storage_set(key, value, store: "local") unwrap @client.storage_set(@name, key, value, store: store) end |
#upload(selector, path) ⇒ Object
200 |
# File 'lib/browserctl/workflow.rb', line 200 def upload(selector, path) = unwrap @client.upload(@name, selector, path) |
#url ⇒ Object
187 |
# File 'lib/browserctl/workflow.rb', line 187 def url = @client.url(@name)[:url] |
#wait(sel, timeout: 30) ⇒ Object
184 |
# File 'lib/browserctl/workflow.rb', line 184 def wait(sel, timeout: 30) = unwrap @client.wait(@name, sel, timeout: timeout) |