[ Index ]

PHP Cross Reference of Unnamed Project

title

Body

[close]

/completion/tests/behat/ -> restrict_activity_by_date.feature (source)

   1  @core @core_completion
   2  Feature: Restrict activity availability through date conditions
   3    In order to control activity access through date condition
   4    As a teacher
   5    I need to set allow access dates to restrict activity access
   6  
   7    Background:
   8      Given the following "courses" exist:
   9        | fullname | shortname | category |
  10        | Course 1 | C1 | 0 |
  11      And the following "users" exist:
  12        | username | firstname | lastname | email |
  13        | teacher1 | Teacher | Frist | teacher1@example.com |
  14        | student1 | Student | First | student1@example.com |
  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 am on site homepage
  21      And I follow "Course 1"
  22      And I turn editing mode on
  23      # Adding the page like this because id_available*_enabled needs to be clicked to trigger the action.
  24      And I add a "Assignment" to section "1"
  25      And I expand all fieldsets
  26  
  27    @javascript
  28    Scenario: Show activity greyed-out to students when available from date is in future
  29      Given I click on "Add restriction..." "button"
  30      And I click on "Date" "button" in the "Add restriction..." "dialogue"
  31      And I set the following fields to these values:
  32        | Assignment name | Test assignment 1 |
  33        | Description | This assignment is restricted by date |
  34        | assignsubmission_onlinetext_enabled | 1 |
  35        | assignsubmission_file_enabled | 0 |
  36        | x[day] | 31 |
  37        | x[month] | 12 |
  38        | x[year] | 2037 |
  39      And I press "Save and return to course"
  40      And I log out
  41      When I log in as "student1"
  42      And I am on site homepage
  43      And I follow "Course 1"
  44      Then I should see "Available from 31 December 2037"
  45      And "Test assignment 1" activity should be hidden
  46      And I log out
  47  
  48    @javascript
  49    Scenario: Show activity hidden to students when available until date is in past
  50      Given I click on "Add restriction..." "button"
  51      And I click on "Date" "button" in the "Add restriction..." "dialogue"
  52      And I set the following fields to these values:
  53        | Assignment name | Test assignment 2 |
  54        | Description | This assignment is restricted by date |
  55        | assignsubmission_onlinetext_enabled | 1 |
  56        | assignsubmission_file_enabled | 0 |
  57        | x[day] | 1 |
  58        | x[month] | 2 |
  59        | x[year] | 2013 |
  60        | Direction | until |
  61      # Click eye icon to hide it when not available.
  62      And I click on ".availability-item .availability-eye img" "css_element"
  63      And I press "Save and return to course"
  64      And I log out
  65      When I log in as "student1"
  66      And I am on site homepage
  67      And I follow "Course 1"
  68      Then I should not see "Test assignment 2"


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