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.
121 122 123 124 |
# File 'lib/browserctl/workflow.rb', line 121 def initialize(name, client) @name = name @client = client end |
Instance Method Details
#click(sel) ⇒ Object
128 |
# File 'lib/browserctl/workflow.rb', line 128 def click(sel) = unwrap @client.click(@name, sel) |
#delete_cookies ⇒ Object
132 |
# File 'lib/browserctl/workflow.rb', line 132 def = unwrap @client.(@name) |
#devtools ⇒ Object
133 |
# File 'lib/browserctl/workflow.rb', line 133 def devtools = @client.devtools(@name)[:devtools_url] |
#dialog_accept(text: nil) ⇒ Object
149 |
# File 'lib/browserctl/workflow.rb', line 149 def dialog_accept(text: nil) = unwrap @client.dialog_accept(@name, text: text) |
#dialog_dismiss ⇒ Object
150 |
# File 'lib/browserctl/workflow.rb', line 150 def dialog_dismiss = unwrap @client.dialog_dismiss(@name) |
#evaluate(expr) ⇒ Object
135 |
# File 'lib/browserctl/workflow.rb', line 135 def evaluate(expr) = @client.evaluate(@name, expr)[:result] |
#fill(sel, val) ⇒ Object
127 |
# File 'lib/browserctl/workflow.rb', line 127 def fill(sel, val) = unwrap @client.fill(@name, sel, val) |
#hover(selector) ⇒ Object
146 |
# File 'lib/browserctl/workflow.rb', line 146 def hover(selector) = unwrap @client.hover(@name, selector) |
#navigate(url) ⇒ Object
126 |
# File 'lib/browserctl/workflow.rb', line 126 def navigate(url) = unwrap @client.navigate(@name, url) |
#press(key) ⇒ Object
145 |
# File 'lib/browserctl/workflow.rb', line 145 def press(key) = unwrap @client.press(@name, key) |
#screenshot ⇒ Object
130 |
# File 'lib/browserctl/workflow.rb', line 130 def screenshot(**) = unwrap @client.screenshot(@name, **) |
#select(selector, value) ⇒ Object
148 |
# File 'lib/browserctl/workflow.rb', line 148 def select(selector, value) = unwrap @client.select(@name, selector, value) |
#snapshot ⇒ Object
129 |
# File 'lib/browserctl/workflow.rb', line 129 def snapshot(**) = unwrap @client.snapshot(@name, **) |
#storage_get(key, store: "local") ⇒ Object
137 138 139 |
# File 'lib/browserctl/workflow.rb', line 137 def storage_get(key, store: "local") @client.storage_get(@name, key, store: store)[:value] end |
#storage_set(key, value, store: "local") ⇒ Object
141 142 143 |
# File 'lib/browserctl/workflow.rb', line 141 def storage_set(key, value, store: "local") unwrap @client.storage_set(@name, key, value, store: store) end |
#upload(selector, path) ⇒ Object
147 |
# File 'lib/browserctl/workflow.rb', line 147 def upload(selector, path) = unwrap @client.upload(@name, selector, path) |
#url ⇒ Object
134 |
# File 'lib/browserctl/workflow.rb', line 134 def url = @client.url(@name)[:url] |
#wait(sel, timeout: 30) ⇒ Object
131 |
# File 'lib/browserctl/workflow.rb', line 131 def wait(sel, timeout: 30) = unwrap @client.wait(@name, sel, timeout: timeout) |