Module: Saucer::Annotations

Included in:
Sauce
Defined in:
lib/saucer/annotations.rb

Instance Method Summary collapse

Instance Method Details

#breakpointObject



39
40
41
# File 'lib/saucer/annotations.rb', line 39

def breakpoint
  driver.execute_script("sauce: break")
end

#build_name=(name) ⇒ Object



27
28
29
# File 'lib/saucer/annotations.rb', line 27

def build_name=(name)
  driver.execute_script("sauce:job-build=#{name}")
end

#comment=(comment) ⇒ Object



4
5
6
# File 'lib/saucer/annotations.rb', line 4

def comment=(comment)
  driver.execute_script("sauce:context=#{comment}")
end

#job_info=(info) ⇒ Object

Raises:

  • (ArgumentError)


22
23
24
25
# File 'lib/saucer/annotations.rb', line 22

def job_info=(info)
  raise ArgumentError, "job info must be JSON" unless info.is_a? JSON
  driver.execute_script("sauce:job-info=#{info}")
end

#job_name=(name) ⇒ Object



13
14
15
# File 'lib/saucer/annotations.rb', line 13

def job_name=(name)
  driver.execute_script("sauce:job-name=#{name}")
end

#job_result=(result) ⇒ Object

Raises:

  • (ArgumentError)


8
9
10
11
# File 'lib/saucer/annotations.rb', line 8

def job_result=(result)
  raise ArgumentError, "invalid value for result" unless ['passed', 'failed', true, false].include?(result)
  driver.execute_script("sauce:job-result=#{result}")
end

#job_tags=(tags) ⇒ Object



17
18
19
20
# File 'lib/saucer/annotations.rb', line 17

def job_tags=(tags)
  tags = tags.join(',') if tags.is_a?(Array)
  driver.execute_script("sauce:job-tags=#{tags}")
end

#start_vmObject



35
36
37
# File 'lib/saucer/annotations.rb', line 35

def start_vm
  driver.execute_script("sauce: start network")
end

#stop_vmObject



31
32
33
# File 'lib/saucer/annotations.rb', line 31

def stop_vm
  driver.execute_script("sauce: stop network")
end