Make ordinal in duplication statement friendlier.
This commit is contained in:
@@ -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))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user