[ Index ]

PHP Cross Reference of Unnamed Project

title

Body

[close]

/blocks/badges/tests/behat/ -> block_badges_course.feature (source)

   1  @block @block_badges @core_badges @_file_upload @javascript
   2  Feature: Enable Block Badges in a course
   3    In order to enable the badges block in a course
   4    As a teacher
   5    I can add badges block to a course
   6  
   7    Background:
   8      Given the following "users" exist:
   9        | username | firstname | lastname | email | idnumber |
  10        | teacher1 | Teacher | 1 | teacher1@example.com | T1 |
  11      And the following "courses" exist:
  12        | fullname | shortname | category |
  13        | Course 1 | C1 | 0 |
  14      And the following "course enrolments" exist:
  15        | user | course | role |
  16        | teacher1 | C1 | editingteacher |
  17      And I log in as "teacher1"
  18      And I follow "Course 1"
  19      # Issue badge 1 of 2
  20      And I navigate to "Add a new badge" node in "Badges"
  21      And I set the following fields to these values:
  22        | id_name | Badge 1 |
  23        | id_description | Badge 1 |
  24        | id_issuername | Teacher 1 |
  25      And I upload "blocks/badges/tests/fixtures/badge.png" file to "Image" filemanager
  26      And I press "Create badge"
  27      And I select "Manual issue by role" from the "Add badge criteria" singleselect
  28      And I set the field "Teacher" to "1"
  29      And I press "Save"
  30      And I press "Enable access"
  31      And I press "Continue"
  32      And I follow "Recipients (0)"
  33      And I press "Award badge"
  34      And I set the field "potentialrecipients[]" to "Teacher 1 (teacher1@example.com)"
  35      And I press "Award badge"
  36      # Issue Badge 2 of 2
  37      And I navigate to "Add a new badge" node in "Badges"
  38      And I set the following fields to these values:
  39        | id_name | Badge 2 |
  40        | id_description | Badge 2 |
  41        | id_issuername | Teacher 1 |
  42      And I upload "blocks/badges/tests/fixtures/badge.png" file to "Image" filemanager
  43      And I press "Create badge"
  44      And I select "Manual issue by role" from the "Add badge criteria" singleselect
  45      And I set the field "Teacher" to "1"
  46      And I press "Save"
  47      And I press "Enable access"
  48      And I press "Continue"
  49      And I follow "Recipients (0)"
  50      And I press "Award badge"
  51      And I set the field "potentialrecipients[]" to "Teacher 1 (teacher1@example.com)"
  52      And I press "Award badge"
  53      And I log out
  54  
  55    Scenario: Add the recent badges block to a course.
  56      Given I log in as "teacher1"
  57      And I follow "Course 1"
  58      And I turn editing mode on
  59      When I add the "Latest badges" block
  60      Then I should see "Badge 1" in the "Latest badges" "block"
  61      And I should see "Badge 2" in the "Latest badges" "block"
  62  
  63    Scenario: Add the recent badges block to a course and limit it to only display 1 badge.
  64      Given I log in as "teacher1"
  65      And I follow "Course 1"
  66      And I turn editing mode on
  67      When I add the "Latest badges" block
  68      And I configure the "Latest badges" block
  69      And I set the following fields to these values:
  70        | id_config_numberofbadges | 1 |
  71      And I press "Save changes"
  72      Then I should see "Badge 2" in the "Latest badges" "block"
  73      And I should not see "Badge 1" in the "Latest badges" "block"


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