[ Index ]

PHP Cross Reference of Unnamed Project

title

Body

[close]

/tag/tests/behat/ -> edit_tag.feature (source)

   1  @core @core_tag
   2  Feature: Users can edit tags to add description or rename
   3    In order to use tags
   4    As a manager
   5    I need to be able to edit tags
   6  
   7    Background:
   8      Given the following "users" exist:
   9        | username | firstname | lastname | email                | interests         |
  10        | manager1 | Manager   | 1        | manager1@example.com |                   |
  11        | user1    | User      | 1        | user1@example.com    | Cat,Dog,Turtle    |
  12        | editor1  | Editor    | 1        | editor1@example.com  |                   |
  13      Given the following "roles" exist:
  14        | name       | shortname |
  15        | Tag editor | tageditor |
  16      And the following "system role assigns" exist:
  17        | user     | course               | role      |
  18        | manager1 | Acceptance test site | manager   |
  19        | editor1  | Acceptance test site | tageditor |
  20      And the following "tags" exist:
  21        | name         | isstandard |
  22        | Neverusedtag | 1          |
  23  
  24    @javascript
  25    Scenario: User with tag editing capability can change tag description
  26      Given I log in as "admin"
  27      And I set the following system permissions of "Tag editor" role:
  28        | capability                   | permission |
  29        | moodle/tag:edit              | Allow      |
  30        | moodle/site:viewparticipants | Allow      |
  31        | moodle/user:viewdetails      | Allow      |
  32      And I log out
  33      When I log in as "editor1"
  34      And I navigate to "Participants" node in "Site pages"
  35      And I follow "User 1"
  36      And I follow "Cat"
  37      And I follow "Edit this tag"
  38      And I should not see "Tag name"
  39      And I should not see "Standard"
  40      And I set the following fields to these values:
  41        | Description | Description of tag 1 |
  42        | Related tags | Dog,  Turtle,Fish |
  43      And I press "Update"
  44      Then "Cat" "text" should exist in the ".breadcrumb-nav" "css_element"
  45      And "Description of tag 1" "text" should exist in the ".tag-description" "css_element"
  46      And I should see "Related tags:" in the ".tag_list" "css_element"
  47      And I should see "Dog" in the ".tag_list" "css_element"
  48      And I should see "Turtle" in the ".tag_list" "css_element"
  49      And I should see "Fish" in the ".tag_list" "css_element"
  50      And I log out
  51  
  52    @javascript
  53    Scenario: Manager can change tag description, related tags and rename the tag from tag view page
  54      When I log in as "manager1"
  55      And I navigate to "Participants" node in "Site pages"
  56      And I follow "User 1"
  57      And I follow "Cat"
  58      And I follow "Edit this tag"
  59      And I set the following fields to these values:
  60        | Tag name | Kitten |
  61        | Description | Description of tag 1 |
  62        | Related tags | Dog,  Turtle,Fish |
  63        | Standard | 0 |
  64      And I press "Update"
  65      Then "Kitten" "text" should exist in the ".breadcrumb-nav" "css_element"
  66      And "Description of tag 1" "text" should exist in the ".tag-description" "css_element"
  67      And I should see "Related tags:" in the ".tag_list" "css_element"
  68      And I should see "Dog" in the ".tag_list" "css_element"
  69      And I should see "Turtle" in the ".tag_list" "css_element"
  70      And I should see "Fish" in the ".tag_list" "css_element"
  71      And I follow "Edit this tag"
  72      And I click on "× Dog" "text"
  73      And I press "Update"
  74      Then "Kitten" "text" should exist in the ".breadcrumb-nav" "css_element"
  75      And "Description of tag 1" "text" should exist in the ".tag-description" "css_element"
  76      And I should see "Related tags:" in the ".tag_list" "css_element"
  77      And I should see "Turtle" in the ".tag_list" "css_element"
  78      And I should see "Fish" in the ".tag_list" "css_element"
  79      And I should not see "Dog"
  80      And I log out
  81  
  82    Scenario: Renaming the tag from tag view page
  83      When I log in as "manager1"
  84      And I navigate to "Participants" node in "Site pages"
  85      And I follow "User 1"
  86      And I follow "Cat"
  87      And I follow "Edit this tag"
  88      And I set the following fields to these values:
  89        | Tag name | DOG |
  90      And I press "Update"
  91      And I should see "Tag names already being used"
  92      And I set the following fields to these values:
  93        | Tag name | Kitten |
  94      And I press "Update"
  95      Then "Kitten" "text" should exist in the ".breadcrumb-nav" "css_element"
  96      And I follow "Edit this tag"
  97      And I set the following fields to these values:
  98        | Tag name | KITTEN |
  99      And I press "Update"
 100      And "KITTEN" "text" should exist in the ".breadcrumb-nav" "css_element"
 101      And I log out
 102  
 103    @javascript
 104    Scenario: Manager can change tag description and rename the tag from tag manage page
 105      When I log in as "manager1"
 106      And I navigate to "Manage tags" node in "Site administration > Appearance"
 107      And I follow "Default collection"
 108      And I click on "Edit this tag" "link" in the "Cat" "table_row"
 109      And I set the following fields to these values:
 110        | Tag name | Kitten |
 111        | Description | Description of tag 1 |
 112        | Related tags | Dog,  Turtle,Fish |
 113        | Standard | 0 |
 114      And I press "Update"
 115      Then "Default collection" "link" should exist in the ".breadcrumb-nav" "css_element"
 116      And I follow "Kitten"
 117      And "Description of tag 1" "text" should exist in the ".tag-description" "css_element"
 118      And I should see "Related tags:" in the ".tag_list" "css_element"
 119      And I should see "Dog" in the ".tag_list" "css_element"
 120      And I should see "Turtle" in the ".tag_list" "css_element"
 121      And I should see "Fish" in the ".tag_list" "css_element"
 122      And I log out
 123  
 124    Scenario: Renaming the tag in edit tag form from tag manage page
 125      When I log in as "manager1"
 126      And I navigate to "Manage tags" node in "Site administration > Appearance"
 127      And I follow "Default collection"
 128      And I click on "Edit this tag" "link" in the "Cat" "table_row"
 129      And I set the following fields to these values:
 130        | Tag name | DOG |
 131      And I press "Update"
 132      And I should see "Tag names already being used"
 133      And I set the following fields to these values:
 134        | Tag name | Kitten |
 135      And I press "Update"
 136      Then "Default collection" "text" should exist in the ".breadcrumb-nav" "css_element"
 137      And I click on "Edit this tag" "link" in the "Kitten" "table_row"
 138      And I set the following fields to these values:
 139        | Tag name | KITTEN |
 140      And I press "Update"
 141      And "Default collection" "text" should exist in the ".breadcrumb-nav" "css_element"
 142      And I should see "KITTEN"
 143      And I should not see "Kitten"
 144      And I log out
 145  
 146    @javascript
 147    Scenario: Renaming the tag using quick edit field on tag manage page
 148      When I log in as "manager1"
 149      And I navigate to "Manage tags" node in "Site administration > Appearance"
 150      And I follow "Default collection"
 151      # Renaming tag to a valid name
 152      And I click on "Edit tag name" "link" in the "Cat" "table_row"
 153      And I set the field "New name for tag Cat" to "Kitten"
 154      And I press key "13" in the field "New name for tag Cat"
 155      Then I should not see "Cat"
 156      And "New name for tag" "field" should not exist
 157      And I wait until "Kitten" "link" exists
 158      And I follow "Default collection"
 159      And I should see "Kitten"
 160      And I should not see "Cat"
 161      # Renaming tag to an invalid name
 162      And I click on "Edit tag name" "link" in the "Turtle" "table_row"
 163      And I set the field "New name for tag Turtle" to "DOG"
 164      And I press key "13" in the field "New name for tag Turtle"
 165      And I should see "The tag name is already in use. Do you want to combine these tags?"
 166      And I press "Cancel"
 167      And "New name for tag" "field" should not exist
 168      And I should see "Turtle"
 169      And I should see "Dog"
 170      And I should not see "DOG"
 171      And I follow "Default collection"
 172      And I should see "Turtle"
 173      And I should see "Dog"
 174      And I should not see "DOG"
 175      # Cancel tag renaming
 176      And I click on "Edit tag name" "link" in the "Dog" "table_row"
 177      And I set the field "New name for tag Dog" to "Penguin"
 178      And I press key "27" in the field "New name for tag Dog"
 179      And "New name for tag" "field" should not exist
 180      And I should see "Turtle"
 181      And I should not see "Penguin"
 182      And I follow "Default collection"
 183      And I should see "Turtle"
 184      And I should not see "Penguin"
 185      And I log out
 186  
 187    @javascript
 188    Scenario: Combining tags when renaming
 189      When I log in as "manager1"
 190      And I navigate to "Manage tags" node in "Site administration > Appearance"
 191      And I follow "Default collection"
 192      And I click on "Edit tag name" "link" in the "Turtle" "table_row"
 193      And I set the field "New name for tag Turtle" to "DOG"
 194      And I press key "13" in the field "New name for tag Turtle"
 195      And I should see "The tag name is already in use. Do you want to combine these tags?"
 196      And I press "Yes"
 197      Then I should not see "Turtle"
 198      And I should not see "DOG"
 199      And I should see "Dog"
 200      And I log out
 201  
 202    @javascript
 203    Scenario: Combining multiple tags
 204      When I log in as "manager1"
 205      And I navigate to "Manage tags" node in "Site administration > Appearance"
 206      And I follow "Default collection"
 207      And I set the following fields to these values:
 208        | Select tag Dog | 1 |
 209        | Select tag Neverusedtag | 1 |
 210        | Select tag Turtle | 1 |
 211      And I press "Combine selected"
 212      And I should see "Select the tag that will be used after combining"
 213      And I click on "//form[@id='combinetags_form']//input[@type='radio'][3]" "xpath_element"
 214      And I press "Continue"
 215      Then I should see "Tags are combined"
 216      And I should not see "Dog"
 217      And I should not see "Neverusedtag"
 218      And I should see "Turtle"
 219      # Even though Turtle was not standard but at least one of combined tags was (Neverusedtag). Now Turtle is also standard.
 220      And "Remove from standard tags" "link" should exist in the "Turtle" "table_row"
 221      And I log out
 222  
 223    Scenario: Filtering tags
 224      When I log in as "manager1"
 225      And I navigate to "Manage tags" node in "Site administration > Appearance"
 226      And I follow "Default collection"
 227      And I should not see "Reset filter"
 228      And I set the field "Search" to "t"
 229      And I press "Search"
 230      Then the field "Search" matches value "t"
 231      And I should not see "Dog"
 232      And I should see "Cat"
 233      And I should see "Turtle"
 234      And I follow "Reset filter"
 235      And I should see "Dog"
 236      And I should see "Cat"
 237      And I should see "Turtle"
 238      And I log out


Generated: Thu Aug 11 10:00:09 2016 Cross-referenced by PHPXref 0.7.1