[ Index ]

PHP Cross Reference of Unnamed Project

title

Body

[close]

/mod/forum/tests/behat/ -> advanced_search.feature (source)

   1  @mod @mod_forum
   2  Feature: The forum search allows users to perform advanced searches for forum posts
   3    In order to perform an advanced search for a forum post
   4    As a teacher
   5    I can use the search feature
   6  
   7    Background:
   8      Given the following "users" exist:
   9        | username | firstname | lastname | email | idnumber |
  10        | teacher1 | Teacher | ONE | teacher1@example.com | T1 |
  11        | teacher2 | Teacher | TWO | teacher2@example.com | T1 |
  12        | student1 | Student | 1 | student1@example.com | S1 |
  13      And the following "courses" exist:
  14        | fullname | shortname | category |
  15        | Course 1 | C1 | 0 |
  16      And the following "course enrolments" exist:
  17        | user | course | role |
  18        | teacher1 | C1 | editingteacher |
  19        | teacher2 | C1 | editingteacher |
  20        | student1 | C1 | student |
  21      And I log in as "teacher1"
  22      And I follow "Course 1"
  23      And I navigate to "Edit settings" node in "Course administration"
  24      And I set the field "id_newsitems" to "1"
  25      And I press "Save and display"
  26      And I add a new topic to "Announcements" forum with:
  27        | Subject | My subject |
  28        | Message | My message |
  29      And I follow "Course 1"
  30      And I add a new topic to "Announcements" forum with:
  31        | Subject | My subjective|
  32        | Message | My long message |
  33      And I log out
  34  
  35    Scenario: Perform an advanced search using any term
  36      Given I log in as "student1"
  37      And I follow "Course 1"
  38      And I follow "Announcements"
  39      And I press "Search forums"
  40      And I should see "Advanced search"
  41      And I set the field "words" to "subject"
  42      When I press "Search forums"
  43      Then I should see "My subject"
  44      And I should see "My subjective"
  45  
  46    Scenario: Perform an advanced search avoiding words
  47      Given I log in as "student1"
  48      And I follow "Course 1"
  49      And I follow "Announcements"
  50      And I press "Search forums"
  51      And I should see "Advanced search"
  52      And I set the field "words" to "My"
  53      And I set the field "notwords" to "subjective"
  54      When I press "Search forums"
  55      Then I should see "My subject"
  56      And I should not see "My subjective"
  57  
  58    Scenario: Perform an advanced search using whole words
  59      Given database family used is one of the following:
  60        | mysql |
  61        | postgres |
  62      And I log in as "student1"
  63      And I follow "Course 1"
  64      And I follow "Announcements"
  65      And I press "Search forums"
  66      And I should see "Advanced search"
  67      And I set the field "fullwords" to "subject"
  68      When I press "Search forums"
  69      Then I should see "My subject"
  70      And I should not see "My subjective"
  71  
  72    Scenario: Perform an advanced search matching the subject
  73      Given I log in as "student1"
  74      And I follow "Course 1"
  75      And I follow "Announcements"
  76      And I press "Search forums"
  77      And I should see "Advanced search"
  78      And I set the field "subject" to "subjective"
  79      When I press "Search forums"
  80      Then I should not see "My message"
  81      And I should see "My subjective"
  82  
  83    Scenario: Perform an advanced search matching the author
  84      Given I log in as "teacher2"
  85      And I follow "Course 1"
  86      And I add a new topic to "Announcements" forum with:
  87        | Subject | My Subjects |
  88        | Message | My message |
  89      And I log out
  90      When I log in as "student1"
  91      And I follow "Course 1"
  92      And I follow "Announcements"
  93      And I press "Search forums"
  94      And I should see "Advanced search"
  95      And I set the field "user" to "TWO"
  96      And I press "Search forums"
  97      Then I should see "Teacher TWO"
  98      And I should not see "Teacher ONE"
  99  
 100    Scenario: Perform an advanced search with multiple words
 101      Given I log in as "student1"
 102      And I follow "Course 1"
 103      And I follow "Announcements"
 104      And I press "Search forums"
 105      And I should see "Advanced search"
 106      And I set the field "subject" to "my subjective"
 107      When I press "Search forums"
 108      Then I should not see "My message"
 109      And I should see "My subjective"


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