~ubuntu-branches/ubuntu/utopic/moodle/utopic

« back to all changes in this revision

Viewing changes to completion/tests/behat/restrict_activity_by_date.feature

  • Committer: Package Import Robot
  • Author(s): Thijs Kinkhorst
  • Date: 2014-05-12 16:10:38 UTC
  • mfrom: (36.1.3 sid)
  • Revision ID: package-import@ubuntu.com-20140512161038-puyqf65k4e0s8ytz
Tags: 2.6.3-1
New upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
    And I set the following administration settings values:
21
21
      | Enable conditional access | 1 |
22
22
    And I log out
 
23
    And I log in as "teacher1"
 
24
    And I follow "Course 1"
 
25
    And I turn editing mode on
 
26
    # Adding the page like this because id_available*_enabled needs to be clicked to trigger the action.
 
27
    And I add a "Assignment" to section "1"
 
28
    And I expand all fieldsets
23
29
 
24
30
  @javascript
25
31
  Scenario: Show activity greyed-out to students when available from date is in future
26
 
    Given I log in as "teacher1"
27
 
    And I follow "Course 1"
28
 
    And I turn editing mode on
29
 
    And I add a "Assignment" to section "1"
 
32
    Given I click on "id_availablefrom_enabled" "checkbox"
30
33
    And I fill the moodle form with:
31
34
      | Assignment name | Test assignment 1 |
32
35
      | Description | This assignment is restricted by date |
34
37
      | assignsubmission_file_enabled | 0 |
35
38
      | id_availablefrom_day | 31 |
36
39
      | id_availablefrom_month | 12 |
37
 
      | id_availablefrom_year | 2020 |
 
40
      | id_availablefrom_year | 2037 |
38
41
      | id_showavailability | 1 |
39
 
    And I click on "id_availablefrom_enabled" "checkbox"
40
42
    And I press "Save and return to course"
41
43
    And I log out
42
44
    When I log in as "student1"
43
45
    And I follow "Course 1"
44
 
    Then I should see "Available from 31 December 2020."
 
46
    Then I should see "Available from 31 December 2037."
45
47
    And "Test assignment 1" activity should be hidden
46
48
    And I log out
47
49
 
48
50
  @javascript
49
51
  Scenario: Show activity hidden to students when available until date is in past
50
 
    Given I log in as "teacher1"
51
 
    And I follow "Course 1"
52
 
    And I turn editing mode on
53
 
    And I add a "Assignment" to section "2"
 
52
    Given I click on "id_availableuntil_enabled" "checkbox"
54
53
    And I fill the moodle form with:
55
54
      | Assignment name | Test assignment 2 |
56
55
      | Description | This assignment is restricted by date |
60
59
      | id_availableuntil_month | 2 |
61
60
      | id_availableuntil_year | 2013 |
62
61
      | id_showavailability | 0 |
63
 
    And I click on "id_availableuntil_enabled" "checkbox"
64
62
    And I press "Save and return to course"
65
63
    And I log out
66
64
    When I log in as "student1"