|
| 1 | +@format @format_onetopic |
| 2 | +Feature: Testing subtopics_visibility in format_onetopic |
| 3 | + In order to keep subtopics aligned with their parents |
| 4 | + As a student I should not see subtopics of hidden parent sections |
| 5 | + |
| 6 | + Background: |
| 7 | + Given the following "users" exist: |
| 8 | + | username | firstname | lastname | email | |
| 9 | + | teacher1 | Teacher | 1 | teacher1@example.com | |
| 10 | + | student1 | Student | 1 | student1@example.com | |
| 11 | + And the following "courses" exist: |
| 12 | + | fullname | shortname | format | coursedisplay | numsections | hiddensections | |
| 13 | + | Course 1 | C1 | onetopic | 0 | 5 | 1 | |
| 14 | + And the following "course enrolments" exist: |
| 15 | + | user | course | role | |
| 16 | + | teacher1 | C1 | editingteacher | |
| 17 | + | student1 | C1 | student | |
| 18 | + And I log in as "teacher1" |
| 19 | + |
| 20 | + @javascript |
| 21 | + Scenario: Subtopics of hidden parent sections are not visible to students |
| 22 | + Given I am on "Course 1" course homepage with editing mode on |
| 23 | + When I click on "Topic 2" "link" in the "#page-content ul.nav.nav-tabs" "css_element" |
| 24 | + And I edit the section "2" and I fill the form with: |
| 25 | + | Level | Child of previous tab | |
| 26 | + And I click on "Topic 4" "link" in the "#page-content ul.nav.nav-tabs" "css_element" |
| 27 | + And I edit the section "4" and I fill the form with: |
| 28 | + | Level | Child of previous tab | |
| 29 | + And I click on "Topic 3" "link" in the "#page-content ul.nav.nav-tabs" "css_element" |
| 30 | + And I open section "3" edit menu |
| 31 | + And I click on "Hide" "link" |
| 32 | + And I log out |
| 33 | + When I log in as "student1" |
| 34 | + And I am on "Course 1" course homepage |
| 35 | + And I click on "Topic 1" "link" in the "#page-content ul.nav.nav-tabs" "css_element" |
| 36 | + Then I should see "Topic 2" in the "#page-content .onetopic-tab-body" "css_element" |
| 37 | + And I should not see "Topic 4" in the "#page-content .onetopic-tab-body" "css_element" |
0 commit comments