Class: Applitools::Calabash::EyesSettings
- Inherits:
-
Object
- Object
- Applitools::Calabash::EyesSettings
- Includes:
- Singleton
- Defined in:
- lib/applitools/calabash/eyes_settings.rb
Instance Attribute Summary collapse
-
#app_name ⇒ Object
Returns the value of attribute app_name.
-
#applitools_api_key ⇒ Object
Returns the value of attribute applitools_api_key.
-
#eyes ⇒ Object
Returns the value of attribute eyes.
-
#log_dir ⇒ Object
Returns the value of attribute log_dir.
-
#log_file ⇒ Object
Returns the value of attribute log_file.
-
#needs_setting_up ⇒ Object
Returns the value of attribute needs_setting_up.
-
#screenshot_dir ⇒ Object
Returns the value of attribute screenshot_dir.
-
#test_name ⇒ Object
Returns the value of attribute test_name.
-
#tmp_dir ⇒ Object
Returns the value of attribute tmp_dir.
-
#viewport_size ⇒ Object
Returns the value of attribute viewport_size.
Instance Method Summary collapse
-
#initialize ⇒ EyesSettings
constructor
A new instance of EyesSettings.
- #log_prefix ⇒ Object
- #options_for_open ⇒ Object
- #screenshot_names ⇒ Object
- #screenshot_prefix ⇒ Object
Constructor Details
#initialize ⇒ EyesSettings
Returns a new instance of EyesSettings.
14 15 16 17 18 19 20 |
# File 'lib/applitools/calabash/eyes_settings.rb', line 14 def initialize @tmp_dir = 'tmp' @screenshot_dir = 'screenshots' @log_dir = 'logs' @log_file = 'applitools.log' @needs_setting_up = true end |
Instance Attribute Details
#app_name ⇒ Object
Returns the value of attribute app_name.
8 9 10 |
# File 'lib/applitools/calabash/eyes_settings.rb', line 8 def app_name @app_name end |
#applitools_api_key ⇒ Object
Returns the value of attribute applitools_api_key.
8 9 10 |
# File 'lib/applitools/calabash/eyes_settings.rb', line 8 def applitools_api_key @applitools_api_key end |
#eyes ⇒ Object
Returns the value of attribute eyes.
8 9 10 |
# File 'lib/applitools/calabash/eyes_settings.rb', line 8 def eyes @eyes end |
#log_dir ⇒ Object
Returns the value of attribute log_dir.
9 10 11 |
# File 'lib/applitools/calabash/eyes_settings.rb', line 9 def log_dir @log_dir end |
#log_file ⇒ Object
Returns the value of attribute log_file.
9 10 11 |
# File 'lib/applitools/calabash/eyes_settings.rb', line 9 def log_file @log_file end |
#needs_setting_up ⇒ Object
Returns the value of attribute needs_setting_up.
10 11 12 |
# File 'lib/applitools/calabash/eyes_settings.rb', line 10 def needs_setting_up @needs_setting_up end |
#screenshot_dir ⇒ Object
Returns the value of attribute screenshot_dir.
9 10 11 |
# File 'lib/applitools/calabash/eyes_settings.rb', line 9 def screenshot_dir @screenshot_dir end |
#test_name ⇒ Object
Returns the value of attribute test_name.
8 9 10 |
# File 'lib/applitools/calabash/eyes_settings.rb', line 8 def test_name @test_name end |
#tmp_dir ⇒ Object
Returns the value of attribute tmp_dir.
9 10 11 |
# File 'lib/applitools/calabash/eyes_settings.rb', line 9 def tmp_dir @tmp_dir end |
#viewport_size ⇒ Object
Returns the value of attribute viewport_size.
8 9 10 |
# File 'lib/applitools/calabash/eyes_settings.rb', line 8 def @viewport_size end |
Instance Method Details
#log_prefix ⇒ Object
32 33 34 |
# File 'lib/applitools/calabash/eyes_settings.rb', line 32 def log_prefix File.join(Dir.getwd, log_dir) end |
#options_for_open ⇒ Object
22 23 24 25 26 |
# File 'lib/applitools/calabash/eyes_settings.rb', line 22 def result = { app_name: app_name, test_name: test_name } return result unless result.merge!(viewport_size: ) end |
#screenshot_names ⇒ Object
36 37 38 39 40 41 42 |
# File 'lib/applitools/calabash/eyes_settings.rb', line 36 def screenshot_names @names ||= Enumerator.new do |y| loop do y << { prefix: screenshot_prefix, name: "#{SecureRandom.uuid}.png" } end end end |
#screenshot_prefix ⇒ Object
28 29 30 |
# File 'lib/applitools/calabash/eyes_settings.rb', line 28 def screenshot_prefix File.join(Dir.getwd, tmp_dir, screenshot_dir, '') end |