From b24ac2c47f5e36d83eb3fe1a58c4100193068e82 Mon Sep 17 00:00:00 2001 From: Simey Lameze Date: Tue, 28 May 2019 08:38:59 +0800 Subject: [PATCH] MDL-63643 core_users: add behat for users last IP filtering --- admin/tests/behat/filter_users.feature | 32 ++++++++++++++++++++++---- 1 file changed, 27 insertions(+), 5 deletions(-) diff --git a/admin/tests/behat/filter_users.feature b/admin/tests/behat/filter_users.feature index 75e2b422f12..34088d546fc 100644 --- a/admin/tests/behat/filter_users.feature +++ b/admin/tests/behat/filter_users.feature @@ -6,11 +6,11 @@ Feature: An administrator can filter user accounts by role, cohort and other pro Background: Given the following "users" exist: - | username | firstname | lastname | email | auth | confirmed | - | user1 | User | One | one@example.com | manual | 0 | - | user2 | User | Two | two@example.com | ldap | 1 | - | user3 | User | Three | three@example.com | manual | 1 | - | user4 | User | Four | four@example.com | ldap | 0 | + | username | firstname | lastname | email | auth | confirmed | lastip | + | user1 | User | One | one@example.com | manual | 0 | 127.0.1.1 | + | user2 | User | Two | two@example.com | ldap | 1 | 0.0.0.0 | + | user3 | User | Three | three@example.com | manual | 1 | 0.0.0.0 | + | user4 | User | Four | four@example.com | ldap | 0 | 127.0.1.2 | And the following "cohorts" exist: | name | idnumber | | Cohort 1 | CH1 | @@ -82,3 +82,25 @@ Feature: An administrator can filter user accounts by role, cohort and other pro And I should not see "User Two" And I should not see "User Three" And I should see "User Four" + + Scenario: Filter user accounts by last IP address + When I set the following fields to these values: + | id_lastip | 127.0.1.1 | + And I press "Add filter" + Then I should see "User One" + And I should not see "User Two" + And I should not see "User Three" + And I should not see "User Four" + And I press "Remove all filters" + And I set the following fields to these values: + | id_lastip | 127.0.1.2 | + And I press "Add filter" + And I should not see "User One" + And I should not see "User Two" + And I should not see "User Three" + And I should see "User Four" + And I press "Remove all filters" + And I should see "User One" + And I should see "User Two" + And I should see "User Three" + And I should see "User Four"