From bd678a750dce50e3b3a144e6734ab41e398c125d Mon Sep 17 00:00:00 2001 From: Viktor Scharf Date: Wed, 5 Oct 2022 17:34:37 +0200 Subject: [PATCH 1/3] add search test.Refactoring --- .../features/integrations/search.feature | 81 ++++++++++--------- .../searchProjectSpace.ocis.feature | 42 ++++++++++ 2 files changed, 84 insertions(+), 39 deletions(-) create mode 100644 tests/e2e/cucumber/features/integrations/searchProjectSpace.ocis.feature diff --git a/tests/e2e/cucumber/features/integrations/search.feature b/tests/e2e/cucumber/features/integrations/search.feature index 34fd6431d08..1296310fd2a 100644 --- a/tests/e2e/cucumber/features/integrations/search.feature +++ b/tests/e2e/cucumber/features/integrations/search.feature @@ -15,56 +15,46 @@ Feature: Search When "Brian" logs in And "Brian" opens the "files" app And "Brian" creates the following resources - | resource | type | - | folder_from_brian | folder | + | resource | type | + | new_share_from_brian | folder | And "Brian" uploads the following resources | resource | | new-lorem-big.txt | And "Brian" shares the following resource using the sidebar panel - | resource | recipient | type | role | - | folder_from_brian | Alice | user | viewer | - | new-lorem-big.txt | Alice | user | viewer | + | resource | recipient | type | role | + | new_share_from_brian | Alice | user | viewer | + | new-lorem-big.txt | Alice | user | viewer | And "Brian" logs out + When "Alice" logs in And "Alice" navigates to the shared with me page And "Alice" accepts the following share - | name | - | folder_from_brian | - | new-lorem-big.txt | + | name | + | new_share_from_brian | + | new-lorem-big.txt | And "Alice" opens the "files" app And "Alice" creates the following resources | resource | type | | folder | folder | - | FolDer | folder | - | PARENT/child | folder | - | PARENT/child-one | folder | - | PARENT/child-one/child-two | folder | + | FolDer/child-one/child-two | folder | And "Alice" enables the option to display the hidden file And "Alice" uploads the following resources | resource | - | new-lorem.txt | | .hidden-file.txt | - And "Alice" searches "new" using the global search - Then following resources should be displayed in the search list for user "Alice" - | resource | - | new-lorem.txt | - | new-lorem-big.txt | - But following resources should not be displayed in the search list for user "Alice" - | resource | - | PARENT | - | folder_from_brian | - | .hidden-file.txt | + + # search for objects of personal space When "Alice" searches "foldeR" using the global search Then following resources should be displayed in the search list for user "Alice" - | resource | - | folder | - | FolDer | - | folder_from_brian | + | resource | + | folder | + | FolDer | But following resources should not be displayed in the search list for user "Alice" - | resource | - | new-lorem.txt | - | new-lorem-big.txt | - | .hidden-file.txt | + | resource | + | new_share_from_brian | + | new-lorem-big.txt | + | .hidden-file.txt | + + # search for hidden file When "Alice" searches "hidden" using the global search Then following resources should be displayed in the search list for user "Alice" | resource | @@ -74,18 +64,31 @@ Feature: Search | folder | | FolDer | | PARENT | - | folder_from_brian | - | new-lorem.txt | | new-lorem-big.txt | - When "Alice" opens folder "PARENT" + + # subfolder search And "Alice" searches "child" using the global search Then following resources should be displayed in the search list for user "Alice" | resource | - | child | | child-one | - When "Alice" opens folder "child-one" - And "Alice" searches "child-two" using the global search - Then following resources should be displayed in the search list for user "Alice" - | resource | | child-two | + But following resources should not be displayed in the search list for user "Alice" + | resource | + | folder | + | FolDer | + | folder_from_brian | + | .hidden-file.txt | + | new-lorem-big.txt | + + # received shares search + And "Alice" searches "NEW" using the global search + Then following resources should be displayed in the search list for user "Alice" + | resource | + | new_share_from_brian | + | new-lorem-big.txt | + But following resources should not be displayed in the search list for user "Alice" + | resource | + | folder | + | FolDer | + | .hidden-file.txt | And "Alice" logs out diff --git a/tests/e2e/cucumber/features/integrations/searchProjectSpace.ocis.feature b/tests/e2e/cucumber/features/integrations/searchProjectSpace.ocis.feature new file mode 100644 index 00000000000..e43d3c26ea7 --- /dev/null +++ b/tests/e2e/cucumber/features/integrations/searchProjectSpace.ocis.feature @@ -0,0 +1,42 @@ +Feature: Search in the project space + + Scenario: Search in the project spaces + Given "Admin" creates following users + | id | + | Alice | + And "Admin" assigns following roles to the users + | id | role | + | Alice | SpaceAdmin | + When "Alice" logs in + And "Alice" opens the "files" app + And "Alice" navigates to the projects space page + And "Alice" creates the following project spaces + | name | id | + | team | team.1 | + And "Alice" navigates to the project space "team.1" + And "Alice" creates the following resources + | resource | type | + | folder(WithSymbols:!;_+-) | folder | + And "Alice" uploads the following resources + | resource | to | + | new-'single'quotes.txt | folder(WithSymbols:!;_+-) | + And "Alice" navigates to the personal space page + + # search for project space objects + When "Alice" searches "-'s" using the global search + Then following resources should be displayed in the search list for user "Alice" + | resource | + | new-'single'quotes.txt | + But following resources should not be displayed in the search list for user "Alice" + | resource | + | folder(WithSymbols:!;_+-) | + When "Alice" searches "!;_+-)" using the global search + Then following resources should be displayed in the search list for user "Alice" + | resource | + | folder(WithSymbols:!;_+-) | + But following resources should not be displayed in the search list for user "Alice" + | resource | + | new-'single'quotes.txt | + And "Alice" logs out + + \ No newline at end of file From a5dc906ea121414fc3c64b4854745f97a3b171f0 Mon Sep 17 00:00:00 2001 From: Viktor Scharf Date: Mon, 10 Oct 2022 14:53:39 +0200 Subject: [PATCH 2/3] fix after review --- .../searchProjectSpace.ocis.feature | 24 +++++++++---------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/tests/e2e/cucumber/features/integrations/searchProjectSpace.ocis.feature b/tests/e2e/cucumber/features/integrations/searchProjectSpace.ocis.feature index e43d3c26ea7..a3b43b90275 100644 --- a/tests/e2e/cucumber/features/integrations/searchProjectSpace.ocis.feature +++ b/tests/e2e/cucumber/features/integrations/searchProjectSpace.ocis.feature @@ -1,5 +1,5 @@ Feature: Search in the project space - + Scenario: Search in the project spaces Given "Admin" creates following users | id | @@ -15,28 +15,26 @@ Feature: Search in the project space | team | team.1 | And "Alice" navigates to the project space "team.1" And "Alice" creates the following resources - | resource | type | - | folder(WithSymbols:!;_+-) | folder | + | resource | type | + | folder(WithSymbols:!;_+-&) | folder | And "Alice" uploads the following resources - | resource | to | - | new-'single'quotes.txt | folder(WithSymbols:!;_+-) | + | resource | to | + | new-'single'quotes.txt | folder(WithSymbols:!;_+-&) | And "Alice" navigates to the personal space page - + # search for project space objects When "Alice" searches "-'s" using the global search Then following resources should be displayed in the search list for user "Alice" | resource | | new-'single'quotes.txt | But following resources should not be displayed in the search list for user "Alice" - | resource | - | folder(WithSymbols:!;_+-) | - When "Alice" searches "!;_+-)" using the global search + | resource | + | folder(WithSymbols:!;_+-&) | + When "Alice" searches "!;_+-&)" using the global search Then following resources should be displayed in the search list for user "Alice" - | resource | - | folder(WithSymbols:!;_+-) | + | resource | + | folder(WithSymbols:!;_+-&) | But following resources should not be displayed in the search list for user "Alice" | resource | | new-'single'quotes.txt | And "Alice" logs out - - \ No newline at end of file From 60f0ed0aef683a198bcfa835d8bde928c88f1620 Mon Sep 17 00:00:00 2001 From: Viktor Scharf Date: Tue, 11 Oct 2022 15:26:08 +0200 Subject: [PATCH 3/3] fix indentations --- .../searchProjectSpace.ocis.feature | 74 +++++++++---------- 1 file changed, 37 insertions(+), 37 deletions(-) diff --git a/tests/e2e/cucumber/features/integrations/searchProjectSpace.ocis.feature b/tests/e2e/cucumber/features/integrations/searchProjectSpace.ocis.feature index a3b43b90275..6a24c2821ef 100644 --- a/tests/e2e/cucumber/features/integrations/searchProjectSpace.ocis.feature +++ b/tests/e2e/cucumber/features/integrations/searchProjectSpace.ocis.feature @@ -1,40 +1,40 @@ Feature: Search in the project space - Scenario: Search in the project spaces - Given "Admin" creates following users - | id | - | Alice | - And "Admin" assigns following roles to the users - | id | role | - | Alice | SpaceAdmin | - When "Alice" logs in - And "Alice" opens the "files" app - And "Alice" navigates to the projects space page - And "Alice" creates the following project spaces - | name | id | - | team | team.1 | - And "Alice" navigates to the project space "team.1" - And "Alice" creates the following resources - | resource | type | - | folder(WithSymbols:!;_+-&) | folder | - And "Alice" uploads the following resources - | resource | to | - | new-'single'quotes.txt | folder(WithSymbols:!;_+-&) | - And "Alice" navigates to the personal space page + Scenario: Search in the project spaces + Given "Admin" creates following users + | id | + | Alice | + And "Admin" assigns following roles to the users + | id | role | + | Alice | SpaceAdmin | + When "Alice" logs in + And "Alice" opens the "files" app + And "Alice" navigates to the projects space page + And "Alice" creates the following project spaces + | name | id | + | team | team.1 | + And "Alice" navigates to the project space "team.1" + And "Alice" creates the following resources + | resource | type | + | folder(WithSymbols:!;_+-&) | folder | + And "Alice" uploads the following resources + | resource | to | + | new-'single'quotes.txt | folder(WithSymbols:!;_+-&) | + And "Alice" navigates to the personal space page - # search for project space objects - When "Alice" searches "-'s" using the global search - Then following resources should be displayed in the search list for user "Alice" - | resource | - | new-'single'quotes.txt | - But following resources should not be displayed in the search list for user "Alice" - | resource | - | folder(WithSymbols:!;_+-&) | - When "Alice" searches "!;_+-&)" using the global search - Then following resources should be displayed in the search list for user "Alice" - | resource | - | folder(WithSymbols:!;_+-&) | - But following resources should not be displayed in the search list for user "Alice" - | resource | - | new-'single'quotes.txt | - And "Alice" logs out + # search for project space objects + When "Alice" searches "-'s" using the global search + Then following resources should be displayed in the search list for user "Alice" + | resource | + | new-'single'quotes.txt | + But following resources should not be displayed in the search list for user "Alice" + | resource | + | folder(WithSymbols:!;_+-&) | + When "Alice" searches "!;_+-&)" using the global search + Then following resources should be displayed in the search list for user "Alice" + | resource | + | folder(WithSymbols:!;_+-&) | + But following resources should not be displayed in the search list for user "Alice" + | resource | + | new-'single'quotes.txt | + And "Alice" logs out