diff --git a/rb/spec/integration/selenium/webdriver/spec_helper.rb b/rb/spec/integration/selenium/webdriver/spec_helper.rb index af528d8b747e3..8b10990b5ced2 100644 --- a/rb/spec/integration/selenium/webdriver/spec_helper.rb +++ b/rb/spec/integration/selenium/webdriver/spec_helper.rb @@ -43,7 +43,9 @@ c.before do |example| guards = WebDriver::SpecSupport::Guards.new(example) - if guards.except.satisfied.any? || guards.only.unsatisfied.any? + if guards.exclude.any? + skip 'Bug Prevents Execution.' + elsif guards.except.satisfied.any? || guards.only.unsatisfied.any? pending 'Guarded.' end end diff --git a/rb/spec/integration/selenium/webdriver/spec_support/guards.rb b/rb/spec/integration/selenium/webdriver/spec_support/guards.rb index 1859d1f9dd276..78894dda57fbb 100644 --- a/rb/spec/integration/selenium/webdriver/spec_support/guards.rb +++ b/rb/spec/integration/selenium/webdriver/spec_support/guards.rb @@ -21,7 +21,7 @@ module SpecSupport class Guards include Enumerable - GUARD_TYPES = %i[except only].freeze + GUARD_TYPES = %i[except only exclude].freeze def initialize(example, guards = nil) @example = example @@ -40,6 +40,10 @@ def only self.class.new(@example, @guards.select(&:only?)) end + def exclude + self.class.new(@example, @guards.select(&:exclude?)).satisfied + end + def satisfied self.class.new(@example, @guards.select(&:satisfied?)) end diff --git a/rb/spec/integration/selenium/webdriver/spec_support/guards/guard.rb b/rb/spec/integration/selenium/webdriver/spec_support/guards/guard.rb index 4f8320b1276e3..e3f34fe79400c 100644 --- a/rb/spec/integration/selenium/webdriver/spec_support/guards/guard.rb +++ b/rb/spec/integration/selenium/webdriver/spec_support/guards/guard.rb @@ -41,6 +41,10 @@ def only? @type == :only end + def exclude? + @type == :exclude + end + def satisfied? satisfies_driver? && satisfies_browser? && satisfies_platform? && satisfies_window_manager? end