Module: Applitools::UniversalEyesOpen
- Included in:
- EyesBase
- Defined in:
- lib/applitools/core/universal_eyes_open.rb
Instance Method Summary collapse
-
#universal_open(options = {}) ⇒ Applitools::Selenium::Driver
Starts a test.
- #universal_sdk_abort ⇒ Object
Instance Method Details
#universal_open(options = {}) ⇒ Applitools::Selenium::Driver
Starts a test
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 |
# File 'lib/applitools/core/universal_eyes_open.rb', line 19 def universal_open( = {}) original_driver = .delete(:driver) if self.class.name != 'Applitools::Images::Eyes' Applitools::ArgumentGuard.not_nil original_driver, 'options[:driver]' if respond_to?(:disabled?) && disabled? logger.info('Ignored') return original_driver end self.driver = Applitools::Selenium::SeleniumEyes.eyes_driver(original_driver, self) end () universal_driver_config = driver.universal_driver_config if self.class.name != 'Applitools::Images::Eyes' universal_eyes_manager = runner.get_universal_eyes_manager(self) universal_eyes_config = Applitools::UniversalEyesConfig.new universal_eyes_config.from_original_sdk(self) # require('pry') # binding.pry @universal_eyes = universal_eyes_manager.open_eyes(universal_driver_config, universal_eyes_config.to_hash) raise Applitools::EyesNotOpenException.new('Eyes not open!') if @universal_eyes.nil? self.open = true if respond_to?(:open=, true) self.opened = true if respond_to?(:opened=, true) self.running_session = true if respond_to?(:running_session=, true) if self.class.name != 'Applitools::Images::Eyes' driver else self.open? end rescue Applitools::EyesError => e logger.error e. raise e end |
#universal_sdk_abort ⇒ Object
58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 |
# File 'lib/applitools/core/universal_eyes_open.rb', line 58 def universal_sdk_abort if respond_to?(:disabled?) && disabled? logger.info "#{__method__} Ignore disabled" return false end # raise Applitools::EyesNotOpenException.new('Eyes not open!') if @eyes.nil? return if @universal_eyes.nil? closed_or_aborted = @universal_eyes.closed_or_aborted @universal_eyes.abort result = @universal_eyes.eyes_get_results result = result[0] if result.is_a?(Array) if result.is_a? Hash logger.info "---Test aborted" if !result[:message] && !result[:stack] else # TestCheckFrameInFrame_Fully_Fluent_VG\ # require('pry') # binding.pry end return nil if closed_or_aborted Applitools::Utils.deep_stringify_keys(result) end |