block_badges_frontpage.feature 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. @block @block_badges @core_badges @_file_upload @javascript
  2. Feature: Enable Block Badges on the frontpage and view awarded badges
  3. In order to enable the badges block on the frontpage
  4. As a admin
  5. I can add badges block to the frontpage
  6. Scenario: Add the recent badges block on the frontpage and view recent badges
  7. Given the following "users" exist:
  8. | username | firstname | lastname | email | idnumber |
  9. | teacher1 | Teacher | 1 | teacher1@example.com | T1 |
  10. And the following "courses" exist:
  11. | fullname | shortname | category |
  12. | Course 1 | C1 | 0 |
  13. And the following "course enrolments" exist:
  14. | user | course | role |
  15. | teacher1 | C1 | editingteacher |
  16. And I log in as "admin"
  17. And I am on site homepage
  18. And I navigate to "Turn editing on" node in "Front page settings"
  19. And I add the "Latest badges" block
  20. And I log out
  21. And I log in as "teacher1"
  22. And I follow "Course 1"
  23. # Issue badge 1 of 2
  24. And I navigate to "Add a new badge" node in "Badges"
  25. And I set the following fields to these values:
  26. | id_name | Badge 1 |
  27. | id_description | Badge 1 |
  28. | id_issuername | Teacher 1 |
  29. And I upload "blocks/badges/tests/fixtures/badge.png" file to "Image" filemanager
  30. And I press "Create badge"
  31. And I select "Manual issue by role" from the "Add badge criteria" singleselect
  32. And I set the field "Teacher" to "1"
  33. And I press "Save"
  34. And I press "Enable access"
  35. And I press "Continue"
  36. And I follow "Recipients (0)"
  37. And I press "Award badge"
  38. And I set the field "potentialrecipients[]" to "Teacher 1 (teacher1@example.com)"
  39. And I press "Award badge"
  40. And I log out
  41. When I log in as "teacher1"
  42. And I am on site homepage
  43. Then I should see "Badge 1" in the "Latest badges" "block"