AutorÃa | Ultima modificación | Ver Log |
@block @block_online_usersFeature: The online users block allow you to see who is currently online on frontpageThere should be some commonality for the users to show upIn order to enable the online users block on the frontpageAs an adminI can add the online users block to the frontpageBackground: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 myselfGiven I log in as "admin"And I am on site homepageAnd I turn editing mode onWhen I add the "Online users" blockThen I should see "Admin User" in the "Online users" "block"And I should see "1 online user" in the "Online users" "block"Scenario: View the online users block on the front page as a logged in userGiven I log in as "admin"And I am on site homepageAnd I turn editing mode onAnd I add the "Online users" blockAnd I log outAnd I log in as "student2"And I log outWhen I log in as "student1"And I am on site homepageThen 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"Scenario: View the online users block on the front page as a guestGiven I log in as "admin"And I am on site homepageAnd I turn editing mode onAnd I add the "Online users" blockAnd I log outAnd I log in as "student2"And I log outAnd I log in as "student1"And I log outWhen I log in as "guest"And I am on site homepageThen 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"@javascriptScenario: Hide/show user's online status from/to other users in the online users block on front pageGiven the following config values are set as admin:| block_online_users_onlinestatushiding | 1 |And I log in as "admin"And I am on site homepageAnd I turn editing mode onAnd I add the "Online users" blockAnd I log outWhen I log in as "student1"And I am on site homepageThen "Hide" "icon" should exist in the "#change-user-visibility" "css_element"When I click on "#change-user-visibility" "css_element"And I wait "1" secondsThen "Show" "icon" should exist in the "#change-user-visibility" "css_element"And I log outWhen I log in as "student2"And I am on site homepageThen I should see "2 online user" 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 outWhen I log in as "student1"And I am on site homepageThen "Show" "icon" should exist in the "#change-user-visibility" "css_element"When I click on "#change-user-visibility" "css_element"And I wait "1" secondsThen "Hide" "icon" should exist in the "#change-user-visibility" "css_element"And I log outWhen I log in as "student2"And I am on site homepageThen I should see "3 online users" 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"@javascriptScenario: Hide/show icon is not visible in the online users block on front page when the setting is disabledGiven the following config values are set as admin:| block_online_users_onlinestatushiding | 1 |And I log in as "admin"And I am on site homepageAnd I turn editing mode onAnd I add the "Online users" blockAnd I log outAnd I log in as "student1"And I am on site homepageAnd "Hide" "icon" should exist in the ".block.block_online_users" "css_element"And I log outAnd the following config values are set as admin:| block_online_users_onlinestatushiding | 0 |When I log in as "student1"And I am on site homepageThen I should see "Student 1" in the "Online users" "block"And "Hide" "icon" should not exist in the ".block.block_online_users" "css_element"@javascriptScenario: User is displayed in the online users block on front page when visibility setting is disabled,ignoring the previously set visibility stateGiven the following config values are set as admin:| block_online_users_onlinestatushiding | 1 |And I log in as "admin"And I am on site homepageAnd I turn editing mode onAnd I add the "Online users" blockAnd I log outAnd I log in as "student1"And I am on site homepageAnd "Hide" "icon" should exist in the "#change-user-visibility" "css_element"And I click on "#change-user-visibility" "css_element"And I wait "1" secondsAnd "Show" "icon" should exist in the "#change-user-visibility" "css_element"And I log outAnd I log in as "student2"And I am on site homepageAnd I should see "2 online user" 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 outAnd the following config values are set as admin:| block_online_users_onlinestatushiding | 0 |And I log in as "student2"When I am on site homepageThen I should see "3 online users" 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"