diff --git a/mod/forum/tests/behat/advanced_search.feature b/mod/forum/tests/behat/advanced_search.feature index f80c565668b..558ec83ece8 100644 --- a/mod/forum/tests/behat/advanced_search.feature +++ b/mod/forum/tests/behat/advanced_search.feature @@ -31,11 +31,10 @@ Feature: The forum search allows users to perform advanced searches for forum po And I add a new topic to "Announcements" forum with: | Subject | My subject | | Message | My message | - | Tags | SearchedTag | And I am on "Course 1" course homepage And I add a new topic to "Announcements" forum with: - | Subject | My subjective| - | Message | My long message | + | Subject | Your subjective| + | Message | Your long message | And I log out Scenario: Perform an advanced search using any term @@ -47,7 +46,7 @@ Feature: The forum search allows users to perform advanced searches for forum po And I set the field "words" to "subject" When I press "Search forums" Then I should see "My subject" - And I should see "My subjective" + And I should see "Your subjective" Scenario: Perform an advanced search avoiding words Given I log in as "student1" @@ -59,7 +58,7 @@ Feature: The forum search allows users to perform advanced searches for forum po And I set the field "notwords" to "subjective" When I press "Search forums" Then I should see "My subject" - And I should not see "My subjective" + And I should not see "Your subjective" Scenario: Perform an advanced search using whole words Given database family used is one of the following: @@ -73,7 +72,7 @@ Feature: The forum search allows users to perform advanced searches for forum po And I set the field "fullwords" to "subject" When I press "Search forums" Then I should see "My subject" - And I should not see "My subjective" + And I should not see "Your subjective" Scenario: Perform an advanced search matching the subject Given I log in as "student1" @@ -84,7 +83,7 @@ Feature: The forum search allows users to perform advanced searches for forum po And I set the field "subject" to "subjective" When I press "Search forums" Then I should not see "My message" - And I should see "My subjective" + And I should see "Your subjective" Scenario: Perform an advanced search matching the author Given I log in as "teacher2" @@ -109,14 +108,23 @@ Feature: The forum search allows users to perform advanced searches for forum po And I follow "Announcements" And I press "Search forums" And I should see "Advanced search" - And I set the field "subject" to "my subjective" + And I set the field "subject" to "your subjective" When I press "Search forums" Then I should not see "My message" - And I should see "My subjective" + And I should see "Your subjective" @javascript Scenario: Perform an advanced search using tags - Given I log in as "student1" + Given I log in as "teacher1" + And I am on "Course 1" course homepage + And I follow "Announcements" + And I follow "My subject" + And I follow "Edit" + And I set the following fields to these values: + | Tags | SearchedTag | + And I press "Save changes" + And I log out + And I log in as "student1" And I am on "Course 1" course homepage And I follow "Announcements" And I press "Search forums" @@ -125,4 +133,4 @@ Feature: The forum search allows users to perform advanced searches for forum po And I click on "[data-value='SearchedTag']" "css_element" When I press "Search forums" Then I should see "My subject" - And I should not see "My subjective" + And I should not see "Your subjective"