Skip to content
Permalink
Browse files

MDL-44070 Behat: Fixed restrict_activity_by_date.feature

  • Loading branch information...
sammarshallou authored and stronk7 committed Apr 9, 2014
1 parent ae90dec commit 3e9c7420d3c7019f9463f512a09e3630b48fbdc3
Showing with 14 additions and 11 deletions.
  1. +14 −11 completion/tests/behat/restrict_activity_by_date.feature
@@ -29,36 +29,39 @@ Feature: Restrict activity availability through date conditions

@javascript
Scenario: Show activity greyed-out to students when available from date is in future
Given I click on "id_availablefrom_enabled" "checkbox"
Given I click on "Add restriction..." "button"
And I click on "Date" "button" in the "Add restriction..." "dialogue"
And I set the following fields to these values:
| Assignment name | Test assignment 1 |
| Description | This assignment is restricted by date |
| assignsubmission_onlinetext_enabled | 1 |
| assignsubmission_file_enabled | 0 |
| id_availablefrom_day | 31 |
| id_availablefrom_month | 12 |
| id_availablefrom_year | 2037 |
| id_showavailability | 1 |
| x[day] | 31 |
| x[month] | 12 |
| x[year] | 2037 |
And I press "Save and return to course"
And I log out
When I log in as "student1"
And I follow "Course 1"
Then I should see "Available from 31 December 2037."
Then I should see "Available from 31 December 2037"
And "Test assignment 1" activity should be hidden
And I log out

@javascript
Scenario: Show activity hidden to students when available until date is in past
Given I click on "id_availableuntil_enabled" "checkbox"
Given I click on "Add restriction..." "button"
And I click on "Date" "button" in the "Add restriction..." "dialogue"
And I set the following fields to these values:
| Assignment name | Test assignment 2 |
| Description | This assignment is restricted by date |
| assignsubmission_onlinetext_enabled | 1 |
| assignsubmission_file_enabled | 0 |
| id_availableuntil_day | 1 |
| id_availableuntil_month | 2 |
| id_availableuntil_year | 2013 |
| id_showavailability | 0 |
| x[day] | 1 |
| x[month] | 2 |
| x[year] | 2013 |
| Direction | until |
# Click eye icon to hide it when not available.
And I click on ".availability-item .availability-eye img" "css_element"
And I press "Save and return to course"
And I log out
When I log in as "student1"

0 comments on commit 3e9c742

Please sign in to comment.
You can’t perform that action at this time.