|
| 1 | +@mod @mod_hsuforum |
| 2 | +Feature: In Open Forums users can change start and end date and the changes remain |
| 3 | + As a teacher |
| 4 | + I need to set a discussion time start and time end and it should be maintained through time |
| 5 | + |
| 6 | + Background: |
| 7 | + Given the following "users" exist: |
| 8 | + | username | firstname | lastname | email | |
| 9 | + | teacher1 | Teacher | 1 | teacher1@example.com | |
| 10 | + And the following "courses" exist: |
| 11 | + | fullname | shortname | category | |
| 12 | + | Course 1 | C1 | 0 | |
| 13 | + And the following "course enrolments" exist: |
| 14 | + | user | course | role | |
| 15 | + | teacher1 | C1 | editingteacher | |
| 16 | + And I log in as "teacher1" |
| 17 | + And the following config values are set as admin: |
| 18 | + | enabletimedposts | 1 | hsuforum | |
| 19 | + And I am on "Course 1" course homepage with editing mode on |
| 20 | + And I add a "Open Forum" to section "1" and I fill the form with: |
| 21 | + | Forum name | Test forum name | |
| 22 | + | Description | Test forum description | |
| 23 | + And I add a new discussion to "Test forum name" Open Forum with: |
| 24 | + | Subject | Discussion 1 | |
| 25 | + | Message | Discussion contents 1, first message | |
| 26 | + | timestart[enabled] | 1 | |
| 27 | + | timestart[year] | 2014 | |
| 28 | + | timeend[enabled] | 1 | |
| 29 | + | timeend[year] | 2020 | |
| 30 | + And I log out |
| 31 | + |
| 32 | + @javascript |
| 33 | + Scenario: Teacher should see the start and end date after editing post |
| 34 | + Given I log in as "teacher1" |
| 35 | + And I am on "Course 1" course homepage |
| 36 | + And I follow "Test forum name" |
| 37 | + And I follow "Discussion 1" |
| 38 | + And I click on "//div[contains(@class, 'hsuforum-thread-tools')]//a[contains(text(), 'Edit')]" "xpath_element" |
| 39 | + And I click on "//form[contains(@class, 'hsuforum-discussion')]//button[contains(@type, 'submit')]" "xpath_element" |
| 40 | + And I click on "//div[contains(@class, 'hsuforum-thread-tools')]//a[contains(text(), 'Edit')]" "xpath_element" |
| 41 | + And I follow "Use advanced editor and additional options" |
| 42 | + Then "input[name='timestart[enabled]'][checked]" "css_element" should exist |
| 43 | + And "input[name='timeend[enabled]'][checked]" "css_element" should exist |
| 44 | + And the following fields match these values: |
| 45 | + | timestart[year] | 2014 | |
| 46 | + | timeend[year] | 2020 | |
| 47 | + Then I set the following fields to these values: |
| 48 | + | timestart[enabled] | 0 | |
| 49 | + Then I press "Save changes" |
| 50 | + Then I click on "//div[contains(@class, 'hsuforum-thread-tools')]//a[contains(text(), 'Edit')]" "xpath_element" |
| 51 | + And I follow "Use advanced editor and additional options" |
| 52 | + Then "input[name='timestart[enabled]'][checked]" "css_element" should not exist |
| 53 | + And "input[name='timeend[enabled]'][checked]" "css_element" should exist |
| 54 | + And the following fields match these values: |
| 55 | + | timeend[year] | 2020 | |
0 commit comments