[ Index ]

PHP Cross Reference of Unnamed Project

title

Body

[close]

/enrol/self/tests/behat/ -> self_enrolment.feature (source)

   1  @enrol @enrol_self
   2  Feature: Users can auto-enrol themself in courses where self enrolment is allowed
   3    In order to participate in courses
   4    As a user
   5    I need to auto enrol me in courses
   6  
   7    Background:
   8      Given the following "users" exist:
   9        | username | firstname | lastname | email |
  10        | teacher1 | Teacher | 1 | teacher1@example.com |
  11        | student1 | Student | 1 | student1@example.com |
  12      And the following "courses" exist:
  13        | fullname | shortname | format |
  14        | Course 1 | C1 | topics |
  15      And the following "course enrolments" exist:
  16        | user | course | role |
  17        | teacher1 | C1 | editingteacher |
  18  
  19    # Note: Please keep the javascript tag on this Scenario to ensure that we
  20    # test use of the singleselect functionality.
  21    @javascript
  22    Scenario: Self-enrolment enabled as guest
  23      Given I log in as "teacher1"
  24      And I follow "Course 1"
  25      And I add "Self enrolment" enrolment method with:
  26        | Custom instance name | Test student enrolment |
  27      And I log out
  28      When I follow "Course 1"
  29      And I press "Log in as a guest"
  30      Then I should see "Guests cannot access this course. Please log in."
  31      And I press "Continue"
  32      And I should see "Log in"
  33  
  34    Scenario: Self-enrolment enabled
  35      Given I log in as "teacher1"
  36      And I follow "Course 1"
  37      When I add "Self enrolment" enrolment method with:
  38        | Custom instance name | Test student enrolment |
  39      And I log out
  40      And I log in as "student1"
  41      And I am on site homepage
  42      And I follow "Course 1"
  43      And I press "Enrol me"
  44      Then I should see "Topic 1"
  45      And I should not see "Enrolment options"
  46  
  47    Scenario: Self-enrolment enabled requiring an enrolment key
  48      Given I log in as "teacher1"
  49      And I follow "Course 1"
  50      When I add "Self enrolment" enrolment method with:
  51        | Custom instance name | Test student enrolment |
  52        | Enrolment key | moodle_rules |
  53      And I log out
  54      And I log in as "student1"
  55      And I am on site homepage
  56      And I follow "Course 1"
  57      And I set the following fields to these values:
  58        | Enrolment key | moodle_rules |
  59      And I press "Enrol me"
  60      Then I should see "Topic 1"
  61      And I should not see "Enrolment options"
  62      And I should not see "Enrol me in this course"
  63  
  64    Scenario: Self-enrolment disabled
  65      Given I log in as "student1"
  66      And I am on site homepage
  67      When I follow "Course 1"
  68      Then I should see "You can not enrol yourself in this course"
  69  
  70    Scenario: Self-enrolment enabled requiring a group enrolment key
  71      Given I log in as "teacher1"
  72      And I follow "Course 1"
  73      When I add "Self enrolment" enrolment method with:
  74        | Custom instance name | Test student enrolment |
  75        | Enrolment key | moodle_rules |
  76        | Use group enrolment keys | Yes |
  77      And I follow "Groups"
  78      And I press "Create group"
  79      And I set the following fields to these values:
  80        | Group name | Group 1 |
  81        | Enrolment key | Test-groupenrolkey1 |
  82      And I press "Save changes"
  83      And I log out
  84      And I log in as "student1"
  85      And I am on site homepage
  86      And I follow "Course 1"
  87      And I set the following fields to these values:
  88        | Enrolment key | Test-groupenrolkey1 |
  89      And I press "Enrol me"
  90      Then I should see "Topic 1"
  91      And I should not see "Enrolment options"
  92      And I should not see "Enrol me in this course"


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