[ Index ]

PHP Cross Reference of Unnamed Project

title

Body

[close]

/course/format/weeks/tests/behat/ -> edit_delete_sections.feature (source)

   1  @format @format_weeks
   2  Feature: Sections can be edited and deleted in weeks format
   3    In order to rearrange my course contents
   4    As a teacher
   5    I need to edit and Delete weeks
   6  
   7    Background:
   8      Given the following "users" exist:
   9        | username | firstname | lastname | email            |
  10        | teacher1 | Teacher   | 1        | teacher1@example.com |
  11      And the following "courses" exist:
  12        | fullname | shortname | format | coursedisplay | numsections | startdate |
  13        | Course 1 | C1        | weeks  | 0             | 5           | 957139200 |
  14      And the following "activities" exist:
  15        | activity   | name                   | intro                         | course | idnumber    | section |
  16        | assign     | Test assignment name   | Test assignment description   | C1     | assign1     | 0       |
  17        | book       | Test book name         | Test book description         | C1     | book1       | 1       |
  18        | chat       | Test chat name         | Test chat description         | C1     | chat1       | 4       |
  19        | choice     | Test choice name       | Test choice description       | C1     | choice1     | 5       |
  20      And the following "course enrolments" exist:
  21        | user | course | role |
  22        | teacher1 | C1 | editingteacher |
  23      And I log in as "teacher1"
  24      And I follow "Course 1"
  25      And I turn editing mode on
  26  
  27    Scenario: View the default name of the general section in weeks format
  28      When I click on "Edit section" "link" in the "li#section-0" "css_element"
  29      Then I should see "Use default section name [General]"
  30  
  31    Scenario: Edit the default name of the general section in weeks format
  32      When I click on "Edit section" "link" in the "li#section-0" "css_element"
  33      And I set the following fields to these values:
  34        | Use default section name | 0                           |
  35        | name                     | This is the general section |
  36      And I press "Save changes"
  37      Then I should see "This is the general section" in the "li#section-0" "css_element"
  38  
  39    Scenario: View the default name of the second section in weeks format
  40      When I click on "Edit week" "link" in the "li#section-2" "css_element"
  41      Then I should see "Use default section name [8 May - 14 May]"
  42  
  43    Scenario: Edit section summary in weeks format
  44      When I click on "Edit week" "link" in the "li#section-2" "css_element"
  45      And I set the following fields to these values:
  46        | Summary | Welcome to section 2 |
  47      And I press "Save changes"
  48      Then I should see "Welcome to section 2" in the "li#section-2" "css_element"
  49  
  50    Scenario: Edit section default name in weeks format
  51      Given I should see "8 May - 14 May" in the "li#section-2" "css_element"
  52      When I click on "Edit week" "link" in the "li#section-2" "css_element"
  53      And I set the following fields to these values:
  54        | Use default section name | 0                       |
  55        | name                     | This is the second week |
  56      And I press "Save changes"
  57      Then I should see "This is the second week" in the "li#section-2" "css_element"
  58      And I should not see "8 May - 14 May" in the "li#section-2" "css_element"
  59  
  60    @javascript
  61    Scenario: Inline edit section name in weeks format
  62      When I click on "Edit week name" "link" in the "li#section-1" "css_element"
  63      And I set the field "New name for week 1 May - 7 May" to "Midterm evaluation"
  64      And I press key "13" in the field "New name for week 1 May - 7 May"
  65      Then I should not see "1 May - 7 May" in the "#region-main" "css_element"
  66      And "New name for week" "field" should not exist
  67      And I should see "Midterm evaluation" in the "li#section-1" "css_element"
  68      And I follow "Course 1"
  69      And I should not see "1 May - 7 May" in the "#region-main" "css_element"
  70      And I should see "Midterm evaluation" in the "li#section-1" "css_element"
  71  
  72    Scenario: Deleting the last section in weeks format
  73      Given I should see "29 May - 4 June" in the "li#section-5" "css_element"
  74      When I delete section "5"
  75      Then I should see "Are you absolutely sure you want to completely delete \"29 May - 4 June\" and all the activities it contains?"
  76      And I press "Delete"
  77      And I should not see "29 May - 4 June"
  78      And I navigate to "Edit settings" node in "Course administration"
  79      And I expand all fieldsets
  80      And the field "Number of sections" matches value "4"
  81  
  82    Scenario: Deleting the middle section in weeks format
  83      Given I should see "29 May - 4 June" in the "li#section-5" "css_element"
  84      When I delete section "4"
  85      And I press "Delete"
  86      Then I should not see "29 May - 4 June"
  87      And I should not see "Test chat name"
  88      And I should see "Test choice name" in the "li#section-4" "css_element"
  89      And I navigate to "Edit settings" node in "Course administration"
  90      And I expand all fieldsets
  91      And the field "Number of sections" matches value "4"
  92  
  93    Scenario: Deleting the orphaned section in weeks format
  94      When I follow "Reduce the number of sections"
  95      Then I should see "Orphaned activities (section 5)" in the "li#section-5" "css_element"
  96      And I delete section "5"
  97      And I press "Delete"
  98      And I should not see "29 May - 4 June"
  99      And I should not see "Orphaned activities"
 100      And "li#section-5" "css_element" should not exist
 101      And I navigate to "Edit settings" node in "Course administration"
 102      And I expand all fieldsets
 103      And the field "Number of sections" matches value "4"
 104  
 105    Scenario: Deleting a section when orphaned section is present in weeks format
 106      When I follow "Reduce the number of sections"
 107      Then I should see "Orphaned activities (section 5)" in the "li#section-5" "css_element"
 108      And "li#section-5.orphaned" "css_element" should exist
 109      And "li#section-4.orphaned" "css_element" should not exist
 110      And I delete section "1"
 111      And I press "Delete"
 112      And I should not see "Test book name"
 113      And I should see "Orphaned activities (section 4)" in the "li#section-4" "css_element"
 114      And "li#section-5" "css_element" should not exist
 115      And "li#section-4.orphaned" "css_element" should exist
 116      And "li#section-3.orphaned" "css_element" should not exist


Generated: Thu Aug 11 10:00:09 2016 Cross-referenced by PHPXref 0.7.1