|
| 1 | +@block @block_news @javascript |
| 2 | +Feature: Show news |
| 3 | + In order to be informed about news |
| 4 | + As a user |
| 5 | + I need to be able to see the news block on my dashboard but not on my course page. |
| 6 | + |
| 7 | + Background: |
| 8 | + Given the following "courses" exist: |
| 9 | + | fullname | shortname | category | |
| 10 | + | Course 1 | C1 | 0 | |
| 11 | + And the following "users" exist: |
| 12 | + | username | |
| 13 | + | teacher1 | |
| 14 | + | student1 | |
| 15 | + And the following "course enrolments" exist: |
| 16 | + | user | course | role | |
| 17 | + | teacher1 | C1 | editingteacher | |
| 18 | + | student1 | C1 | student | |
| 19 | + And the following "blocks" exist: |
| 20 | + | blockname | contextlevel | reference | pagetypepattern | defaultregion | |
| 21 | + | news | System | 1 | my-index | full-b | |
| 22 | + And the following config values are set as admin: |
| 23 | + | config | value | plugin | |
| 24 | + | title1 | News Title One | block_news | |
| 25 | + | description1 | News Description One | block_news | |
| 26 | + | link1 | https://apple.com | block_news | |
| 27 | + | title2 | News Title Two | block_news | |
| 28 | + | description2 | News Description Two | block_news | |
| 29 | + | link2 | https://google.com | block_news | |
| 30 | + | title3 | News Title Three | block_news | |
| 31 | + | description3 | News Description Three | block_news | |
| 32 | + | link3 | https://ucl.ac.uk | block_news | |
| 33 | + |
| 34 | + Scenario: See news on my dashboard page as admin. |
| 35 | + When I log in as "admin" |
| 36 | + Then I should see "News" |
| 37 | + And I should see "News Title One" |
| 38 | + And I should see "News Title Two" |
| 39 | + And I should see "News Title Three" |
| 40 | + |
| 41 | + Scenario: See no news on the course home page as admin. |
| 42 | + When I am on the "Course 1" course page logged in as admin |
| 43 | + Then I should not see "News" |
| 44 | + And I should not see "News Title One" |
| 45 | + And I should not see "News Title Two" |
| 46 | + And I should not see "News Title Three" |
| 47 | + |
| 48 | + Scenario: See news on my dashboard page as teacher. |
| 49 | + When I log in as "teacher1" |
| 50 | + Then I should see "News" |
| 51 | + And I should see "News Title One" |
| 52 | + And I should see "News Title Two" |
| 53 | + And I should see "News Title Three" |
| 54 | + |
| 55 | + Scenario: See no news on the course home page as teacher. |
| 56 | + When I am on the "Course 1" course page logged in as teacher1 |
| 57 | + Then I should not see "News" |
| 58 | + And I should not see "News Title One" |
| 59 | + And I should not see "News Title Two" |
| 60 | + And I should not see "News Title Three" |
| 61 | + |
| 62 | + Scenario: See news on my dashboard page as student. |
| 63 | + When I log in as "student1" |
| 64 | + Then I should see "News" |
| 65 | + And I should see "News Title One" |
| 66 | + And I should see "News Title Two" |
| 67 | + And I should see "News Title Three" |
| 68 | + |
| 69 | + Scenario: See no news on the course home page as student. |
| 70 | + When I am on the "Course 1" course page logged in as student1 |
| 71 | + Then I should not see "News" |
| 72 | + And I should not see "News Title One" |
| 73 | + And I should not see "News Title Two" |
| 74 | + And I should not see "News Title Three" |
0 commit comments