-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Matthias Opitz
committed
Mar 15, 2024
1 parent
42dba87
commit 3803194
Showing
2 changed files
with
79 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
@block @block_news @javascript | ||
Feature: Show news | ||
In order to be informed about news | ||
As a user | ||
I need to be able to see the news block on my dashboard but not on my course page. | ||
|
||
Background: | ||
Given the following "courses" exist: | ||
| fullname | shortname | category | | ||
| Course 1 | C1 | 0 | | ||
And the following "users" exist: | ||
| username | | ||
| teacher1 | | ||
| student1 | | ||
And the following "course enrolments" exist: | ||
| user | course | role | | ||
| teacher1 | C1 | editingteacher | | ||
| student1 | C1 | student | | ||
And the following "blocks" exist: | ||
| blockname | contextlevel | reference | pagetypepattern | defaultregion | | ||
| news | System | 1 | my-index | full-b | | ||
And the following config values are set as admin: | ||
| config | value | plugin | | ||
| title1 | News Title One | block_news | | ||
| description1 | News Description One | block_news | | ||
| link1 | https://apple.com | block_news | | ||
| title2 | News Title Two | block_news | | ||
| description2 | News Description Two | block_news | | ||
| link2 | https://google.com | block_news | | ||
| title3 | News Title Three | block_news | | ||
| description3 | News Description Three | block_news | | ||
| link3 | https://ucl.ac.uk | block_news | | ||
|
||
Scenario: See news on my dashboard page as admin. | ||
When I log in as "admin" | ||
Then I should see "News" | ||
And I should see "News Title One" | ||
And I should see "News Title Two" | ||
And I should see "News Title Three" | ||
|
||
Scenario: See no news on the course home page as admin. | ||
When I am on the "Course 1" course page logged in as admin | ||
Then I should not see "News" | ||
And I should not see "News Title One" | ||
And I should not see "News Title Two" | ||
And I should not see "News Title Three" | ||
|
||
Scenario: See news on my dashboard page as teacher. | ||
When I log in as "teacher1" | ||
Then I should see "News" | ||
And I should see "News Title One" | ||
And I should see "News Title Two" | ||
And I should see "News Title Three" | ||
|
||
Scenario: See no news on the course home page as teacher. | ||
When I am on the "Course 1" course page logged in as teacher1 | ||
Then I should not see "News" | ||
And I should not see "News Title One" | ||
And I should not see "News Title Two" | ||
And I should not see "News Title Three" | ||
|
||
Scenario: See news on my dashboard page as student. | ||
When I log in as "student1" | ||
Then I should see "News" | ||
And I should see "News Title One" | ||
And I should see "News Title Two" | ||
And I should see "News Title Three" | ||
|
||
Scenario: See no news on the course home page as student. | ||
When I am on the "Course 1" course page logged in as student1 | ||
Then I should not see "News" | ||
And I should not see "News Title One" | ||
And I should not see "News Title Two" | ||
And I should not see "News Title Three" |