From 69ee9211b437316f0114e3f98e2511f6caf9f9ee Mon Sep 17 00:00:00 2001 From: Titus Fortner Date: Wed, 5 Jun 2019 12:07:18 -0700 Subject: [PATCH] [rb] allow running webdriver specs via IntelliJ without errors from pending --- .../integration/selenium/webdriver/remote/element_spec.rb | 6 ++++-- rb/spec/integration/selenium/webdriver/spec_helper.rb | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/rb/spec/integration/selenium/webdriver/remote/element_spec.rb b/rb/spec/integration/selenium/webdriver/remote/element_spec.rb index e1f3bee71aeff..c838d9c3d9880 100644 --- a/rb/spec/integration/selenium/webdriver/remote/element_spec.rb +++ b/rb/spec/integration/selenium/webdriver/remote/element_spec.rb @@ -22,9 +22,11 @@ module Selenium module WebDriver describe Element, only: {driver: :remote} do - around do |example| + before do driver.file_detector = ->(filename) { File.join(__dir__, filename) } - example.run + end + + after do driver.file_detector = nil end diff --git a/rb/spec/integration/selenium/webdriver/spec_helper.rb b/rb/spec/integration/selenium/webdriver/spec_helper.rb index 1c0f4ec5ca912..1f6f213668086 100644 --- a/rb/spec/integration/selenium/webdriver/spec_helper.rb +++ b/rb/spec/integration/selenium/webdriver/spec_helper.rb @@ -48,7 +48,7 @@ if guards.exclude.any? skip 'Bug Prevents Execution.' elsif guards.except.satisfied.any? || guards.only.unsatisfied.any? - pending 'Guarded.' + ENV['SKIP_PENDING'] ? skip('Skip Guarded Spec') : pending('Guarded.') end end