[ Index ]

PHP Cross Reference of Unnamed Project

title

Body

[close]

/mod/choice/tests/behat/ -> include_inactive.feature (source)

   1  @mod @mod_choice
   2  Feature: Include responses from inactive users
   3    In order to view responses from inactive or suspended users in choice results
   4    As a teacher
   5    I need to enable the choice include inactive option
   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        | student2 | Student | 2 | student2@example.com |
  13        | student3 | Student | 3 | student3@example.com |
  14      And the following "courses" exist:
  15        | fullname | shortname | category |
  16        | Course 1 | C1 | 0 |
  17      And the following "course enrolments" exist:
  18        | user | course | role |
  19        | teacher1 | C1 | editingteacher |
  20        | student1 | C1 | student |
  21        | student2 | C1 | student |
  22        | student3 | C1 | student |
  23      And I log in as "teacher1"
  24      And I follow "Course 1"
  25      And I turn editing mode on
  26  
  27    Scenario: Enable the choice include inactive option and check that responses from inactive students are visible
  28      Given I add a "Choice" to section "1" and I fill the form with:
  29        | Choice name | Choice name |
  30        | Description | Choice Description |
  31        | option[0] | Option 1 |
  32        | option[1] | Option 2 |
  33        | option[2] | Option 3 |
  34        | Include responses from inactive/suspended users | Yes |
  35      And I log out
  36      And I log in as "student1"
  37      And I follow "Course 1"
  38      And I choose "Option 1" from "Choice name" choice activity
  39      And I log out
  40      And I log in as "student2"
  41      And I follow "Course 1"
  42      And I choose "Option 2" from "Choice name" choice activity
  43      And I log out
  44      And I log in as "student3"
  45      And I follow "Course 1"
  46      And I choose "Option 3" from "Choice name" choice activity
  47      And I log out
  48      And the following "course enrolments" exist:
  49        | user | course | role | status |
  50        | student1 | C1 | student | 1 |
  51      When I log in as "teacher1"
  52      And I follow "Course 1"
  53      And I follow "Choice name"
  54      Then I should see "View 3 responses"
  55      And I follow "View 3 responses"
  56      And I should see "Student 1"
  57      And I should see "Student 2"
  58      And I should see "Student 3"
  59      And I log out
  60      And the following "course enrolments" exist:
  61        | user | course | role | timestart |
  62        | student2 | C1 | student | 2145830400 |
  63      When I log in as "teacher1"
  64      And I follow "Course 1"
  65      And I follow "Choice name"
  66      Then I should see "View 3 responses"
  67      And I follow "View 3 responses"
  68      And I should see "Student 1"
  69      And I should see "Student 2"
  70      And I should see "Student 3"
  71      And I log out
  72      And the following "course enrolments" exist:
  73        | user | course | role | timeend |
  74        | student3 | C1 | student | 1425168000 |
  75      When I log in as "teacher1"
  76      And I follow "Course 1"
  77      And I follow "Choice name"
  78      Then I should see "View 3 responses"
  79      And I follow "View 3 responses"
  80      And I should see "Student 1"
  81      And I should see "Student 2"
  82      And I should see "Student 3"
  83      And I log out
  84  
  85    Scenario: Disable the choice include inactive option and check that responses from inactive students are not visible
  86      Given I add a "Choice" to section "1" and I fill the form with:
  87        | Choice name | Choice name |
  88        | Description | Choice Description |
  89        | option[0] | Option 1 |
  90        | option[1] | Option 2 |
  91        | option[2] | Option 3 |
  92        | Include responses from inactive/suspended users | No |
  93      And I log out
  94      And I log in as "student1"
  95      And I follow "Course 1"
  96      And I choose "Option 1" from "Choice name" choice activity
  97      And I log out
  98      And I log in as "student2"
  99      And I follow "Course 1"
 100      And I choose "Option 2" from "Choice name" choice activity
 101      And I log out
 102      And I log in as "student3"
 103      And I follow "Course 1"
 104      And I choose "Option 3" from "Choice name" choice activity
 105      And I log out
 106      And the following "course enrolments" exist:
 107        | user | course | role | status |
 108        | student1 | C1 | student | 1 |
 109      When I log in as "teacher1"
 110      And I follow "Course 1"
 111      And I follow "Choice name"
 112      Then I should see "View 2 responses"
 113      And I follow "View 2 responses"
 114      And I should not see "Student 1"
 115      And I should see "Student 2"
 116      And I should see "Student 3"
 117      And I log out
 118      And the following "course enrolments" exist:
 119        | user | course | role | timestart |
 120        | student2 | C1 | student | 2145830400 |
 121      When I log in as "teacher1"
 122      And I follow "Course 1"
 123      And I follow "Choice name"
 124      Then I should see "View 1 responses"
 125      And I follow "View 1 responses"
 126      And I should not see "Student 1"
 127      And I should not see "Student 2"
 128      And I should see "Student 3"
 129      And I log out
 130      And the following "course enrolments" exist:
 131        | user | course | role | timeend |
 132        | student3 | C1 | student | 1425168000 |
 133      When I log in as "teacher1"
 134      And I follow "Course 1"
 135      And I follow "Choice name"
 136      Then I should see "View 0 responses"
 137      And I follow "View 0 responses"
 138      And I should not see "Student 1"
 139      And I should not see "Student 2"
 140      And I should not see "Student 3"
 141      And I log out


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