[QA] checking width in %

Amir E. Aharoni amir.aharoni at mail.huji.ac.il
Tue Jan 14 19:59:10 UTC 2014


Hi,

In the new ContentTranslation extension we have a progress bar, which is
updated using the CSS width property. I wanted to test that it has the
correct value, so I used something like
progress_bar_element.style("width").should == expected_width

Surprisingly, this didn't work: It seems to return the computed value in
px, rather than the specified CSS value in %.

For now I did this like this:
on(ContentTranslationPage).progress_bar_element.attribute("style").should
match(/width: #{width};/)

(See
https://gerrit.wikimedia.org/r/#/c/107357/4/tests/browser/features/step_definitions/special_content_translation_steps.rb)

Something tells me that there should be a better way. Can anybody think of
anything?

Thanks!

--
Amir Elisha Aharoni · אָמִיר אֱלִישָׁע אַהֲרוֹנִי
http://aharoni.wordpress.com
‪“We're living in pieces,
I want to live in peace.” – T. Moore‬
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.wikimedia.org/pipermail/qa/attachments/20140114/0d3097d6/attachment.html>


More information about the QA mailing list