[ Index ]

PHP Cross Reference of Unnamed Project

title

Body

[close]

/blocks/glossary_random/tests/behat/ -> glossary_random_global.feature (source)

   1  @block @block_glossary_random
   2  Feature: Random glossary entry block linking to global glossary
   3    In order to show the entries from glossary
   4    As a teacher
   5    I can add the random glossary entry to a course page
   6  
   7    Background:
   8      Given the following "courses" exist:
   9        | fullname | shortname |
  10        | Course 1 | C1        |
  11        | Course 2 | C2        |
  12      And the following "activities" exist:
  13        | activity   | name             | intro                          | course               | idnumber  | globalglossary | defaultapproval |
  14        | glossary   | Tips and Tricks  | Frontpage glossary description | C2 | glossary0 | 1              | 1               |
  15      And the following "users" exist:
  16        | username | firstname | lastname | email             |
  17        | student1 | Sam1      | Student1 | student1@example.com |
  18        | teacher1 | Terry1    | Teacher1 | teacher1@example.com |
  19      And the following "course enrolments" exist:
  20        | user     | course | role           |
  21        | student1 | C1     | student        |
  22        | teacher1 | C1     | editingteacher |
  23  
  24    Scenario: View random (last) entry in the global glossary
  25      When I log in as "admin"
  26      And I am on site homepage
  27      And I follow "Course 2"
  28      And I follow "Tips and Tricks"
  29      And I press "Add a new entry"
  30      And I set the following fields to these values:
  31        | Concept    | Never come late               |
  32        | Definition | Come in time for your classes |
  33      And I press "Save changes"
  34      And I log out
  35      # As a teacher add a block to the course page linking to the global glossary.
  36      And I log in as "teacher1"
  37      And I follow "Course 1"
  38      And I turn editing mode on
  39      And I add the "Random glossary entry" block
  40      And I configure the "block_glossary_random" block
  41      And I set the following fields to these values:
  42        | Title                           | Tip of the day      |
  43        | Take entries from this glossary | Tips and Tricks     |
  44        | How a new entry is chosen       | Last modified entry |
  45      And I press "Save changes"
  46      Then I should see "Never come late" in the "Tip of the day" "block"
  47      And I should not see "Add a new entry" in the "Tip of the day" "block"
  48      And I should see "View all entries" in the "Tip of the day" "block"
  49      And I log out
  50      # Student who can't see the module is still able to view entries in this block (because the glossary was marked as global)
  51      And I log in as "student1"
  52      And I follow "Course 1"
  53      And I should see "Never come late" in the "Tip of the day" "block"
  54      And I should not see "Add a new entry" in the "Tip of the day" "block"
  55      And I should see "View all entries" in the "Tip of the day" "block"
  56      And I log out
  57  
  58    Scenario: Removing the global glossary that is used in random glossary block
  59      And I log in as "teacher1"
  60      And I follow "Course 1"
  61      And I turn editing mode on
  62      And I add the "Random glossary entry" block
  63      And I configure the "block_glossary_random" block
  64      And I set the following fields to these values:
  65        | Title                           | Tip of the day      |
  66        | Take entries from this glossary | Tips and Tricks     |
  67        | How a new entry is chosen       | Last modified entry |
  68      And I press "Save changes"
  69      And I log out
  70      And I log in as "admin"
  71      And I am on site homepage
  72      And I follow "Course 2"
  73      And I follow "Tips and Tricks"
  74      And I follow "Edit settings"
  75      And I set the field "globalglossary" to "0"
  76      And I press "Save and return to course"
  77      And I am on site homepage
  78      And I follow "Course 1"
  79      Then I should see "Please configure this block using the edit icon." in the "Tip of the day" "block"
  80      And I log out
  81      And I log in as "student1"
  82      And I follow "Course 1"
  83      And "Tip of the day" "block" should not exist
  84      And I log out


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