[ Index ]

PHP Cross Reference of Unnamed Project

title

Body

[close]

/blocks/blog_menu/tests/behat/ -> block_blog_menu_activity.feature (source)

   1  @block @block_blog_menu
   2  Feature: Enable Block blog menu in an activity
   3    In order to enable the blog menu in an activity
   4    As a teacher
   5    I can add blog menu block to a course
   6  
   7    Background:
   8      Given the following "users" exist:
   9        | username | firstname | lastname | email | idnumber |
  10        | teacher1 | Teacher | 1 | teacher1@example.com | T1 |
  11        | student1 | Student | 1 | student1@example.com | S1 |
  12        | student2 | Student | 2 | student2@example.com | S2 |
  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        | student1 | C1 | student |
  20        | student2 | C1 | student |
  21      And I log in as "teacher1"
  22      And I follow "Course 1"
  23      And I turn editing mode on
  24      And I add a "Assignment" to section "1" and I fill the form with:
  25        | Assignment name | Test assignment 1 |
  26        | Description | Offline text |
  27        | assignsubmission_file_enabled | 0 |
  28      And I follow "Test assignment 1"
  29      And I add the "Blog menu" block
  30      And I log out
  31  
  32    Scenario: Students use the blog menu block to post blogs
  33      Given I log in as "student1"
  34      And I follow "Course 1"
  35      And I follow "Test assignment 1"
  36      And I follow "Add a new entry"
  37      When I set the following fields to these values:
  38        | Entry title | S1 First Blog |
  39        | Blog entry body | This is my awesome blog! |
  40      And I press "Save changes"
  41      Then I should see "S1 First Blog"
  42      And I should see "This is my awesome blog!"
  43      And I follow "Dashboard"
  44      And I follow "Course 1"
  45      And I follow "Test assignment 1"
  46      And I follow "Blog entries"
  47      And I should see "S1 First Blog"
  48      And I should see "This is my awesome blog!"
  49  
  50    Scenario: Students use the blog menu block to view their blogs about the activity
  51      Given I log in as "student1"
  52      And I follow "Course 1"
  53      And I follow "Test assignment 1"
  54      And I follow "Add an entry about this Assignment"
  55      And I set the following fields to these values:
  56        | Entry title | S1 First Blog |
  57        | Blog entry body | This is my awesome blog about this Assignment! |
  58      And I press "Save changes"
  59      And I should see "S1 First Blog"
  60      And I should see "This is my awesome blog about this Assignment!"
  61      And I should see "Associated Assignment: Test assignment 1"
  62      And I log out
  63      And I log in as "student2"
  64      And I follow "Course 1"
  65      And I follow "Test assignment 1"
  66      And I follow "Add a new entry"
  67      And I set the following fields to these values:
  68        | Entry title | S2 Second Blog |
  69        | Blog entry body | My unrelated blog! |
  70      And I press "Save changes"
  71      And I should see "S2 Second Blog"
  72      And I should see "My unrelated blog!"
  73      And I should not see "Associated Assignment: Test assignment 1"
  74      And I follow "Dashboard"
  75      And I follow "Course 1"
  76      And I follow "Test assignment 1"
  77      And I follow "Add an entry about this Assignment"
  78      And I set the following fields to these values:
  79        | Entry title | S2 First Blog |
  80        | Blog entry body | My course blog is better! |
  81      And I press "Save changes"
  82      And I should see "S2 First Blog"
  83      And I should see "My course blog is better!"
  84      And I should see "Associated Assignment: Test assignment 1"
  85      And I follow "Dashboard"
  86      And I follow "Course 1"
  87      And I follow "Test assignment 1"
  88      When I follow "View my entries about this Assignment"
  89      Then I should see "S2 First Blog"
  90      And I should not see "S2 Second Blog"
  91      And I should not see "S1 First Blog"
  92  
  93    Scenario: Students use the blog menu block to view all blogs about the assignment
  94      Given I log in as "student1"
  95      And I follow "Course 1"
  96      And I follow "Test assignment 1"
  97      And I follow "Add an entry about this Assignment"
  98      And I set the following fields to these values:
  99        | Entry title | S1 First Blog |
 100        | Blog entry body | This is my awesome blog about this Assignment! |
 101      And I press "Save changes"
 102      And I should see "S1 First Blog"
 103      And I should see "This is my awesome blog about this Assignment!"
 104      And I should see "Associated Assignment: Test assignment 1"
 105      And I log out
 106      And I log in as "student2"
 107      And I follow "Course 1"
 108      And I follow "Test assignment 1"
 109      And I follow "Add a new entry"
 110      And I set the following fields to these values:
 111        | Entry title | S2 Second Blog |
 112        | Blog entry body | My unrelated blog! |
 113      And I press "Save changes"
 114      And I should see "S2 Second Blog"
 115      And I should see "My unrelated blog!"
 116      And I should not see "Associated Assignment: Test assignment 1"
 117      And I follow "Dashboard"
 118      And I follow "Course 1"
 119      And I follow "Test assignment 1"
 120      And I follow "Add an entry about this Assignment"
 121      And I set the following fields to these values:
 122        | Entry title | S2 First Blog |
 123        | Blog entry body | My course blog is better! |
 124      And I press "Save changes"
 125      And I should see "S2 First Blog"
 126      And I should see "My course blog is better!"
 127      And I should see "Associated Assignment: Test assignment 1"
 128      And I follow "Dashboard"
 129      And I follow "Course 1"
 130      And I follow "Test assignment 1"
 131      When I follow "View all entries about this Assignment"
 132      Then I should see "S1 First Blog"
 133      And I should see "S2 First Blog"
 134      And I should not see "S2 Second Blog"
 135  
 136    Scenario: Students use the blog menu block to view all their blog entries
 137      Given I log in as "student1"
 138      And I follow "Course 1"
 139      And I follow "Test assignment 1"
 140      And I follow "Add an entry about this Assignment"
 141      And I set the following fields to these values:
 142        | Entry title | S1 First Blog |
 143        | Blog entry body | This is my awesome blog about this Assignment! |
 144      And I press "Save changes"
 145      And I should see "S1 First Blog"
 146      And I should see "This is my awesome blog about this Assignment!"
 147      And I should see "Associated Assignment: Test assignment 1"
 148      And I log out
 149      And I log in as "student2"
 150      And I follow "Course 1"
 151      And I follow "Test assignment 1"
 152      And I follow "Add a new entry"
 153      And I set the following fields to these values:
 154        | Entry title | S2 Second Blog |
 155        | Blog entry body | My unrelated blog! |
 156      And I press "Save changes"
 157      And I should see "S2 Second Blog"
 158      And I should see "My unrelated blog!"
 159      And I should not see "Associated Assignment: Test assignment 1"
 160      And I follow "Dashboard"
 161      And I follow "Course 1"
 162      And I follow "Test assignment 1"
 163      And I follow "Add an entry about this Assignment"
 164      And I set the following fields to these values:
 165        | Entry title | S2 First Blog |
 166        | Blog entry body | My course blog is better! |
 167      And I press "Save changes"
 168      And I should see "S2 First Blog"
 169      And I should see "My course blog is better!"
 170      And I should see "Associated Assignment: Test assignment 1"
 171      And I follow "Dashboard"
 172      And I follow "Course 1"
 173      And I follow "Test assignment 1"
 174      When I follow "Blog entries"
 175      Then I should see "S2 First Blog"
 176      And I should see "S2 Second Blog"
 177      And I should not see "S1 First Blog"
 178  
 179    Scenario: Teacher searches for student blogs
 180      Given I log in as "student1"
 181      And I follow "Course 1"
 182      And I follow "Test assignment 1"
 183      And I follow "Add an entry about this Assignment"
 184      And I set the following fields to these values:
 185        | Entry title | S1 First Blog |
 186        | Blog entry body | This is my awesome blog about this Assignment! |
 187      And I press "Save changes"
 188      And I should see "S1 First Blog"
 189      And I should see "This is my awesome blog about this Assignment!"
 190      And I should see "Associated Assignment: Test assignment 1"
 191      And I log out
 192      And I log in as "student2"
 193      And I follow "Course 1"
 194      And I follow "Test assignment 1"
 195      And I follow "Add a new entry"
 196      And I set the following fields to these values:
 197        | Entry title | S2 Second Blog |
 198        | Blog entry body | My unrelated blog! |
 199      And I press "Save changes"
 200      And I should see "S2 Second Blog"
 201      And I should see "My unrelated blog!"
 202      And I should not see "Associated Assignment: Test assignment 1"
 203      And I follow "Dashboard"
 204      And I follow "Course 1"
 205      And I follow "Test assignment 1"
 206      And I follow "Add an entry about this Assignment"
 207      And I set the following fields to these values:
 208        | Entry title | S2 First Blog |
 209        | Blog entry body | My course blog is better! |
 210      And I press "Save changes"
 211      And I should see "S2 First Blog"
 212      And I should see "My course blog is better!"
 213      And I should see "Associated Assignment: Test assignment 1"
 214      And I log out
 215      When I log in as "teacher1"
 216      And I follow "Course 1"
 217      And I follow "Test assignment 1"
 218      And I set the field "blogsearchquery" to "First"
 219      And I press "Search"
 220      Then I should see "S1 First Blog"
 221      And I should see "S2 First Blog"
 222      And I should not see "S2 Second Blog"


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