spec/watirspec/elements/elements_spec.rb in watir-6.9.1 vs spec/watirspec/elements/elements_spec.rb in watir-6.10.0

- old
+ new

@@ -31,6 +31,17 @@ expect(a).to_not eq b expect(a).to_not eql(b) end end + describe "visible text" do + it 'finds elements by visible text' do + browser.goto WatirSpec.url_for('non_control_elements.html') + expect(browser.links(visible_text: 'all visible').count).to eq(1) + expect(browser.links(visible_text: /all visible/).count).to eq(1) + expect(browser.links(visible_text: 'some visible').count).to eq(1) + expect(browser.links(visible_text: /some visible/).count).to eq(1) + expect(browser.links(visible_text: 'none visible').count).to eq(0) + expect(browser.links(visible_text: /none visible/).count).to eq(0) + end + end end