From d06e06b9cfa2e522ff538ccdd2b843434640222a Mon Sep 17 00:00:00 2001 From: Titus Fortner Date: Sun, 16 Dec 2018 14:41:00 -0500 Subject: [PATCH] tidy up spec guards --- spec/watirspec/alert_spec.rb | 2 +- spec/watirspec/relaxed_locate_spec.rb | 2 +- spec/watirspec_helper.rb | 12 ++++++------ 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/spec/watirspec/alert_spec.rb b/spec/watirspec/alert_spec.rb index 8c1975981..c51c9ae55 100644 --- a/spec/watirspec/alert_spec.rb +++ b/spec/watirspec/alert_spec.rb @@ -10,7 +10,7 @@ browser.alert.ok if browser.alert.exists? end - not_compliant_on :not_relaxed_locate do + compliant_on :relaxed_locate do context 'Relaxed Waits' do context 'when acting on an alert' do it 'raises exception after timing out' do diff --git a/spec/watirspec/relaxed_locate_spec.rb b/spec/watirspec/relaxed_locate_spec.rb index dbc93d48d..e4100352c 100644 --- a/spec/watirspec/relaxed_locate_spec.rb +++ b/spec/watirspec/relaxed_locate_spec.rb @@ -1,7 +1,7 @@ require 'watirspec_helper' describe 'Watir#relaxed_locate?' do - not_compliant_on :not_relaxed_locate do + compliant_on :relaxed_locate do context 'when true' do before :each do browser.goto(WatirSpec.url_for('wait.html')) diff --git a/spec/watirspec_helper.rb b/spec/watirspec_helper.rb index ab66e8b30..92350ddfd 100644 --- a/spec/watirspec_helper.rb +++ b/spec/watirspec_helper.rb @@ -82,15 +82,15 @@ def add_guards end def common_guards - matching_guards = [:webdriver] - - matching_guards << browser + matching_guards = [browser] matching_guards << [browser, Selenium::WebDriver::Platform.os] matching_guards << :relaxed_locate if Watir.relaxed_locate? - matching_guards << :not_relaxed_locate unless Watir.relaxed_locate? matching_guards << :headless if @imp.browser_args.last[:headless] - matching_guards << :appveyor if ENV['APPVEYOR'] - matching_guards << [browser, :appveyor] if ENV['APPVEYOR'] + # TODO: Replace this with Selenium::WebDriver::Platform.ci after next Selenium Release + if ENV['APPVEYOR'] + matching_guards << :appveyor + matching_guards << [browser, :appveyor] + end if !Selenium::WebDriver::Platform.linux? || ENV['DESKTOP_SESSION'] # some specs (i.e. Window#maximize) needs a window manager on linux