From 17ee17cdbf2002fd5a91938b156d204733a68cfb Mon Sep 17 00:00:00 2001 From: szaimen Date: Tue, 30 Aug 2022 21:59:58 +0200 Subject: fix tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: szaimen Signed-off-by: Daniel Calviño Sánchez --- tests/acceptance/features/access-levels.feature | 2 +- .../features/app-files-sharing-link.feature | 6 ++--- .../acceptance/features/app-files-sharing.feature | 8 +++---- tests/acceptance/features/app-files-tags.feature | 6 ++--- tests/acceptance/features/app-theming.feature | 4 ++-- .../features/bootstrap/SettingsMenuContext.php | 8 +++++++ tests/acceptance/features/header.feature | 7 +++--- tests/lib/NavigationManagerTest.php | 28 ++++++++++++++++++++-- 8 files changed, 51 insertions(+), 18 deletions(-) (limited to 'tests') diff --git a/tests/acceptance/features/access-levels.feature b/tests/acceptance/features/access-levels.feature index 9d5695897c0..de34a17baea 100644 --- a/tests/acceptance/features/access-levels.feature +++ b/tests/acceptance/features/access-levels.feature @@ -18,6 +18,6 @@ Feature: access-levels Scenario: admin users can see admin-level items on the Settings page Given I am logged in as the admin - When I visit the settings page + When I visit the admin settings page Then I see that the "Personal" settings panel is shown And I see that the "Administration" settings panel is shown diff --git a/tests/acceptance/features/app-files-sharing-link.feature b/tests/acceptance/features/app-files-sharing-link.feature index 62f0c73a6c2..ac6ff058fec 100644 --- a/tests/acceptance/features/app-files-sharing-link.feature +++ b/tests/acceptance/features/app-files-sharing-link.feature @@ -178,7 +178,7 @@ Feature: app-files-sharing-link And I see that the file list contains a file named "farewell.txt" And I share "farewell.txt" with "user0" And I see that the file is shared with "user0" - And I visit the settings page + And I visit the admin settings page And I open the "Sharing" section of the "Administration" group And I disable resharing And I see that resharing is disabled @@ -209,7 +209,7 @@ Feature: app-files-sharing-link And I share the link for "farewell.txt" And I write down the shared link And I act as John - And I visit the settings page + And I visit the admin settings page And I open the "Sharing" section of the "Administration" group And I disable resharing And I see that resharing is disabled @@ -239,7 +239,7 @@ Feature: app-files-sharing-link And I share the link for "farewell.txt" And I write down the shared link And I act as John - And I visit the settings page + And I visit the admin settings page And I open the "Sharing" section of the "Administration" group And I disable resharing And I see that resharing is disabled diff --git a/tests/acceptance/features/app-files-sharing.feature b/tests/acceptance/features/app-files-sharing.feature index 4f58d1d17ff..cbb8aae33e7 100644 --- a/tests/acceptance/features/app-files-sharing.feature +++ b/tests/acceptance/features/app-files-sharing.feature @@ -252,7 +252,7 @@ Feature: app-files-sharing And I see that the file list contains a file named "Shared folder" And I share "Shared folder" with "user0" And I see that the file is shared with "user0" - When I visit the settings page + When I visit the admin settings page And I open the "Sharing" section of the "Administration" group And I disable resharing And I see that resharing is disabled @@ -273,7 +273,7 @@ Feature: app-files-sharing And I see that the file list contains a file named "Shared folder" And I share "Shared folder" with "user0" And I see that the file is shared with "user0" - And I visit the settings page + And I visit the admin settings page And I open the "Sharing" section of the "Administration" group And I disable resharing And I see that resharing is disabled @@ -303,7 +303,7 @@ Feature: app-files-sharing And I open the Files app And I share "Shared folder" with "user1" And I act as John - And I visit the settings page + And I visit the admin settings page And I open the "Sharing" section of the "Administration" group And I disable resharing And I see that resharing is disabled @@ -336,7 +336,7 @@ Feature: app-files-sharing And I open the Files app And I share "Shared folder" with "user1" And I act as John - And I visit the settings page + And I visit the admin settings page And I open the "Sharing" section of the "Administration" group And I disable resharing And I see that resharing is disabled diff --git a/tests/acceptance/features/app-files-tags.feature b/tests/acceptance/features/app-files-tags.feature index 8514a59d7d0..efb1277007f 100644 --- a/tests/acceptance/features/app-files-tags.feature +++ b/tests/acceptance/features/app-files-tags.feature @@ -21,7 +21,7 @@ Feature: app-files-tags Scenario: create tags using the Administration settings Given I am logged in as the admin - And I visit the settings page + And I visit the admin settings page And I open the "Basic settings" section of the "Administration" group # The "create" button does nothing before JavaScript was initialized, and # the only way to detect that is waiting for the button to select tags to be @@ -32,7 +32,7 @@ Feature: app-files-tags # Scenario: add tags using the dropdown in the details view # Given I am logged in as the admin -# And I visit the settings page +# And I visit the admin settings page # And I open the "Basic settings" section of the "Administration" group # # The "create" button does nothing before JavaScript was initialized, and # # the only way to detect that is waiting for the button to select tags to be @@ -60,7 +60,7 @@ Feature: app-files-tags # # Scenario: remove tags using the dropdown in the details view # Given I am logged in as the admin -# And I visit the settings page +# And I visit the admin settings page # And I open the "Basic settings" section of the "Administration" group # # The "create" button does nothing before JavaScript was initialized, and # # the only way to detect that is waiting for the button to select tags to be diff --git a/tests/acceptance/features/app-theming.feature b/tests/acceptance/features/app-theming.feature index 01c7d8df8dd..b6364ae4f44 100644 --- a/tests/acceptance/features/app-theming.feature +++ b/tests/acceptance/features/app-theming.feature @@ -3,7 +3,7 @@ Feature: app-theming Scenario: changing the color updates the header color Given I am logged in as the admin - And I visit the settings page + And I visit the admin settings page And I open the "Theming" section And I see that the color selector in the Theming app has loaded # The "eventually" part is not really needed here, as the colour is not @@ -16,7 +16,7 @@ Feature: app-theming Scenario: resetting the color updates the header color Given I am logged in as the admin - And I visit the settings page + And I visit the admin settings page And I open the "Theming" section And I see that the color selector in the Theming app has loaded And I set the "Color" parameter in the Theming app to "#C9C9C9" diff --git a/tests/acceptance/features/bootstrap/SettingsMenuContext.php b/tests/acceptance/features/bootstrap/SettingsMenuContext.php index 1572dea3faa..0effe906240 100644 --- a/tests/acceptance/features/bootstrap/SettingsMenuContext.php +++ b/tests/acceptance/features/bootstrap/SettingsMenuContext.php @@ -143,6 +143,14 @@ class SettingsMenuContext implements Context, ActorAwareInterface { $this->actor->find(self::menuItemFor('Settings'), 2)->click(); } + /** + * @When I visit the admin settings page + */ + public function iVisitTheAdminSettingsPage() { + $this->iOpenTheSettingsMenu(); + $this->actor->find(self::menuItemFor('Admin settings'), 2)->click(); + } + /** * @When I log out */ diff --git a/tests/acceptance/features/header.feature b/tests/acceptance/features/header.feature index 9931bc67436..2debb78638c 100644 --- a/tests/acceptance/features/header.feature +++ b/tests/acceptance/features/header.feature @@ -5,9 +5,10 @@ Feature: header Given I am logged in as the admin When I open the Settings menu Then I see that the Settings menu is shown - And I see that the Settings menu has only 7 items + And I see that the Settings menu has only 8 items And I see that the "Set status" item in the Settings menu is shown - And I see that the "Settings" item in the Settings menu is shown + And I see that the "Personal settings" item in the Settings menu is shown + And I see that the "Admin settings" item in the Settings menu is shown And I see that the "Apps" item in the Settings menu is shown And I see that the "Users" item in the Settings menu is shown And I see that the "Help" item in the Settings menu is shown @@ -32,7 +33,7 @@ Feature: header Scenario: users from other groups are not seen in the contacts menu when autocompletion is restricted within the same group Given I am logged in as the admin - And I visit the settings page + And I visit the admin settings page And I open the "Sharing" section of the "Administration" group And I enable restricting username autocompletion to groups And I see that username autocompletion is restricted to groups diff --git a/tests/lib/NavigationManagerTest.php b/tests/lib/NavigationManagerTest.php index 39f326ef0da..260fb9a70ed 100644 --- a/tests/lib/NavigationManagerTest.php +++ b/tests/lib/NavigationManagerTest.php @@ -282,6 +282,30 @@ class NavigationManagerTest extends TestCase { 'unread' => 0 ] ]; + $adminSettings = [ + 'settings' => [ + 'id' => 'settings', + 'order' => 2, + 'href' => '/apps/test/', + 'icon' => '/apps/settings/img/admin.svg', + 'name' => 'Personal settings', + 'active' => false, + 'type' => 'settings', + 'classes' => '', + 'unread' => 0 + ], + 'admin_settings' => [ + 'id' => 'admin_settings', + 'order' => 3, + 'href' => '/apps/test/', + 'icon' => '/apps/settings/img/admin.svg', + 'name' => 'Admin settings', + 'active' => false, + 'type' => 'settings', + 'classes' => '', + 'unread' => 0 + ] + ]; return [ 'minimalistic' => [ @@ -330,7 +354,7 @@ class NavigationManagerTest extends TestCase { ], 'admin' => [ array_merge( - ['settings' => $defaults['settings']], + $adminSettings, $apps, ['test' => [ 'id' => 'test', @@ -354,7 +378,7 @@ class NavigationManagerTest extends TestCase { ], 'no name' => [ array_merge( - ['settings' => $defaults['settings']], + $adminSettings, $apps, ['logout' => $defaults['logout']] ), -- cgit v1.2.3 From 0c90474296f3c062a5ae64225a3ef49480865e1d Mon Sep 17 00:00:00 2001 From: szaimen Date: Wed, 31 Aug 2022 15:37:48 +0200 Subject: add a better icon for personal settings Signed-off-by: szaimen --- tests/lib/NavigationManagerTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/lib/NavigationManagerTest.php b/tests/lib/NavigationManagerTest.php index 260fb9a70ed..d29b6888c2c 100644 --- a/tests/lib/NavigationManagerTest.php +++ b/tests/lib/NavigationManagerTest.php @@ -287,7 +287,7 @@ class NavigationManagerTest extends TestCase { 'id' => 'settings', 'order' => 2, 'href' => '/apps/test/', - 'icon' => '/apps/settings/img/admin.svg', + 'icon' => '/apps/settings/img/personal.svg', 'name' => 'Personal settings', 'active' => false, 'type' => 'settings', -- cgit v1.2.3