class Selenium::WebDriver::Support::Guards::Guard
Guard
derived from RSpec example metadata. @api private
Attributes
Public Class Methods
Source
# File lib/selenium/webdriver/support/guards/guard.rb, line 32 def initialize(guarded, type, guards = nil) @guarded = guarded @tracker = guards&.bug_tracker || '' @messages = guards&.messages || {} @messages[:unknown] = 'TODO: Investigate why this is failing and file a bug report' @type = type @reason = @guarded[:reason] || 'No reason given' @guarded[:reason] = @reason end
Public Instance Methods
Source
# File lib/selenium/webdriver/support/guards/guard.rb, line 66 def except? @type == :except end
Bug is present on all configurations specified
Source
# File lib/selenium/webdriver/support/guards/guard.rb, line 77 def exclude? @type == :exclude || @type == :flaky end
Bug is present on all configurations specified, but test can not be run because it breaks other tests, or it is flaky and unreliable
Source
# File lib/selenium/webdriver/support/guards/guard.rb, line 82 def exclusive? @type == :exclusive end
Test only applies to configurations specified
Source
# File lib/selenium/webdriver/support/guards/guard.rb, line 43 def message details = case reason when Integer "Bug Filed: #{tracker}/#{reason}" when Symbol messages[reason] else "Guarded by #{guarded};" end case type when :exclude "Test skipped because it breaks test run; #{details}" when :flaky "Test skipped because it is unreliable in this configuration; #{details}" when :exclusive "Test does not apply to this configuration; #{details}" else "Test guarded; #{details}" end end
Source
# File lib/selenium/webdriver/support/guards/guard.rb, line 71 def only? @type == :only end
Bug is present on all configurations not specified