Method: Capybara::Node::Matchers#assert_matches_style
- Defined in:
- lib/capybara/node/matchers.rb
#assert_matches_style(styles = nil, **options) ⇒ Object
Asserts that an element has the specified CSS styles.
element.assert_matches_style( 'color' => 'rgb(0,0,255)', 'font-size' => /px/ )
126 127 128 129 130 131 132 133 134 |
# File 'lib/capybara/node/matchers.rb', line 126 def assert_matches_style(styles = nil, **) styles, = , {} if styles.nil? query_args, query_opts = (styles, ) query = Capybara::Queries::StyleQuery.new(*query_args, **query_opts) synchronize(query.wait) do raise Capybara::ExpectationNotMet, query. unless query.resolves_for?(self) end true end |