MDL-53564 behat: Fixed xpath to find social activity block
[moodle.git] / blocks / social_activities / tests / behat / edit_activities.feature
1 @block @block_social_activities
2 Feature: Edit activities in social activities block
3   In order to use social activities block
4   As a teacher
5   I need to add and edit activities there
7   @javascript
8   Scenario: Edit name of acitivity in-place in social activities block
9     Given the following "courses" exist:
10       | fullname | shortname | format |
11       | Course 1 | C1        | social |
12     And the following "users" exist:
13       | username | firstname | lastname |
14       | user1 | User | One |
15     And the following "course enrolments" exist:
16       | user | course | role |
17       | user1 | C1 | editingteacher |
18     Given I log in as "user1"
19     And I follow "Course 1"
20     And I turn editing mode on
21     And I set the field "Add an activity to section 'section 0'" to "Forum"
22     And I set the field "Forum name" to "My forum name"
23     And I press "Save and return to course"
24     And I click on "Edit title" "link" in the "//div[contains(@class,'block_social_activities')]//li[contains(.,'My forum name')]" "xpath_element"
25     And I set the field "New name for activity My forum name" to "New forum name"
26     And I press key "13" in the field "New name for activity My forum name"
27     Then I should not see "My forum name" in the "Social activities" "block"
28     And I should see "New forum name"
29     And I follow "New forum name"
30     And I should not see "My forum name"
31     And I should see "New forum name"