[ Index ]

PHP Cross Reference of Unnamed Project

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  
  20    @javascript
  21    Scenario: Test condition
  22      # Basic setup.
  23      Given I log in as "teacher1"
  24      And I am on site homepage
  25      And I follow "Course 1"
  26      And I turn editing mode on
  27  
  28      # Add a Page with a completion tickbox.
  29      And I add a "Page" to section "1" and I fill the form with:
  30        | Name                | Page 1 |
  31        | Description         | Test   |
  32        | Page content        | Test   |
  33        | Completion tracking | 1      |
  34  
  35      # And another one that depends on it (hidden otherwise).
  36      And I add a "Page" to section "2"
  37      And I set the following fields to these values:
  38        | Name         | Page 2 |
  39        | Description  | Test   |
  40        | Page content | Test   |
  41      And I expand all fieldsets
  42      And I click on "Add restriction..." "button"
  43      And I click on "Activity completion" "button" in the "Add restriction..." "dialogue"
  44      And I click on ".availability-item .availability-eye img" "css_element"
  45      And I set the field "Activity or resource" to "Page 1"
  46      And I press "Save and return to course"
  47  
  48      # Log back in as student.
  49      When I log out
  50      And I log in as "student1"
  51      And I am on site homepage
  52      And I follow "Course 1"
  53  
  54      # Page 2 should not appear yet.
  55      Then I should not see "Page 2" in the "region-main" "region"
  56  
  57      # Mark page 1 complete
  58      When I click on ".togglecompletion input[type=image]" "css_element"
  59      Then I should see "Page 2" in the "region-main" "region"


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