spec/watirspec/elements/elements_spec.rb in watir-6.16.5 vs spec/watirspec/elements/elements_spec.rb in watir-6.17.0

- old
+ new

@@ -35,14 +35,23 @@ describe 'visible text' do it 'finds elements by visible text' do browser.goto WatirSpec.url_for('non_control_elements.html') container = browser.div(id: 'visible_text') + expect(container.elements(visible_text: 'all visible').count).to eq(1) expect(container.elements(visible_text: /all visible/).count).to eq(1) - expect(container.elements(visible_text: 'some visible').count).to eq(1) expect(container.elements(visible_text: /some visible/).count).to eq(1) - expect(container.elements(visible_text: 'none visible').count).to eq(0) - expect(container.elements(visible_text: /none visible/).count).to eq(0) + end + + bug 'Safari is not filtering out hidden text', :safari do + it 'finds elements in spite of hidden text' do + browser.goto WatirSpec.url_for('non_control_elements.html') + container = browser.div(id: 'visible_text') + + expect(container.elements(visible_text: 'some visible').count).to eq(1) + expect(container.elements(visible_text: 'none visible').count).to eq(0) + expect(container.elements(visible_text: /none visible/).count).to eq(0) + end end end end