diff --git a/cms/djangoapps/contentstore/features/component.feature b/cms/djangoapps/contentstore/features/component.feature index 0d515973b0..5df49e59fd 100644 --- a/cms/djangoapps/contentstore/features/component.feature +++ b/cms/djangoapps/contentstore/features/component.feature @@ -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" diff --git a/cms/djangoapps/contentstore/features/component.py b/cms/djangoapps/contentstore/features/component.py index b0bcc9a1c0..cfe4053b2f 100644 --- a/cms/djangoapps/contentstore/features/component.py +++ b/cms/djangoapps/contentstore/features/component.py @@ -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))