Top Level Namespace

Defined Under Namespace

Modules: Applitools

Constant Summary collapse

PROCESS_DEFAULT_BATCH_ID =

Unique per-process

SecureRandom.uuid

Instance Method Summary collapse

Instance Method Details

#after_feature(_scenario) ⇒ Object



42
# File 'lib/applitools/calabash/eyes_hooks.rb', line 42

def after_feature(_scenario) end

#before_feature(scenario) ⇒ Object



28
29
30
31
32
33
34
35
36
37
38
39
40
# 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) ⇒ Object



44
45
46
47
48
49
50
51
# 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