class Object

Public Instance Methods

after_feature(_scenario) click to toggle source
# File lib/applitools/calabash/eyes_hooks.rb, line 42
def after_feature(_scenario) end
before_feature(scenario) click to toggle source
# File lib/applitools/calabash/eyes_hooks.rb, line 28
def before_feature(scenario)
  @before_hook_scenario = scenario
  eyes_settings = Applitools::Calabash::EyesSettings.instance

  step %(eyes API key "#{@eyes_current_tags[:api_key] || ENV['APPLITOOLS_API_KEY']}") unless
    eyes_settings.applitools_api_key

  step %(eyes application name is "#{@eyes_current_tags[:app_name] || scenario.feature.name}")

  step %(set it up) if eyes_settings.needs_setting_up

  step %(create eyes)
end
get_scenario_tags(scenario) click to toggle source
# File lib/applitools/calabash/eyes_hooks.rb, line 44
def get_scenario_tags(scenario)
  @eyes_current_tags = {}
  eyes_tag_name_regexp = /@eyes_(?<tag_name>[a-z,A-Z, \_]+) \"(?<value>.*)\"/
  scenario.tags.each do |t|
    match_data = t.name.match eyes_tag_name_regexp
    @eyes_current_tags[match_data[:tag_name].to_sym] = match_data[:value] if match_data
  end
end