2013-04-23 12:56:40 +08:00
|
|
|
@core @core_course @_cross_browser
|
2013-03-21 12:01:04 +08:00
|
|
|
Feature: Toggle activities visibility from the course page
|
|
|
|
In order to delay activities availability
|
2013-05-09 18:38:13 +08:00
|
|
|
As a teacher
|
2013-03-21 12:01:04 +08:00
|
|
|
I need to quickly change the visibility of an activity
|
|
|
|
|
|
|
|
@javascript
|
|
|
|
Scenario: Hide/Show toggle with javascript enabled
|
2014-02-21 15:18:07 +08:00
|
|
|
Given the following "users" exist:
|
2013-03-21 12:01:04 +08:00
|
|
|
| username | firstname | lastname | email |
|
|
|
|
| teacher1 | Teacher | 1 | teacher1@asd.com |
|
|
|
|
| student1 | Student | 1 | student1@asd.com |
|
2014-02-21 15:18:07 +08:00
|
|
|
And the following "courses" exist:
|
2013-03-21 12:01:04 +08:00
|
|
|
| fullname | shortname | format |
|
|
|
|
| Course 1 | C1 | topics |
|
2014-02-21 15:18:07 +08:00
|
|
|
And the following "course enrolments" exist:
|
2013-03-21 12:01:04 +08:00
|
|
|
| user | course | role |
|
|
|
|
| teacher1 | C1 | editingteacher |
|
|
|
|
| student1 | C1 | student |
|
|
|
|
And I log in as "teacher1"
|
|
|
|
And I follow "Course 1"
|
|
|
|
And I turn editing mode on
|
2013-04-25 14:55:45 +08:00
|
|
|
And I add a "Forum" to section "1" and I fill the form with:
|
2013-03-21 12:01:04 +08:00
|
|
|
| Forum name | Test forum name |
|
|
|
|
| Description | Test forum description |
|
|
|
|
| Visible | Show |
|
2013-11-04 19:33:36 +08:00
|
|
|
When I open "Test forum name" actions menu
|
|
|
|
And I click on "Hide" "link" in the "Test forum name" activity
|
2013-03-21 12:01:04 +08:00
|
|
|
Then "Test forum name" activity should be hidden
|
2013-11-06 10:56:29 +08:00
|
|
|
And I open "Test forum name" actions menu
|
2013-04-19 15:44:34 +08:00
|
|
|
And I click on "Show" "link" in the "Test forum name" activity
|
2013-03-21 12:01:04 +08:00
|
|
|
And "Test forum name" activity should be visible
|
2013-11-06 10:56:29 +08:00
|
|
|
And I open "Test forum name" actions menu
|
2013-04-19 15:44:34 +08:00
|
|
|
And I click on "Hide" "link" in the "Test forum name" activity
|
2013-03-21 12:01:04 +08:00
|
|
|
And "Test forum name" activity should be hidden
|
|
|
|
And I reload the page
|
|
|
|
And "Test forum name" activity should be hidden
|
|
|
|
And I log out
|
|
|
|
And I log in as "student1"
|
|
|
|
And I follow "Course 1"
|
|
|
|
And "Test forum name" activity should be hidden
|
2014-02-03 19:55:43 +08:00
|
|
|
|
|
|
|
@javascript
|
|
|
|
Scenario: Activities can be shown and hidden inside a hidden section
|
2014-02-21 15:18:07 +08:00
|
|
|
Given the following "users" exist:
|
2014-02-03 19:55:43 +08:00
|
|
|
| username | firstname | lastname | email |
|
|
|
|
| teacher1 | Teacher | 1 | teacher1@asd.com |
|
2014-02-21 15:18:07 +08:00
|
|
|
And the following "courses" exist:
|
2014-02-03 19:55:43 +08:00
|
|
|
| fullname | shortname | format | numsections |
|
|
|
|
| Course 1 | C1 | topics | 2 |
|
2014-02-21 15:18:07 +08:00
|
|
|
And the following "course enrolments" exist:
|
2014-02-03 19:55:43 +08:00
|
|
|
| user | course | role |
|
|
|
|
| teacher1 | C1 | editingteacher |
|
|
|
|
And I log in as "teacher1"
|
|
|
|
And I follow "Course 1"
|
|
|
|
And I turn editing mode on
|
|
|
|
And I add a "Forum" to section "2" and I fill the form with:
|
|
|
|
| Forum name | Test forum name |
|
|
|
|
| Description | Test forum description |
|
|
|
|
| Visible | Show |
|
|
|
|
When I hide section "2"
|
|
|
|
Then "Test forum name" activity should be hidden
|
|
|
|
And I open "Test forum name" actions menu
|
|
|
|
And I click on "Show" "link" in the "Test forum name" activity
|
|
|
|
And "Test forum name" activity should be visible
|
|
|
|
And I open "Test forum name" actions menu
|
|
|
|
And I click on "Hide" "link" in the "Test forum name" activity
|
|
|
|
And "Test forum name" activity should be hidden
|
|
|
|
|
|
|
|
@javascript
|
|
|
|
Scenario: Activities can be shown and hidden inside an orphaned section
|
2014-02-21 15:18:07 +08:00
|
|
|
Given the following "users" exist:
|
2014-02-03 19:55:43 +08:00
|
|
|
| username | firstname | lastname | email |
|
|
|
|
| teacher1 | Teacher | 1 | teacher1@asd.com |
|
2014-02-21 15:18:07 +08:00
|
|
|
And the following "courses" exist:
|
2014-02-03 19:55:43 +08:00
|
|
|
| fullname | shortname | format | numsections |
|
|
|
|
| Course 1 | C1 | topics | 2 |
|
2014-02-21 15:18:07 +08:00
|
|
|
And the following "course enrolments" exist:
|
2014-02-03 19:55:43 +08:00
|
|
|
| user | course | role |
|
|
|
|
| teacher1 | C1 | editingteacher |
|
|
|
|
And I log in as "teacher1"
|
|
|
|
And I follow "Course 1"
|
|
|
|
And I turn editing mode on
|
|
|
|
And I add a "Forum" to section "2" and I fill the form with:
|
|
|
|
| Forum name | Test forum name |
|
|
|
|
| Description | Test forum description |
|
|
|
|
| Visible | Show |
|
|
|
|
When I click on ".reduce-sections" "css_element"
|
|
|
|
Then "Test forum name" activity should be visible
|
|
|
|
And I open "Test forum name" actions menu
|
|
|
|
And I click on "Hide" "link" in the "Test forum name" activity
|
|
|
|
And "Test forum name" activity should be hidden
|
|
|
|
And I open "Test forum name" actions menu
|
|
|
|
And I click on "Show" "link" in the "Test forum name" activity
|
|
|
|
And "Test forum name" activity should be visible
|