[ Index ]

PHP Cross Reference of Unnamed Project

title

Body

[close]

/mod/glossary/tests/behat/ -> search_entries.feature (source)

   1  @mod @mod_glossary
   2  Feature: Glossary entries can be searched or browsed by alphabet, category, date or author
   3    In order to find entries in a glossary
   4    As a user
   5    I need to search the entries list by keyword, alphabet, category, date and author
   6  
   7    Background:
   8      Given the following "users" exist:
   9        | username | firstname | lastname | email |
  10        | teacher1 | Teacher | 1 | teacher1@example.com |
  11        | student1 | Student | 1 | student1@example.com |
  12      And the following "courses" exist:
  13        | fullname | shortname | category |
  14        | Course 1 | C1 | 0 |
  15      And the following "course enrolments" exist:
  16        | user | course | role |
  17        | teacher1 | C1 | editingteacher |
  18        | student1 | C1 | student |
  19      And the following "activities" exist:
  20        | activity | name               | intro                     | displayformat  | course | idnumber |
  21        | glossary | Test glossary name | Test glossary description | fullwithauthor | C1     | g1       |
  22      And I log in as "teacher1"
  23      And I follow "Course 1"
  24      And I follow "Test glossary name"
  25      And I add a glossary entries category named "The ones I like"
  26      And I add a glossary entries category named "All for you"
  27      And I add a glossary entry with the following data:
  28        | Concept | Eggplant |
  29        | Definition | Sour eggplants |
  30        | Categories | All for you |
  31      And I log out
  32      And I log in as "student1"
  33      And I follow "Course 1"
  34      And I follow "Test glossary name"
  35      And I add a glossary entry with the following data:
  36        | Concept | Cucumber |
  37        | Definition | Sweet cucumber |
  38        | Categories | The ones I like |
  39      And I log out
  40      And I log in as "teacher1"
  41      And I follow "Course 1"
  42      And I follow "Test glossary name"
  43  
  44    @javascript
  45    Scenario: Search by keyword and browse by alphabet
  46      When I set the field "hook" to "cucumber"
  47      And I press "Search"
  48      Then I should see "Sweet cucumber"
  49      And I should see "Search: cucumber"
  50      And I click on "E" "link" in the ".entrybox" "css_element"
  51      And I should see "Sour eggplants"
  52      And I should not see "Sweet cucumber"
  53      And I click on "X" "link" in the ".entrybox" "css_element"
  54      And I should not see "Sweet cucumber"
  55      And I should see "No entries found in this section"
  56  
  57    @javascript
  58    Scenario: Browse by category
  59      When I follow "Browse by category"
  60      And I set the field "Categories" to "The ones I like"
  61      Then I should see "Sweet cucumber"
  62      And I should not see "Sour eggplants"
  63      And I set the field "Categories" to "All for you"
  64      And I should see "Sour eggplants"
  65      And I should not see "Sweet cucumber"
  66  
  67    @javascript
  68    Scenario: Browse by date
  69      When I follow "Browse by date"
  70      And I follow "By creation date"
  71      Then "Delete: Eggplant" "link" should appear before "Delete: Cucumber" "link"
  72      And I follow "By last update"
  73      And I follow "By last update change to descending"
  74      And "Delete: Cucumber" "link" should appear before "Delete: Eggplant" "link"
  75  
  76    @javascript
  77    Scenario: Browse by author
  78      When I follow "Browse by Author"
  79      And I click on "T" "link" in the ".entrybox" "css_element"
  80      Then I should see "Teacher 1"
  81      And I should see "Sour eggplants"
  82      And I should not see "Sweet cucumber"
  83      And I click on "S" "link" in the ".entrybox" "css_element"
  84      And I should see "Student 1"
  85      And I should see "Sweet cucumber"
  86      And I should not see "Sour eggplants"


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