Ir a la última revisión | Autoría | Comparar con el anterior | Ultima modificación | Ver Log |
@format @format_topicsFeature: Sections can be edited and deleted in custom sections formatIn order to rearrange my course contentsAs a teacherI need to edit and delete sectionsBackground:Given the following "users" exist:| username | firstname | lastname | email || teacher1 | Teacher | 1 | teacher1@example.com |And the following "courses" exist:| fullname | shortname | format | coursedisplay | numsections | initsections || Course 1 | C1 | topics | 0 | 5 | 1 || Course 2 | C2 | topics | 0 | 1 | 0 |And the following "activities" exist:| activity | name | intro | course | idnumber | section || assign | Test assignment name | Test assignment description | C1 | assign1 | 0 || book | Test book name | | C1 | book1 | 1 || lesson | Test lesson name | Test lesson description | C1 | lesson1 | 4 || choice | Test choice name | Test choice description | C1 | choice1 | 5 |And the following "course enrolments" exist:| user | course | role || teacher1 | C1 | editingteacher || teacher1 | C2 | editingteacher |And I log in as "teacher1"Scenario: View the default name of the general section in custom sections formatGiven I am on "Course 1" course homepage with editing mode onWhen I edit the section "0"Then the field "Section name" matches value ""And I should see "General"Scenario: Edit the default name of the general section in custom sections formatGiven I am on "Course 1" course homepage with editing mode onAnd I should see "General" in the "General" "section"When I edit the section "0" and I fill the form with:| Section name | This is the general section |Then I should see "This is the general section" in the "page" "region"Scenario: View the default name of the second section in custom sections formatGiven I am on "Course 2" course homepage with editing mode onWhen I edit the section "1"Then the field "Section name" matches value ""And I should see "New section"Scenario: Edit section summary in custom sections formatGiven I am on "Course 1" course homepage with editing mode onWhen I edit the section "2" and I fill the form with:| Description | Welcome to section 2 |Then I should see "Welcome to section 2" in the "page" "region"Scenario: Edit section default name in custom sections formatGiven I am on "Course 1" course homepage with editing mode onWhen I edit the section "2" and I fill the form with:| Section name | This is the second section |Then I should see "This is the second section" in the "page" "region"And I should not see "Section 2" in the "region-main" "region"@javascriptScenario: Inline edit section name in custom sections formatGiven I am on "Course 1" course homepage with editing mode onWhen I set the field "Edit section name" in the "Section 1" "section" to "Midterm evaluation"Then I should not see "Section 1" in the "region-main" "region"And "New name for section" "field" should not existAnd I should see "Midterm evaluation" in the "Midterm evaluation" "section"And I am on "Course 1" course homepageAnd I should not see "Section 1" in the "region-main" "region"And I should see "Midterm evaluation" in the "Midterm evaluation" "section"Scenario: Deleting the last section in custom sections formatGiven I am on "Course 1" course homepage with editing mode onWhen I delete section "5"Then I should see "Are you absolutely sure you want to completely delete \"Section 5\" and all the activities it contains?"And I press "Delete"And I should not see "Section 5"And I should see "Section 4"Scenario: Deleting the middle section in custom sections formatGiven I am on "Course 1" course homepage with editing mode onWhen I delete section "4"And I press "Delete"Then I should not see "Section 4"And I should see "Section 5"And I should not see "Test lesson name"And I should see "Test choice name" in the "Section 5" "section"@javascriptScenario: Adding sections at the end of a custom sections formatGiven I am on "Course 1" course homepage with editing mode onWhen I click on "Add section" "link" in the "course-addsection" "region"Then I should see "New section" in the "New section" "section"And I should see "Test choice name" in the "Section 5" "section"@javascriptScenario: Adding sections between in custom sections formatGiven I am on "Course 1" course homepage with editing mode onWhen I hover over the "Add section" "link" in the "Section 4" "section"And I click on "Add section" "link" in the "Section 4" "section"Then I should see "New section" in the "New section" "section"And I should see "Test choice name" in the "Section 5" "section"And I should not see "Test choice name" in the "New section" "section"@javascriptScenario: Add a section and then add an activity in itGiven I am on "Course 1" course homepage with editing mode onWhen I click on "Add section" "link" in the "course-addsection" "region"And I add an assign activity to course "Course 1" section "6" and I fill the form with:| Assignment name | Very new activity || Description | Test |Then I should see "Very new activity" in the "New section" "section"@javascriptScenario: Copy section permalink URL to clipboardGiven I am on "Course 1" course homepage with editing mode onWhen I open section "1" edit menuAnd I click on "Permalink" "link" in the "Section 1" "section"And I click on "Copy to clipboard" "link" in the "Permalink" "dialogue"Then I should see "Text copied to clipboard"