spec/watirspec/elements/element_spec.rb in watir-6.17.0 vs spec/watirspec/elements/element_spec.rb in watir-6.18.0
- old
+ new
@@ -707,30 +707,35 @@
end
describe '#size' do
it 'returns size of element' do
size = browser.button(name: 'new_user_image').size
-
expect(size).to be_a Selenium::WebDriver::Dimension
- expect(size['width']).to eq 104.0
- expect(size['height']).to eq 70.0
+
+ expected_width = browser.name == :safari ? 105 : 104
+ expected_height = browser.name == :safari ? 71 : 70
+
+ expect(size['width']).to eq expected_width
+ expect(size['height']).to eq expected_height
end
end
describe '#height' do
it 'returns height of element' do
height = browser.button(name: 'new_user_image').height
- expect(height).to eq 70.0
+ expected_height = browser.name == :safari ? 71 : 70
+ expect(height).to eq expected_height
end
end
describe '#width' do
it 'returns width of element' do
width = browser.button(name: 'new_user_image').width
- expect(width).to eq 104.0
+ expected_width = browser.name == :safari ? 105 : 104
+ expect(width).to eq expected_width
end
end
describe '#center' do
it 'returns center of element' do
@@ -903,15 +908,13 @@
compliant_on :safari do
expect { btn.click }.to raise_exception(Selenium::WebDriver::Error::WebDriverError)
end
end
- not_compliant_on %i[firefox appveyor] do
- it 'returns false if element 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
+ it 'returns false if element 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
it 'scrolls interactive element into view before checking if obscured' do
btn = browser.button(id: 'requires_scrolling')
expect(btn).not_to be_obscured