[ Index ]

PHP Cross Reference of Unnamed Project

title

Body

[close]

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

   1  @mod @mod_choice
   2  Feature: Teacher can choose whether to allow students to change their choice response
   3    In order to allow students to change their choice
   4    As a teacher
   5    I need to enable the option to change the choice
   6  
   7    Scenario: Add a choice activity and complete the activity as a student
   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 | category |
  14        | Course 1 | C1 | 0 |
  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 "teacher1"
  20      And I follow "Course 1"
  21      And I turn editing mode on
  22      And I add a "Choice" to section "1" and I fill the form with:
  23        | Choice name | Choice name |
  24        | Description | Choice Description |
  25        | Allow choice to be updated | No |
  26        | option[0] | Option 1 |
  27        | option[1] | Option 2 |
  28      And I log out
  29      When I log in as "student1"
  30      And I follow "Course 1"
  31      And I choose "Option 1" from "Choice name" choice activity
  32      Then I should see "Your selection: Option 1"
  33      And I should see "Your choice has been saved"
  34      And "Save my choice" "button" should not exist
  35      And I log out
  36      And I log in as "teacher1"
  37      And I follow "Course 1"
  38      And I follow "Choice name"
  39      And I follow "Edit settings"
  40      And I set the following fields to these values:
  41        | Allow choice to be updated | Yes |
  42      And I press "Save and display"
  43      And I log out
  44      And I log in as "student1"
  45      And I follow "Course 1"
  46      And I follow "Choice name"
  47      And I should see "Your selection: Option 1"
  48      And "Save my choice" "button" should exist
  49      And "Remove my choice" "link" should exist
  50      And I set the field "Option 2" to "1"
  51      And I press "Save my choice"
  52      And I should see "Your choice has been saved"
  53      And I should see "Your selection: Option 2"


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