Class: Hercules::Maestro::Browser

Inherits:
Object
  • Object
show all
Defined in:
lib/uptime_monitor/maestro_broswer.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(url, browser_name = "firefox", is_headless = false) ⇒ Browser

Returns a new instance of Browser.



7
8
9
10
# File 'lib/uptime_monitor/maestro_broswer.rb', line 7

def initialize(url, browser_name = "firefox", is_headless = false)
  @parser = Hercules::UptimeMonitor::MaestroLangParser.new
  @browser = Hercules::UptimeMonitor::Browser.new(url, browser_name, is_headless)
end

Instance Attribute Details

#browserObject (readonly)

Returns the value of attribute browser.



4
5
6
# File 'lib/uptime_monitor/maestro_broswer.rb', line 4

def browser
  @browser
end

#parserObject (readonly)

Returns the value of attribute parser.



5
6
7
# File 'lib/uptime_monitor/maestro_broswer.rb', line 5

def parser
  @parser
end

#s_exprObject (readonly)

Returns the value of attribute s_expr.



6
7
8
# File 'lib/uptime_monitor/maestro_broswer.rb', line 6

def s_expr
  @s_expr
end

Instance Method Details

#closeObject



15
16
17
# File 'lib/uptime_monitor/maestro_broswer.rb', line 15

def close
  @browser.close
end

#exists?(script) ⇒ Boolean

Returns:

  • (Boolean)


11
12
13
14
# File 'lib/uptime_monitor/maestro_broswer.rb', line 11

def exists?(script)
  @s_expr = @parser.parse(script).first
  @browser.exists? @s_expr
end