source: moodle/trunk/fuentes/blocks/news_items/tests/behat/display_news.feature @ 136

Last change on this file since 136 was 136, checked in by mabarracus, 3 years ago

Ported code to xenial

File size: 1.8 KB
Line 
1@block @block_news_items
2Feature: Latest news block displays the course latest news
3  In order to be aware of the course news
4  As a user
5  I need to see the latest news in the main course page
6
7  @javascript
8  Scenario: Latest course news are displayed and can be configured
9    Given the following "users" exist:
10      | username | firstname | lastname | email |
11      | teacher1 | Teacher | 1 | teacher1@asd.com |
12    And I log in as "admin"
13    And I create a course with:
14      | Course full name | Course 1 |
15      | Course short name | C1 |
16      | News items to show | 5 |
17    And I enrol "Teacher 1" user as "Teacher"
18    And I log out
19    And I log in as "teacher1"
20    And I follow "Course 1"
21    When I add a new topic to "News forum" forum with:
22      | Subject | Discussion One |
23      | Message | Not important |
24    And I add a new topic to "News forum" forum with:
25      | Subject | Discussion Two |
26      | Message | Not important |
27    And I add a new topic to "News forum" forum with:
28      | Subject | Discussion Three |
29      | Message | Not important |
30    And I follow "Course 1"
31    Then I should see "Discussion One" in the "Latest news" "block"
32    And I should see "Discussion Two" in the "Latest news" "block"
33    And I should see "Discussion Three" in the "Latest news" "block"
34    And I follow "Edit settings"
35    And I set the following fields to these values:
36      | News items to show | 2 |
37    And I press "Save changes"
38    And I should not see "Discussion One" in the "Latest news" "block"
39    And I should see "Discussion Two" in the "Latest news" "block"
40    And I should see "Discussion Three" in the "Latest news" "block"
41    And I follow "Edit settings"
42    And I set the following fields to these values:
43      | News items to show | 0 |
44    And I press "Save changes"
45    And "Latest news" "block" should not exist
Note: See TracBrowser for help on using the repository browser.