Commit 3eb00186 by cahrens

Make ordinal in duplication statement friendlier.

parent a1cb0a12
......@@ -106,7 +106,7 @@ Feature: CMS.Component Adding
Given I am in Studio editing a new unit
And I add a "Blank Common Problem" "Problem" component
And I add a "Multiple Choice" "Problem" component
And I duplicate the "0" component
And I duplicate the first component
Then I see a Problem component with display name "Duplicate of 'Blank Common Problem'" in position "1"
And I reload the page
Then I see a Problem component with display name "Blank Common Problem" in position "0"
......
......@@ -134,8 +134,14 @@ def edit_and_save_component(step):
world.css_click('.save-button')
@step(u'I duplicate the "([^"]*)" component$')
def duplicated_component(step, index):
@step(u'I duplicate the (first|second|third) component$')
def duplicated_component(step, ordinal):
ord_map = {
"first": 0,
"second": 1,
"third": 2,
}
index = ord_map[ordinal]
duplicate_btn_css = 'a.duplicate-button'
world.css_click(duplicate_btn_css, int(index))
......
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