Updated test for range slider in time slider.

Instead of raw comparison against an HTML string to get style information,
now proper selenium function is used to get value of CSS property.
This commit is contained in:
Valera Rozuvan
2013-10-21 15:31:40 +03:00
parent 1941474a6c
commit 41cbd04d7c
2 changed files with 5 additions and 5 deletions

View File

@@ -86,4 +86,4 @@ Feature: CMS.Video Component
And I set value "24" to the field "End Time"
And I save changes
And I click button "Play"
Then I see a range on slider with styles "left" set to 10 and "width" set to 10
Then I see a range on slider with styles "left" set to 70 px and "width" set to 70 px

View File

@@ -203,14 +203,14 @@ def click_button(_step, button_type):
world.css_click(BUTTONS[button])
@step('I see a range on slider with styles "left" set to (.+) and "width" set to (.+)$')
@step('I see a range on slider with styles "left" set to (.+) px and "width" set to (.+) px$')
def see_a_range_slider_with_proper_range(_step, left, width):
left = int(left.strip())
width = int(width.strip())
world.wait_for_visible(".slider-range")
slider_range = world.css_find(".slider-range")[0]
slider_range = world.browser.driver.find_element_by_css_selector(".slider-range")
assert "left: {}%;".format(left) in slider_range.outer_html
assert "width: {}%;".format(width) in slider_range.outer_html
assert int(round(float(slider_range.value_of_css_property("left")[:-2]))) == left
assert int(round(float(slider_range.value_of_css_property("width")[:-2]))) == width