[ Index ]

PHP Cross Reference of Unnamed Project

title

Body

[close]

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

   1  @block @block_glossary_random
   2  Feature: Random glossary entry block is used in a course
   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      And the following "users" exist:
  12        | username | firstname | lastname | email             |
  13        | student1 | Sam1      | Student1 | student1@example.com |
  14        | teacher1 | Terry1    | Teacher1 | teacher1@example.com |
  15      And the following "course enrolments" exist:
  16        | user     | course | role           |
  17        | student1 | C1     | student        |
  18        | teacher1 | C1     | editingteacher |
  19  
  20    Scenario: Student can not see the block if it is not configured
  21      When I log in as "teacher1"
  22      And I follow "Course 1"
  23      And I turn editing mode on
  24      And I add the "Random glossary entry" block
  25      Then I should see "Please configure this block using the edit icon" in the "block_glossary_random" "block"
  26      And I log out
  27      And I log in as "student1"
  28      And I follow "Course 1"
  29      And "block_glossary_random" "block" should not exist
  30      And I log out
  31  
  32    Scenario: View random (last) entry in the glossary with auto approval
  33      Given the following "activities" exist:
  34        | activity | name         | intro                     | course | idnumber  | defaultapproval |
  35        | glossary | GlossaryAuto | Test glossary description | C1     | glossary1 | 1               |
  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                           | AutoGlossaryblock   |
  43        | Take entries from this glossary | GlossaryAuto        |
  44        | How a new entry is chosen       | Last modified entry |
  45      And I press "Save changes"
  46      And I log out
  47      When I log in as "student1"
  48      And I follow "Course 1"
  49      Then I should see "There are no entries yet in the chosen glossary" in the "AutoGlossaryblock" "block"
  50      And I click on "Add a new entry" "link" in the "AutoGlossaryblock" "block"
  51      And I set the following fields to these values:
  52        | Concept    | Concept1    |
  53        | Definition | Definition1 |
  54      And I press "Save changes"
  55      And I follow "Course 1"
  56      And I should see "Concept1" in the "AutoGlossaryblock" "block"
  57      And I should see "Definition1" in the "AutoGlossaryblock" "block"
  58      And I should not see "There are no entries yet in the chosen glossary" in the "AutoGlossaryblock" "block"
  59      And I click on "Add a new entry" "link" in the "AutoGlossaryblock" "block"
  60      And I set the following fields to these values:
  61        | Concept    | Concept2    |
  62        | Definition | Definition2 |
  63      And I press "Save changes"
  64      And I follow "Course 1"
  65      # Only the last entry appears in the block
  66      And I should not see "Concept1" in the "AutoGlossaryblock" "block"
  67      And I should not see "Definition1" in the "AutoGlossaryblock" "block"
  68      And I should see "Concept2" in the "AutoGlossaryblock" "block"
  69      And I should see "Definition2" in the "AutoGlossaryblock" "block"
  70      And I click on "View all entries" "link" in the "AutoGlossaryblock" "block"
  71      And I should see "GlossaryAuto" in the "#page-navbar" "css_element"
  72      And I should see "Concept1" in the "#page-content" "css_element"
  73      And I should see "Concept2" in the "#page-content" "css_element"
  74      And I log out
  75  
  76    Scenario: View random (last) entry in the glossary with manual approval
  77      Given the following "activities" exist:
  78        | activity | name           | intro                     | course | idnumber  | defaultapproval |
  79        | glossary | GlossaryManual | Test glossary description | C1     | glossary2 | 0               |
  80      And I log in as "teacher1"
  81      And I follow "Course 1"
  82      And I turn editing mode on
  83      And I add the "Random glossary entry" block
  84      And I configure the "block_glossary_random" block
  85      And I set the following fields to these values:
  86        | Title                           | ManualGlossaryblock |
  87        | Take entries from this glossary | GlossaryManual      |
  88        | How a new entry is chosen       | Last modified entry |
  89      And I press "Save changes"
  90      And I log out
  91      When I log in as "student1"
  92      And I follow "Course 1"
  93      Then I should see "There are no entries yet in the chosen glossary" in the "ManualGlossaryblock" "block"
  94      And I click on "Add a new entry" "link" in the "ManualGlossaryblock" "block"
  95      And I set the following fields to these values:
  96        | Concept    | Concept1    |
  97        | Definition | Definition1 |
  98      And I press "Save changes"
  99      And I follow "Course 1"
 100      And I should see "There are no entries yet in the chosen glossary" in the "ManualGlossaryblock" "block"
 101      And I log out
 102      And I log in as "teacher1"
 103      And I follow "Course 1"
 104      And I should see "There are no entries yet in the chosen glossary" in the "ManualGlossaryblock" "block"
 105      And I follow "GlossaryManual"
 106      And I follow "Waiting approval"
 107      And I follow "Approve"
 108      And I click on "Course 1" "link" in the "#page-navbar" "css_element"
 109      And I should see "Concept1" in the "ManualGlossaryblock" "block"
 110      And I should see "Definition1" in the "ManualGlossaryblock" "block"
 111      And I log out


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