Class: AgentSandbox::BrowserTools::Wait

Inherits:
Base
  • Object
show all
Defined in:
lib/agent_sandbox/browser_tools.rb

Instance Method Summary collapse

Methods inherited from Base

#initialize, #run_ab

Constructor Details

This class inherits a constructor from AgentSandbox::BrowserTools::Base

Instance Method Details

#execute(milliseconds: nil, text: nil) ⇒ Object



185
186
187
188
189
190
191
192
193
# File 'lib/agent_sandbox/browser_tools.rb', line 185

def execute(milliseconds: nil, text: nil)
  if text
    run_ab(["wait", "--text", text, "--json"])
  elsif milliseconds
    run_ab(["wait", milliseconds.to_s, "--json"])
  else
    { error: "pass either milliseconds or text" }
  end
end