spec/watirspec/elements/element_spec.rb in watir-6.16.0 vs spec/watirspec/elements/element_spec.rb in watir-6.16.1

- old
+ new

@@ -38,15 +38,17 @@ expect(element).to be_stale expect { element.text }.to_not raise_error end - it 'relocates stale element when taking an action on it' do - browser.goto(WatirSpec.url_for('forms_with_input_elements.html')) - element = browser.text_field(id: 'new_user_first_name').locate - browser.refresh - expect { element.click }.not_to raise_exception + compliant_on :relaxed_locate do + it 'relocates stale element when taking an action on it' do + browser.goto(WatirSpec.url_for('forms_with_input_elements.html')) + element = browser.text_field(id: 'new_user_first_name').locate + browser.refresh + expect { element.click }.not_to raise_exception + end end end describe '#eq and #eql?' do before { browser.goto WatirSpec.url_for('definition_lists.html') } @@ -291,11 +293,13 @@ wd = browser.div.wd element = Watir::Element.new(browser, id: 'not_valid') element.cache = wd browser.refresh - expect(element).to_not exist + expect { + expect(element).to_not exist + }.to have_deprecated_stale_exists end end describe '#exists?' do before do @@ -919,13 +923,15 @@ compliant_on :chrome do expect { btn.click }.to raise_exception(Selenium::WebDriver::Error::UnknownError) end end - it 'returns false if element\'s center is surrounded by non-descendants' do - btn = browser.button(id: 'surrounded') - expect(btn).not_to be_obscured - expect { btn.click }.not_to raise_exception + not_compliant_on %i[firefox appveyor] do + it 'returns false if element\'s center is surrounded by non-descendants' do + btn = browser.button(id: 'surrounded') + expect(btn).not_to be_obscured + expect { btn.click }.not_to raise_exception + end end it 'scrolls interactive element into view before checking if obscured' do btn = browser.button(id: 'requires_scrolling') expect(btn).not_to be_obscured