mirror of
https://github.com/moodle/moodle.git
synced 2025-08-08 02:16:41 +02:00
MDL-62631 badges: Add manage/add badges buttons on Badges page
Direct access from the navigation Badges section to the "Manage badges" and "Add a new badge" buttons.
This commit is contained in:
parent
07203d34f1
commit
22348a3b96
3 changed files with 89 additions and 0 deletions
|
@ -145,3 +145,41 @@ Feature: Add badges to the system
|
|||
| Description | Test Badge Competencies description |
|
||||
When I press "Save changes"
|
||||
And I should see "Competencies (1)"
|
||||
|
||||
@javascript @_file_upload
|
||||
Scenario: Add a badge from Site badges section
|
||||
Given I press "Customise this page"
|
||||
# TODO MDL-57120 site "Badges" link not accessible without navigation block.
|
||||
And I add the "Navigation" block if not present
|
||||
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"
|
||||
# Add a badge.
|
||||
When I press "Add a new badge"
|
||||
And I set the following fields to these values:
|
||||
| Name | Test badge with 'apostrophe' and other friends (<>&@#) 2 |
|
||||
| Version | v1 |
|
||||
| Language | English |
|
||||
| Description | Test badge description |
|
||||
| Image author | http://author.example.com |
|
||||
| Image caption | Test caption image |
|
||||
| issuername | Test Badge Site |
|
||||
| issuercontact | testuser@example.com |
|
||||
And I upload "badges/tests/behat/badge.png" file to "Image" filemanager
|
||||
And I press "Create badge"
|
||||
Then I should see "Edit details"
|
||||
And I should see "Test badge with 'apostrophe' and other friends (&@#) 2"
|
||||
And I should see "Endorsement"
|
||||
And I should see "Related badges (0)"
|
||||
And I should see "Competencies (0)"
|
||||
And I should not see "Create badge"
|
||||
And I follow "Manage badges"
|
||||
And I should see "Number of badges available: 1"
|
||||
And I should not see "There are no badges available."
|
||||
# See buttons from the "Site badges" page.
|
||||
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"
|
||||
|
|
|
@ -69,6 +69,31 @@ Feature: Award badges
|
|||
When I click on "Course 1" "link" in the "region-main" "region"
|
||||
Then I should see "Course Badge 1"
|
||||
And I should see "Course Badge 2"
|
||||
# Student 1 should have both badges also in the Badges navigation section.
|
||||
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"
|
||||
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 follow "Badges"
|
||||
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
|
||||
And I press "Customise this page"
|
||||
# TODO MDL-57120 site "Badges" link not accessible without navigation block.
|
||||
And I add the "Navigation" block if not present
|
||||
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 badges available."
|
||||
And I should not see "Manage badges"
|
||||
And I should not see "Add a new badge"
|
||||
|
||||
@javascript
|
||||
Scenario: Award profile badge
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue