Sha256: 2f8538833e07bac9cbda27dc2fbb10a7fb6743e921970c25cd8d0f019a3a8c13

Contents?: true

Size: 727 Bytes

Versions: 11

Compression:

Stored size: 727 Bytes

Contents

# frozen_string_literal: true

require_relative 'common/common'
require_relative 'lib/app_percy'
require_relative 'lib/percy_automate'
require_relative 'lib/cli_wrapper'
require_relative 'environment'

def percy_screenshot(driver, name, **kwargs)
  return nil unless Percy::CLIWrapper.percy_enabled?

  app_percy = nil
  provider_class = Percy::Environment.session_type == 'automate' ? Percy::PercyOnAutomate : Percy::AppPercy
  app_percy = provider_class.new(driver)
  app_percy.screenshot(name, **kwargs)
rescue StandardError => e
  Percy::CLIWrapper.post_failed_event(e.to_s)
  log("Could not take screenshot \"#{name}\"")
  raise e if app_percy && !app_percy.percy_options.ignore_errors

  log(e, on_debug: true)
  nil
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
percy-appium-app-1.0.0 percy/percy-appium-app.rb
percy-appium-app-0.0.8 percy/percy-appium-app.rb
percy-appium-app-0.0.7 percy/percy-appium-app.rb
percy-appium-app-0.0.6 percy/percy-appium-app.rb
percy-appium-app-0.0.5 percy/percy-appium-app.rb
percy-appium-app-0.0.5.pre.beta.1 percy/percy-appium-app.rb
percy-appium-app-0.0.5.pre.beta.0 percy/percy-appium-app.rb
percy-appium-app-0.0.4 percy/percy-appium-app.rb
percy-appium-app-0.0.2.pre.beta.0 percy/percy-appium-app.rb
percy-appium-app-0.0.3 percy/percy-appium-app.rb
percy-appium-app-0.0.2 percy/percy-appium-app.rb