Commit 41cbd04d by Valera Rozuvan

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.
parent 1941474a
...@@ -86,4 +86,4 @@ Feature: CMS.Video Component ...@@ -86,4 +86,4 @@ Feature: CMS.Video Component
And I set value "24" to the field "End Time" And I set value "24" to the field "End Time"
And I save changes And I save changes
And I click button "Play" 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
...@@ -203,14 +203,14 @@ def click_button(_step, button_type): ...@@ -203,14 +203,14 @@ def click_button(_step, button_type):
world.css_click(BUTTONS[button]) 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): def see_a_range_slider_with_proper_range(_step, left, width):
left = int(left.strip()) left = int(left.strip())
width = int(width.strip()) width = int(width.strip())
world.wait_for_visible(".slider-range") 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 int(round(float(slider_range.value_of_css_property("left")[:-2]))) == left
assert "width: {}%;".format(width) in slider_range.outer_html assert int(round(float(slider_range.value_of_css_property("width")[:-2]))) == width
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment