[ Index ]

PHP Cross Reference of moodle-2.8

title

Body

[close]

/availability/condition/completion/tests/behat/ -> availability_completion.feature (source)

   1  @availability @availability_completion
   2  Feature: availability_completion
   3    In order to control student access to activities
   4    As a teacher
   5    I need to set completion conditions which prevent student access
   6  
   7    Background:
   8      Given the following "courses" exist:
   9        | fullname | shortname | format | enablecompletion |
  10        | Course 1 | C1        | topics | 1                |
  11      And the following "users" exist:
  12        | username |
  13        | teacher1 |
  14        | student1 |
  15      And the following "course enrolments" exist:
  16        | user     | course | role           |
  17        | teacher1 | C1     | editingteacher |
  18        | student1 | C1     | student        |
  19      And I log in as "admin"
  20      And I set the following administration settings values:
  21        | Enable conditional access  | 1 |
  22        | Enable completion tracking | 1 |
  23      And I log out
  24  
  25    @javascript
  26    Scenario: Test condition
  27      # Basic setup.
  28      Given I log in as "teacher1"
  29      And I follow "Course 1"
  30      And I turn editing mode on
  31  
  32      # Add a Page with a completion tickbox.
  33      And I add a "Page" to section "1" and I fill the form with:
  34        | Name                | Page 1 |
  35        | Description         | Test   |
  36        | Page content        | Test   |
  37        | Completion tracking | 1      |
  38  
  39      # And another one that depends on it (hidden otherwise).
  40      And I add a "Page" to section "2"
  41      And I set the following fields to these values:
  42        | Name         | Page 2 |
  43        | Description  | Test   |
  44        | Page content | Test   |
  45      And I expand all fieldsets
  46      And I click on "Add restriction..." "button"
  47      And I click on "Activity completion" "button" in the "Add restriction..." "dialogue"
  48      And I click on ".availability-item .availability-eye img" "css_element"
  49      And I set the field "Activity or resource" to "Page 1"
  50      And I press "Save and return to course"
  51  
  52      # Log back in as student.
  53      When I log out
  54      And I log in as "student1"
  55      And I follow "Course 1"
  56  
  57      # Page 2 should not appear yet.
  58      Then I should not see "Page 2" in the "region-main" "region"
  59  
  60      # Mark page 1 complete
  61      When I click on ".togglecompletion input[type=image]" "css_element"
  62      Then I should see "Page 2" in the "region-main" "region"


Generated: Fri Nov 28 20:29:05 2014 Cross-referenced by PHPXref 0.7.1