Created
November 19, 2012 13:03
-
-
Save libo/4110529 to your computer and use it in GitHub Desktop.
Evaluation with selector
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def evaluate_css(property, selector = 'body') | |
page.evaluate_script("(typeof jQuery !== 'undefined') && $('#{selector}').css('#{property}')") | |
end | |
def expect_css(property, values) | |
values.each do |selector, value| | |
begin | |
wait_until { evaluate_css(property, selector) == value} | |
rescue Capybara::TimeoutError | |
evaluate_css(property, selector).should == value | |
end | |
end | |
end |
You are calling evaluate_css(selector, property) inverted?
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Won't work. You want to have
So you need to do