spec/watirspec/elements/element_spec.rb in watir-6.15.0 vs spec/watirspec/elements/element_spec.rb in watir-6.15.1
- old
+ new
@@ -98,11 +98,11 @@
expect(browser.element(visible_text: /Link 2/, class: 'external')).to exist
end
it 'raises exception unless value is a String or a RegExp' do
browser.goto WatirSpec.url_for('non_control_elements.html')
- msg = /expected string_or_regexp, got 7\:(Fixnum|Integer)/
+ msg = /expected one of \[String, Regexp\], got 7\:(Fixnum|Integer)/
expect { browser.element(visible_text: 7).exists? }.to raise_exception(TypeError, msg)
end
it 'raises exception unless key is valid' do
browser.goto WatirSpec.url_for('non_control_elements.html')
@@ -463,23 +463,11 @@
it "doesn't raise when selector has with :xpath has :index" do
expect(browser.div(xpath: '//div', index: 1)).to exist
end
- it 'raises LocatorException error if selector hash with :xpath has multiple entries' do
- msg = 'xpath cannot be combined with all of these locators ({:class=>"foo", :tag_name=>"div"})'
- expect { browser.div(xpath: '//div', class: 'foo').exists? }
- .to raise_exception Watir::Exception::LocatorException, msg
- end
-
it "doesn't raise when selector has with :css has :index" do
expect(browser.div(css: 'div', index: 1)).to exist
- end
-
- it 'raises LocatorException error if selector hash with :css has multiple entries' do
- msg = 'css cannot be combined with all of these locators ({:class=>"foo", :tag_name=>"div"})'
- expect { browser.div(css: 'div', class: 'foo').exists? }
- .to raise_exception Watir::Exception::LocatorException, msg
end
it 'finds element by Selenium name locator' do
expect(browser.element(name: 'new_user_first_name')).to exist
expect(browser.element(name: /new_user_first_name/)).to exist