MDL-59293 block_onlineusers: Update behat tests
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
@block @block_online_users
|
||||
Feature: The online users block allow you to see who is currently online on dashboard
|
||||
There should be some commonality for the users to show up
|
||||
In order to use the online users block on the dashboard
|
||||
As a user
|
||||
I can view the online users block on my dashboard
|
||||
@@ -10,6 +11,14 @@ Feature: The online users block allow you to see who is currently online on dash
|
||||
| teacher1 | Teacher | 1 | teacher1@example.com |
|
||||
| student1 | Student | 1 | student1@example.com |
|
||||
| student2 | Student | 2 | student2@example.com |
|
||||
And the following "courses" exist:
|
||||
| fullname | shortname | category |
|
||||
| Course 1 | C1 | 0 |
|
||||
And the following "course enrolments" exist:
|
||||
| user | course | role |
|
||||
| teacher1 | C1 | editingteacher |
|
||||
| student1 | C1 | student |
|
||||
| student2 | C1 | student |
|
||||
|
||||
Scenario: View the online users block on the dashboard and see myself
|
||||
Given I log in as "teacher1"
|
||||
|
||||
@@ -1,14 +1,22 @@
|
||||
@block @block_online_users
|
||||
Feature: The online users block allow you to see who is currently online on frontpage
|
||||
In order to enable the online users block on the front page page
|
||||
There should be some commonality for the users to show up
|
||||
In order to enable the online users block on the frontpage
|
||||
As an admin
|
||||
I can add the online users block to the front page page
|
||||
I can add the online users block to the frontpage
|
||||
|
||||
Background:
|
||||
Given the following "users" exist:
|
||||
| username | firstname | lastname | email |
|
||||
| student1 | Student | 1 | student1@example.com |
|
||||
| student2 | Student | 2 | student2@example.com |
|
||||
And the following "courses" exist:
|
||||
| fullname | shortname | category |
|
||||
| Course 1 | C1 | 0 |
|
||||
And the following "course enrolments" exist:
|
||||
| user | course | role |
|
||||
| student1 | C1 | student |
|
||||
| student2 | C1 | student |
|
||||
|
||||
Scenario: View the online users block on the front page and see myself
|
||||
Given I log in as "admin"
|
||||
@@ -28,7 +36,8 @@ Feature: The online users block allow you to see who is currently online on fron
|
||||
And I log out
|
||||
When I log in as "student1"
|
||||
And I am on site homepage
|
||||
Then I should see "Admin User" in the "Online users" "block"
|
||||
Then I should not see "Admin User" in the "Online users" "block"
|
||||
And I should see "Other Users (1)" in the "Online users" "block"
|
||||
And I should see "Student 1" in the "Online users" "block"
|
||||
And I should see "Student 2" in the "Online users" "block"
|
||||
And I should see "3 online users" in the "Online users" "block"
|
||||
@@ -45,9 +54,9 @@ Feature: The online users block allow you to see who is currently online on fron
|
||||
And I log out
|
||||
When I log in as "guest"
|
||||
And I am on site homepage
|
||||
Then I should see "Admin User" in the "Online users" "block"
|
||||
And I should see "Student 1" in the "Online users" "block"
|
||||
And I should see "Student 2" in the "Online users" "block"
|
||||
Then I should not see "Admin User" in the "Online users" "block"
|
||||
And I should not see "Student 1" in the "Online users" "block"
|
||||
And I should not see "Student 2" in the "Online users" "block"
|
||||
And I should see "3 online users" in the "Online users" "block"
|
||||
|
||||
@javascript
|
||||
@@ -69,7 +78,8 @@ Feature: The online users block allow you to see who is currently online on fron
|
||||
When I log in as "student2"
|
||||
And I am on site homepage
|
||||
Then I should see "2 online user" in the "Online users" "block"
|
||||
And I should see "Admin" in the "Online users" "block"
|
||||
And I should not see "Admin" in the "Online users" "block"
|
||||
And I should see "Other Users (1)" in the "Online users" "block"
|
||||
And I should see "Student 2" in the "Online users" "block"
|
||||
And I should not see "Student 1" in the "Online users" "block"
|
||||
And I log out
|
||||
@@ -83,7 +93,8 @@ Feature: The online users block allow you to see who is currently online on fron
|
||||
When I log in as "student2"
|
||||
And I am on site homepage
|
||||
Then I should see "3 online users" in the "Online users" "block"
|
||||
And I should see "Admin" in the "Online users" "block"
|
||||
And I should not see "Admin" in the "Online users" "block"
|
||||
And I should see "Other Users (1)" in the "Online users" "block"
|
||||
And I should see "Student 2" in the "Online users" "block"
|
||||
And I should see "Student 1" in the "Online users" "block"
|
||||
|
||||
@@ -126,7 +137,8 @@ Feature: The online users block allow you to see who is currently online on fron
|
||||
And I log in as "student2"
|
||||
And I am on site homepage
|
||||
And I should see "2 online user" in the "Online users" "block"
|
||||
And I should see "Admin" in the "Online users" "block"
|
||||
And I should not see "Admin" in the "Online users" "block"
|
||||
And I should see "Other Users (1)" in the "Online users" "block"
|
||||
And I should see "Student 2" in the "Online users" "block"
|
||||
And I should not see "Student 1" in the "Online users" "block"
|
||||
And I log out
|
||||
@@ -135,6 +147,7 @@ Feature: The online users block allow you to see who is currently online on fron
|
||||
And I log in as "student2"
|
||||
When I am on site homepage
|
||||
Then I should see "3 online users" in the "Online users" "block"
|
||||
And I should see "Admin" in the "Online users" "block"
|
||||
And I should not see "Admin" in the "Online users" "block"
|
||||
And I should see "Other Users (1)" in the "Online users" "block"
|
||||
And I should see "Student 2" in the "Online users" "block"
|
||||
And I should see "Student 1" in the "Online users" "block"
|
||||
|
||||
Reference in New Issue
Block a user