diff --git a/backup/util/ui/tests/behat/import_course.feature b/backup/util/ui/tests/behat/import_course.feature index f0e6c8d5400..5f849f5b711 100644 --- a/backup/util/ui/tests/behat/import_course.feature +++ b/backup/util/ui/tests/behat/import_course.feature @@ -69,7 +69,7 @@ Feature: Import course's contents into another course | Unpublished course badge | editingteacher | When I import "Course 1" course into "Course 2" course using this options: | Settings | Include badges | 1 | - And I navigate to "Badges > Manage badges" in current page administration + And I navigate to "Badges" in current page administration Then I should see "Published course badge" And I should see "Unpublished course badge" And I should see "Unpublished without criteria course badge" diff --git a/backup/util/ui/tests/behat/restore_moodle2_courses.feature b/backup/util/ui/tests/behat/restore_moodle2_courses.feature index 62539cca092..7da17b0abfc 100644 --- a/backup/util/ui/tests/behat/restore_moodle2_courses.feature +++ b/backup/util/ui/tests/behat/restore_moodle2_courses.feature @@ -285,7 +285,7 @@ Feature: Restore Moodle 2 course backups | Confirmation | Filename | test_backup.mbz | When I restore "test_backup.mbz" backup into a new course using this options: | Settings | Include badges | 1 | - And I navigate to "Badges > Manage badges" in current page administration + And I navigate to "Badges" in current page administration Then I should see "Published course badge" And I should see "Unpublished course badge" And I should see "Unpublished without criteria course badge" diff --git a/badges/tests/behat/add_badge.feature b/badges/tests/behat/add_badge.feature index 785b44c1180..5791f056e2b 100644 --- a/badges/tests/behat/add_badge.feature +++ b/badges/tests/behat/add_badge.feature @@ -67,8 +67,8 @@ Feature: Add badges to the system | Image caption | Test caption image | And I upload "badges/tests/behat/badge.png" file to "Image" filemanager And I press "Create badge" - And I navigate to "Badges > Manage badges" in site administration - And I press "Add a new badge" + And I wait until the page is ready + And I navigate to "Badges > Add a new badge" in site administration And I set the following fields to these values: | Name | Test Badge 2 | | Version | v2 | @@ -82,6 +82,7 @@ Feature: Add badges to the system And I should see "This badge does not have any related badges." And I press "Add related badge" And I follow "Related badges" + And I wait until the page is ready And I follow "Related badges" And I set the field "relatedbadgeids[]" to "Test Badge 1 (version: v1, language: French, Site badges)" When I press "Save changes" @@ -168,13 +169,12 @@ Feature: Add badges to the system And I am on homepage When I click on "Site pages" "list_item" in the "Navigation" "block" And I click on "Site badges" "link" in the "Navigation" "block" - Then I should see "Manage badges" - And I should see "Add a new badge" + Then I should see "Add a new badge" @javascript @_file_upload Scenario: Edit a site badge Given the following "core_badges > Badge" exists: - | name | Site badge | + | name | Testing site badge | | status | inactive | | version | 1 | | language | ca | @@ -184,11 +184,11 @@ Feature: Add badges to the system | imagecaption | My caption image | | issuercontact | testuser@example.com | And the following "core_badges > Criterias" exist: - | badge | role | - | Site badge | editingteacher | + | badge | role | + | Testing site badge | editingteacher | And I navigate to "Badges > Manage badges" in site administration - When I press "Edit" action in the "Site badge" report row - And I should see "Site badge" + When I press "Edit" action in the "Testing site badge" report row + And I should see "Testing site badge" And the field "Issuer contact" matches value "testuser@example.com" And I set the following fields to these values: | Name | Test badge with 'apostrophe' and other friends (<>&@#) | @@ -203,7 +203,7 @@ Feature: Add badges to the system And I select "Overview" from the "jump" singleselect And I expand all fieldsets Then I should see "Test badge with 'apostrophe' and other friends (&@#)" - And I should not see "Site badge" + And I should not see "Testing site badge" And I should see "secondversion" And I should not see "firstversion" And I should see "Math" @@ -218,42 +218,3 @@ Feature: Add badges to the system | badges_defaultissuername | Test Badge Site | And I navigate to "Badges > Add a new badge" in site administration And the field "Issuer name" matches value "Test Badge Site" - - Scenario: Cancel button behaviour when creating badges - Given the following "course" exists: - | fullname | Course 1 | - | shortname | C1 | - And the following "core_badges > Badge" exists: - | name | Site Badge 1 | - | description | Site badge 1 description | - | image | badges/tests/behat/badge.png | - | status | 0 | - | type | 1 | - And the following "core_badges > Badge" exists: - | name | Course Badge 1 | - | course | C1 | - | description | Course badge 1 description | - | image | badges/tests/behat/badge.png | - | status | 0 | - | type | 2 | - # Site badge: cancel when creating. - When I navigate to "Badges > Add a new badge" in site administration - And I click on "Cancel" "button" - Then I should see "Manage badges" - And I should see "Add a new badge" - # Site badge: cancel when editing. - And I press "Edit" action in the "Site Badge 1" report row - And I click on "Cancel" "button" - And I should see "Site badge 1" - And I should not see "Save changes" - # Course badge: cancel when creating. - And I am on the "Course 1" "course" page - And I navigate to "Badges > Manage badges > Add a new badge" in current page administration - And I click on "Cancel" "button" - Then I should see "Manage badges" - And I should see "Add a new badge" - # Course badge: cancel when editing. - And I press "Edit" action in the "Course Badge 1" report row - And I click on "Cancel" "button" - And I should see "Course badge 1" - And I should not see "Save changes" diff --git a/badges/tests/behat/award_badge.feature b/badges/tests/behat/award_badge.feature index d6c2c8498e1..57c4f0423a2 100644 --- a/badges/tests/behat/award_badge.feature +++ b/badges/tests/behat/award_badge.feature @@ -37,7 +37,7 @@ Feature: Award badges | badge | Course Badge 1 | | role | editingteacher | And I am on the "Course 1" "course" page logged in as "teacher1" - And I navigate to "Badges > Manage badges" in current page administration + And I navigate to "Badges" in current page administration And I follow "Course Badge 2" And I select "Criteria" from the "jump" singleselect # Set "course badge 1" as criteria for Badge 2. @@ -47,7 +47,7 @@ Feature: Award badges And I press "Enable access" And I click on "Enable" "button" in the "Confirm" "dialogue" And I am on "Course 1" course homepage - And I navigate to "Badges > Manage badges" in current page administration + And I navigate to "Badges" in current page administration And I follow "Course Badge 1" And I select "Recipients (0)" from the "jump" singleselect And I press "Award badge" @@ -55,7 +55,7 @@ Feature: Award badges And I set the field "potentialrecipients[]" to "Student 1 (student1@example.com)" When I press "Award badge" And I am on "Course 1" course homepage - And I navigate to "Badges > Manage badges" in current page administration + And I navigate to "Badges" in current page administration And I follow "Course Badge 1" And I select "Recipients (1)" from the "jump" singleselect Then I should see "Recipients (1)" @@ -70,16 +70,26 @@ Feature: Award badges When I follow "Badges" Then I should see "Course Badge 1" And I should see "Course Badge 2" - And I should not see "Manage badges" And I should not see "Add a new badge" + # Student 1 should have both badges in the course too. + And I am on "Course 1" course homepage + And I navigate to "Badges" in current page administration + And I should see "Course Badge 1" + And I should see "Course Badge 2" + And I should not see "Course badge 1 description" + And I should not see "Course badge 2 description" + And I should not see "Recipients" + And I should not see "Badge status" + And I follow "Course Badge 1" + And I should see "Course badge 1 description" + And I should not see "Course badge 2 description" And I log out # Teacher 1 should have access to manage/create badges in the Badges navigation section. When I log in as "teacher1" And I am on "Course 1" course homepage - And I navigate to "Badges > Manage badges" in current page administration + And I navigate to "Badges" in current page administration Then I should see "Course Badge 1" And I should see "Course Badge 2" - And I should see "Manage badges" And I should see "Add a new badge" # Teacher 1 should NOT have access to manage/create site badges in the Site badges section. When I am on homepage @@ -91,7 +101,6 @@ Feature: Award badges And I click on "Site pages" "list_item" in the "Navigation" "block" And I click on "Site badges" "link" in the "Navigation" "block" Then I should see "There are no matching badges available for users to earn" - And I should not see "Manage badges" And I should not see "Add a new badge" @javascript @@ -127,6 +136,7 @@ Feature: Award badges And I press "Update profile" And I follow "Profile" in the user menu Then I should see "Profile Badge" + And I should not see "There are no matching badges available for users to earn" @javascript Scenario: Award site badge @@ -169,7 +179,7 @@ Feature: Award badges | badge | Course Badge | | role | editingteacher | And I am on the "Course 1" "course" page logged in as "teacher1" - And I navigate to "Badges > Manage badges" in current page administration + And I navigate to "Badges" in current page administration And I follow "Course Badge" And I select "Recipients (0)" from the "jump" singleselect And I press "Award badge" @@ -178,7 +188,7 @@ Feature: Award badges And I set the field "potentialrecipients[]" to "Student 1 (student1@example.com)" When I press "Award badge" And I am on "Course 1" course homepage - And I navigate to "Badges > Manage badges" in current page administration + And I navigate to "Badges" in current page administration And I follow "Course Badge" Then I should see "Recipients (2)" And I log out @@ -198,7 +208,7 @@ Feature: Award badges | status | 0 | | type | 2 | And I am on the "Course 1" "course" page logged in as "teacher1" - And I navigate to "Badges > Manage badges" in current page administration + And I navigate to "Badges" in current page administration And I follow "Course Badge" And I select "Criteria" from the "jump" singleselect And I set the field "type" to "Activity completion" @@ -240,7 +250,7 @@ Feature: Award badges And I set the field "Assignment - Music history" to "1" And I press "Save changes" And I am on "Course 1" course homepage - And I navigate to "Badges > Manage badges" in current page administration + And I navigate to "Badges" in current page administration And I follow "Course Badge" And I select "Criteria" from the "jump" singleselect And I set the field "type" to "Course completion" @@ -280,7 +290,7 @@ Feature: Award badges | badge | Course Badge 1 | | role | editingteacher | And I am on the "Course 1" "course" page logged in as "teacher1" - And I navigate to "Badges > Manage badges" in current page administration + And I navigate to "Badges" in current page administration And I follow "Course Badge 1" And I select "Recipients (0)" from the "jump" singleselect And I press "Award badge" @@ -288,7 +298,7 @@ Feature: Award badges And I set the field "potentialrecipients[]" to "Student 1 (student1@example.com)" When I press "Award badge" And I am on "Course 1" course homepage - And I navigate to "Badges > Manage badges" in current page administration + And I navigate to "Badges" in current page administration And I follow "Course Badge 1" And I select "Recipients (1)" from the "jump" singleselect Then I should see "Recipients (1)" @@ -300,7 +310,7 @@ Feature: Award badges | image | badges/tests/behat/badge.png | | status | 0 | | type | 2 | - And I navigate to "Badges > Manage badges" in current page administration + And I navigate to "Badges" in current page administration And I follow "Course Badge 2" And I select "Criteria" from the "jump" singleselect And I set the field "type" to "Manual issue by role" @@ -317,7 +327,7 @@ Feature: Award badges And I set the field "potentialrecipients[]" to "Student 2 (student2@example.com)" When I press "Award badge" And I am on "Course 1" course homepage - And I navigate to "Badges > Manage badges" in current page administration + And I navigate to "Badges" in current page administration And I follow "Course Badge 2" And I select "Recipients (1)" from the "jump" singleselect Then I should see "Recipients (1)" @@ -350,7 +360,7 @@ Feature: Award badges | badge | Course Badge | | role | editingteacher | And I am on the "Course 1" "course" page logged in as "teacher1" - And I navigate to "Badges > Manage badges" in current page administration + And I navigate to "Badges" in current page administration And I follow "Course Badge" And I select "Recipients (0)" from the "jump" singleselect And I press "Award badge" @@ -359,7 +369,7 @@ Feature: Award badges And I set the field "potentialrecipients[]" to "Student 1 (student1@example.com)" When I press "Award badge" And I am on "Course 1" course homepage - And I navigate to "Badges > Manage badges" in current page administration + And I navigate to "Badges" in current page administration And I follow "Course Badge" Then I should see "Recipients (2)" And I select "Recipients (2)" from the "jump" singleselect @@ -369,6 +379,6 @@ Feature: Award badges And I set the field "existingrecipients[]" to "Student 1 (student1@example.com)" When I press "Revoke badge" And I am on "Course 1" course homepage - And I navigate to "Badges > Manage badges" in current page administration + And I navigate to "Badges" in current page administration And I follow "Course Badge" Then I should see "Recipients (0)" diff --git a/badges/tests/behat/award_badge_groups.feature b/badges/tests/behat/award_badge_groups.feature index 798787636eb..0deb7911801 100644 --- a/badges/tests/behat/award_badge_groups.feature +++ b/badges/tests/behat/award_badge_groups.feature @@ -38,7 +38,7 @@ Feature: Award badges with separate groups | status | 0 | | type | 2 | And I am on the "Course 1" "course" page logged in as "teacher1" - And I navigate to "Badges > Manage badges" in current page administration + And I navigate to "Badges" in current page administration And I follow "Course Badge" And I select "Criteria" from the "jump" singleselect And I set the field "type" to "Manual issue by role" @@ -55,7 +55,7 @@ Feature: Award badges with separate groups Scenario: Award course badge as non-editing teacher with only one group When I log in as "teacher2" And I am on "Course 1" course homepage - And I navigate to "Badges > Manage badges" in current page administration + And I navigate to "Badges" in current page administration And I follow "Course Badge" And I press "Award badge" And I set the field "role" to "Non-editing teacher" @@ -68,7 +68,7 @@ Feature: Award badges with separate groups And I set the field "potentialrecipients[]" to "Student 2 (student2@example.com)" And I press "Award badge" And I am on "Course 1" course homepage - And I navigate to "Badges > Manage badges" in current page administration + And I navigate to "Badges" in current page administration And I follow "Course Badge" And I should see "Recipients (1)" And I log out @@ -89,7 +89,7 @@ Feature: Award badges with separate groups And I log out When I log in as "teacher2" And I am on "Course 1" course homepage - And I navigate to "Badges > Manage badges" in current page administration + And I navigate to "Badges" in current page administration And I follow "Course Badge" And I press "Award badge" And I set the field "role" to "Non-editing teacher" @@ -114,7 +114,7 @@ Feature: Award badges with separate groups And I log out When I log in as "teacher2" And I am on "Course 1" course homepage - And I navigate to "Badges > Manage badges" in current page administration + And I navigate to "Badges" in current page administration And I follow "Course Badge" And I press "Award badge" # Teacher 2 shouldn't be able to go further @@ -123,7 +123,7 @@ Feature: Award badges with separate groups @javascript Scenario: Editing teacher can award badge to members of separate groups Given I am on the "Course 1" course page logged in as teacher1 - And I navigate to "Badges > Manage badges" in current page administration + And I navigate to "Badges" in current page administration And I follow "Course Badge" And I press "Award badge" When I set the field "role" to "Teacher" @@ -155,7 +155,7 @@ Feature: Award badges with separate groups And I set the field "Group mode" to "Visible groups" And I press "Save and display" When I am on the "Course 1" course page logged in as - And I navigate to "Badges > Manage badges" in current page administration + And I navigate to "Badges" in current page administration And I follow "Course Badge" And I press "Award badge" And I set the field "role" to "" @@ -196,7 +196,7 @@ Feature: Award badges with separate groups And I set the field "Group mode" to "No groups" And I press "Save and display" When I am on the "Course 1" course page logged in as - And I navigate to "Badges > Manage badges" in current page administration + And I navigate to "Badges" in current page administration And I follow "Course Badge" And I press "Award badge" And I set the field "role" to "" diff --git a/badges/tests/behat/badge_navigation.feature b/badges/tests/behat/badge_navigation.feature index 7d80f81a42d..c2dff101ec1 100644 --- a/badges/tests/behat/badge_navigation.feature +++ b/badges/tests/behat/badge_navigation.feature @@ -46,28 +46,14 @@ Feature: Test tertiary navigation as various users Given I log in as "" And I am on "Course 1" course homepage When I navigate to "Badges" in current page administration - Then "Manage badges" "button" should exist - And "Add a new badge" "button" + Then "Add a new badge" "button" And I should see "" is active in secondary navigation - And I click on "Manage badges" "button" - And "Manage badges" "button" should not exist - And "Back" "button" should exist - And "Add a new badge" "button" - And I should see "" is active in secondary navigation - And I click on "Back" "button" And "Back" "button" should not exist - And "Manage badges" "button" should exist - And "Add a new badge" "button" - And I should see "" is active in secondary navigation - And I click on "Manage badges" "button" And I click on "Testing course badge" "link" - And "Manage badges" "button" should not exist And "Add a new badge" "button" should not exist And "Back" "button" should exist And I should see "" is active in secondary navigation And I click on "Back" "button" - And "Back" "button" should exist - And "Manage badges" "button" should not exist And "Add a new badge" "button" And I should see "" is active in secondary navigation @@ -84,7 +70,6 @@ Feature: Test tertiary navigation as various users # Enable one badge. When I am on the "C1" "Course" page logged in as "admin" And I navigate to "Badges" in current page administration - And I click on "Manage badges" "button" And I press "Enable access" action in the "Testing course badge" report row And I click on "Enable" "button" in the "Confirm" "dialogue" And I log out @@ -93,24 +78,20 @@ Feature: Test tertiary navigation as various users Then "Badges" "link" should exist in current page administration And I navigate to "Badges" in current page administration And "Back" "button" should not exist - And "Manage badges" "button" should not exist And "Add a new badge" "button" should not exist And I should see "Badges" is active in secondary navigation Scenario: Check navigation as an admin in a site context Given I log in as "admin" When I navigate to "Badges > Manage badges" in site administration - Then "Manage badges" "button" should not exist - And "Add a new badge" "button" should exist + Then "Add a new badge" "button" should exist And I should see "General" is active in secondary navigation And I click on "Testing site badge" "link" - And "Manage badges" "button" should not exist And "Add a new badge" "button" should not exist And "Back" "button" should exist And I should see "General" is active in secondary navigation And I click on "Back" "button" And "Back" "button" should not exist - And "Manage badges" "button" should not exist And "Add a new badge" "button" should exist Scenario Outline: Check secondary navigation highlights after tertiary nav jumps in site admin @@ -135,7 +116,6 @@ Feature: Test tertiary navigation as various users Given I log in as "admin" And I am on "Course 1" course homepage And I navigate to "Badges" in current page administration - And I click on "Manage badges" "button" And I click on "Testing course badge" "link" When I select "