Class: Applitools::Base::TestResults
- Inherits:
-
Object
- Object
- Applitools::Base::TestResults
- Defined in:
- lib/applitools/base/test_results.rb
Instance Attribute Summary collapse
-
#is_new ⇒ Object
Returns the value of attribute is_new.
-
#matches ⇒ Object
readonly
Returns the value of attribute matches.
-
#mismatches ⇒ Object
readonly
Returns the value of attribute mismatches.
-
#missing ⇒ Object
readonly
Returns the value of attribute missing.
-
#steps ⇒ Object
readonly
Returns the value of attribute steps.
-
#url ⇒ Object
Returns the value of attribute url.
Instance Method Summary collapse
-
#initialize(results = {}) ⇒ TestResults
constructor
A new instance of TestResults.
- #passed? ⇒ Boolean (also: #is_passed)
- #to_s ⇒ Object
Constructor Details
#initialize(results = {}) ⇒ TestResults
Returns a new instance of TestResults.
6 7 8 9 10 11 12 13 |
# File 'lib/applitools/base/test_results.rb', line 6 def initialize(results = {}) @steps = results.fetch('steps', 0) @matches = results.fetch('matches', 0) @mismatches = results.fetch('mismatches', 0) @missing = results.fetch('missing', 0) @is_new = nil @url = nil end |
Instance Attribute Details
#is_new ⇒ Object
Returns the value of attribute is_new.
3 4 5 |
# File 'lib/applitools/base/test_results.rb', line 3 def is_new @is_new end |
#matches ⇒ Object (readonly)
Returns the value of attribute matches.
4 5 6 |
# File 'lib/applitools/base/test_results.rb', line 4 def matches @matches end |
#mismatches ⇒ Object (readonly)
Returns the value of attribute mismatches.
4 5 6 |
# File 'lib/applitools/base/test_results.rb', line 4 def mismatches @mismatches end |
#missing ⇒ Object (readonly)
Returns the value of attribute missing.
4 5 6 |
# File 'lib/applitools/base/test_results.rb', line 4 def missing @missing end |
#steps ⇒ Object (readonly)
Returns the value of attribute steps.
4 5 6 |
# File 'lib/applitools/base/test_results.rb', line 4 def steps @steps end |
#url ⇒ Object
Returns the value of attribute url.
3 4 5 |
# File 'lib/applitools/base/test_results.rb', line 3 def url @url end |
Instance Method Details
#passed? ⇒ Boolean Also known as: is_passed
15 16 17 |
# File 'lib/applitools/base/test_results.rb', line 15 def passed? !is_new && !(mismatches > 0) && !(missing > 0) end |
#to_s ⇒ Object
20 21 22 23 24 25 26 |
# File 'lib/applitools/base/test_results.rb', line 20 def to_s is_new_str = '' is_new_str = is_new ? 'New test' : 'Existing test' unless is_new.nil? "#{is_new_str} [ steps: #{steps}, matches: #{matches}, mismatches: #{mismatches}, missing: #{missing} ], "\ "URL: #{url}" end |