[ Index ]

PHP Cross Reference of Unnamed Project

title

Body

[close]

/blocks/blog_recent/tests/behat/ -> block_blog_recent_course.feature (source)

   1  @block @block_blog_menu @block_blog_recent
   2  Feature: Students can use the recent blog entries block to view recent entries on a course page
   3    In order to enable the recent blog entries block a course page
   4    As a teacher
   5    I can add the recent blog entries block to a course page
   6  
   7    Background:
   8      Given the following "users" exist:
   9        | username | firstname | lastname | email | idnumber |
  10        | student1 | Student | 1 | student1@example.com | S1 |
  11        | teacher1 | Teacher | 1 | teacher1@example.com | T1 |
  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 I log in as "teacher1"
  20      And I follow "Course 1"
  21      And I turn editing mode on
  22      And I add the "Blog menu" block
  23      And I add the "Recent blog entries" block
  24      And I log out
  25  
  26    Scenario: Students use the recent blog entries block to view blogs
  27      Given I log in as "student1"
  28      And I follow "Course 1"
  29      And I follow "Add an entry about this course"
  30      When I set the following fields to these values:
  31        | Entry title | S1 First Blog |
  32        | Blog entry body | This is my awesome blog! |
  33      And I press "Save changes"
  34      Then I should see "S1 First Blog"
  35      And I should see "This is my awesome blog!"
  36      And I follow "C1"
  37      And I should see "S1 First Blog"
  38      And I follow "S1 First Blog"
  39      And I should see "This is my awesome blog!"
  40  
  41    Scenario: Students only see a few entries in the recent blog entries block
  42      Given I log in as "student1"
  43      And I follow "Course 1"
  44      And I follow "Add an entry about this course"
  45      # Blog 1 of 5
  46      And I set the following fields to these values:
  47        | Entry title | S1 First Blog |
  48        | Blog entry body | This is my awesome blog! |
  49      And I press "Save changes"
  50      And I wait "1" seconds
  51      And I follow "C1"
  52      And I follow "Add an entry about this course"
  53      # Blog 2 of 5
  54      And I set the following fields to these values:
  55        | Entry title | S1 Second Blog |
  56        | Blog entry body | This is my awesome blog! |
  57      And I press "Save changes"
  58      And I wait "1" seconds
  59      And I should see "S1 Second Blog"
  60      And I should see "This is my awesome blog!"
  61      And I follow "C1"
  62      And I follow "Add an entry about this course"
  63      # Blog 3 of 5
  64      And I set the following fields to these values:
  65        | Entry title | S1 Third Blog |
  66        | Blog entry body | This is my awesome blog! |
  67      And I press "Save changes"
  68      And I wait "1" seconds
  69      And I should see "S1 Third Blog"
  70      And I should see "This is my awesome blog!"
  71      And I follow "C1"
  72      And I follow "Add an entry about this course"
  73      # Blog 4 of 5
  74      And I set the following fields to these values:
  75        | Entry title | S1 Fourth Blog |
  76        | Blog entry body | This is my awesome blog! |
  77      And I press "Save changes"
  78      And I wait "1" seconds
  79      And I should see "S1 Fourth Blog"
  80      And I should see "This is my awesome blog!"
  81      And I follow "C1"
  82      And I follow "Add an entry about this course"
  83      # Blog 5 of 5
  84      And I set the following fields to these values:
  85        | Entry title | S1 Fifth Blog |
  86        | Blog entry body | This is my awesome blog! |
  87      And I press "Save changes"
  88      And I should see "S1 Fifth Blog"
  89      And I should see "This is my awesome blog!"
  90      When I follow "C1"
  91      And I should not see "S1 First Blog"
  92      And I should see "S1 Second Blog"
  93      And I should see "S1 Third Blog"
  94      And I should see "S1 Fourth Blog"
  95      And I should see "S1 Fifth Blog"
  96      And I follow "S1 Fifth Blog"
  97      And I should see "This is my awesome blog!"
  98      Then I log out
  99      And I log in as "teacher1"
 100      And I follow "Course 1"
 101      And I turn editing mode on
 102      And I configure the "Recent blog entries" block
 103      And I set the following fields to these values:
 104        | id_config_numberofrecentblogentries | 2 |
 105      And I press "Save changes"
 106      And I should see "S1 Fourth Blog"
 107      And I should see "S1 Fifth Blog"


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