Class: Janus::Command::Record

Inherits:
Object
  • Object
show all
Defined in:
lib/janus/command/record.rb

Instance Method Summary collapse

Constructor Details

#initialize(configuration) ⇒ Record

Returns a new instance of Record.



6
7
8
# File 'lib/janus/command/record.rb', line 6

def initialize(configuration)
  @configuration = configuration
end

Instance Method Details

#executeObject



10
11
12
13
14
# File 'lib/janus/command/record.rb', line 10

def execute
  @configuration.tests.each do |test|
    record_screenshot(test)
  end
end

#record_screenshot(test) ⇒ Object



16
17
18
19
# File 'lib/janus/command/record.rb', line 16

def record_screenshot(test)
  screenshot = Janus::Screenshot.capture(test, username: @configuration.username, access_key: @configuration.access_key)
  screenshot.save('output')
end