MDL-46929 mod_forum: behat fixes

- Keep old scenarios being non-javascript.
- Move the tags stuff to recently added scenario.
- Change some "my" by "your" to avoid problems detecting results
  while keeping previous tests (based on "subject") working.
This commit is contained in:
Eloy Lafuente (stronk7)
2017-04-17 11:44:00 +02:00
parent a9d3bf7666
commit 43bb3b77a5
+19 -11
View File
@@ -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"