
Untitled
By: a guest on
Aug 5th, 2012 | syntax:
None | size: 1.15 KB | hits: 10 | expires: Never
require 'selenium-webdriver'
class SVGPage
def initialize(driver, url)
driver.get url
@visual_hash = driver.visual_hash
end
def to_s
@visual_hash
end
end
TEST_PAGE = 'http://t/core/bts/interactive/CORE-26624/001-1.html'
REF_PAGE = 'http://t/core/bts/interactive/CORE-26624/001-2.html'
describe 'When disabling images' do
before :each do
@profile = Profile.new
end
context 'using profile #1' do
before :all do
@profile.preferences.set('foo', 'bar', 'baz', 0)
@driver = Selenium::WebDriver.for :opera, :profile => @profile
end
before :each do
@test = SVGPage.new(@driver, TEST_PAGE)
@ref = SVGPage.new(@driver, REF_PAGE)
end
it 'alt texts should be displayed on SVG images' do
@test.should match @ref
end
end
context 'using profile #2' do
before :all do
@profile.preferences.set('foo', 'bar', 'baz', 2)
@driver = Selenium::WebDriver.for :opera, :profile => @profile
end
before :each do
@test = SVGPage.new(@driver, TEST_PAGE)
@ref = SVGPage.new(@driver, REF_PAGE)
end
it 'alt text should match some other condition' do
@test.should match @ref
end
end
after :all do
@browser.quit
end
end