Rev 1 | AutorÃa | Comparar con el anterior | Ultima modificación | Ver Log |
@core @core_badges @_file_upload @javascriptFeature: Badges not shown when there are no existing badges.Scenario: Check navigation at site level with no badgesGiven I log in as "admin"When I navigate to "Badges > Manage badges" in site administrationThen I should see "There are no matching badges available for users to earn."Scenario: Check navigation at course level with no badgesGiven the following "users" exist:| username | firstname | lastname | email || teacher | Teacher | 1 | teacher@example.com |And the following "courses" exist:| fullname | shortname | format | enablecompletion || Course 1 | C1 | topics | 1 |And the following "course enrolments" exist:| user | course | role || teacher | C1 | editingteacher |And I log in as "teacher"And I am on "Course 1" course homepageWhen I navigate to "Badges" in current page administrationThen I click on "Add a new badge" "button"And I set the following fields to these values:| Name | Testing course badge || Version | 1.1 || Language | Basque || Description | Testing course badge description || Image caption | Test caption image |And I upload "badges/tests/behat/badge.png" file to "Image" filemanagerAnd I click on "Create badge" "button"And I click on "Back" "button"And I should see "Testing course badge"And I press "Edit" action in the "Testing course badge" report rowAnd I click on "Add criteria" "button"And I set the field "type" to "Manual issue by role"And I expand all fieldsetsAnd I set the field "Teacher" to "1"And I click on "Save" "button"And I click on "Back" "button"And I should see "Testing course badge"And I press "Enable access" action in the "Testing course badge" report rowAnd I click on "Enable" "button" in the "Confirm" "dialogue"And I should see "Testing course badge"Scenario: Check navigation at course level with no badges as a student# Create a badge, but leave it not enabled for now.Given the following "users" exist:| username | firstname | lastname | email || student1 | Student | 1 | student1@example.com |And the following "courses" exist:| fullname | shortname | format | enablecompletion || Course 1 | C1 | topics | 1 |And the following "course enrolments" exist:| user | course | role || student1 | C1 | student |And I am on the "C1" "Course" page logged in as "admin"And I navigate to "Badges > Add a new badge" in current page administrationAnd I set the following fields to these values:| Name | Testing course badge || Version | 1.0 || Language | Catalan || Description | Testing course badge description |And I upload "badges/tests/behat/badge.png" file to "Image" filemanagerAnd I press "Create badge"And I set the field "type" to "Manual issue by role"And I expand all fieldsetsAnd I set the field "Teacher" to "1"And I press "Save"And I log outWhen I am on the "C1" "Course" page logged in as "student1"Then "Badges" "link" should not exist in current page administrationAnd I log out# Enable the badge.And I am on the "C1" "Course" page logged in as "admin"And I navigate to "Badges" in current page administrationAnd I press "Enable access" action in the "Testing course badge" report rowAnd I click on "Enable" "button" in the "Confirm" "dialogue"And I log out# Now student should see the Badges link.And I am on the "C1" "Course" page logged in as "student1"And I follow "Badges"And "Add a new badge" "button" should not existAnd I should not see "There are no matching badges available for users to earn."And the following should exist in the "reportbuilder-table" table:| Name | Criteria || Testing course badge | Awarded by: Teacher |