From c916528788072763978c2b09a8802ebdc1347f1c Mon Sep 17 00:00:00 2001 From: Viktor Scharf Date: Fri, 10 Oct 2025 11:34:43 +0200 Subject: [PATCH] [full-ci] deleted unused step definitions (#1639) * deleted unused step definitions * fix flaky tests. rearange ine numbers --- tests/acceptance/bootstrap/Sharing.php | 81 ------------------- tests/acceptance/bootstrap/SpacesContext.php | 33 -------- .../expected-failures-without-remotephp.md | 6 +- .../accessToShare.feature | 6 ++ 4 files changed, 9 insertions(+), 117 deletions(-) diff --git a/tests/acceptance/bootstrap/Sharing.php b/tests/acceptance/bootstrap/Sharing.php index 6592cecb2..56e622978 100755 --- a/tests/acceptance/bootstrap/Sharing.php +++ b/tests/acceptance/bootstrap/Sharing.php @@ -1012,60 +1012,6 @@ trait Sharing { } } - /** - * @Given /^user "([^"]*)" has shared (?:file|folder|entry) "([^"]*)" with user "([^"]*)"(?: with permissions (\d+))?$/ - * @Given /^user "([^"]*)" has shared (?:file|folder|entry) "([^"]*)" with user "([^"]*)" with permissions "([^"]*)"$/ - * - * @param string $sharer - * @param string $filepath - * @param string $sharee - * @param string|int|string[]|int[] $permissions - * - * @return void - * @throws Exception - */ - public function userHasSharedFileWithUserUsingTheSharingApi( - string $sharer, - string $filepath, - string $sharee, - $permissions = null - ): void { - $response = $this->createAUserShare( - $sharer, - $filepath, - $this->getActualUsername($sharee), - $permissions - ); - $this->theHTTPStatusCodeShouldBe(200, "", $response); - $this->ocsContext->theOCSStatusCodeShouldBe("100,200", "", $response); - } - - /** - * @Given /^user "([^"]*)" has shared (?:file|folder|entry) "([^"]*)" with the administrator(?: with permissions (\d+))?$/ - * @Given /^user "([^"]*)" has shared (?:file|folder|entry) "([^"]*)" with the administrator with permissions "([^"]*)"$/ - * - * @param string $sharer - * @param string $filepath - * @param string|int|string[]|int[] $permissions - * - * @return void - */ - public function userHasSharedFileWithTheAdministrator( - string $sharer, - string $filepath, - $permissions = null - ): void { - $admin = $this->getAdminUsername(); - $response = $this->createAUserShare( - $sharer, - $filepath, - $this->getActualUsername($admin), - $permissions - ); - $this->theHTTPStatusCodeShouldBe(200, "", $response); - $this->ocsContext->theOCSStatusCodeShouldBe("100,200", "", $response); - } - /** * @When /^the user shares (?:file|folder|entry) "([^"]*)" with user "([^"]*)"(?: with permissions (\d+))? using the sharing API$/ * @When /^the user shares (?:file|folder|entry) "([^"]*)" with user "([^"]*)" with permissions "([^"]*)" using the sharing API$/ @@ -1177,33 +1123,6 @@ trait Sharing { } } - /** - * @Given /^user "([^"]*)" has shared (?:file|folder|entry) "([^"]*)" with group "([^"]*)" with permissions "([^"]*)"$/ - * @Given /^user "([^"]*)" has shared (?:file|folder|entry) "([^"]*)" with group "([^"]*)"(?: with permissions (\d+))?$/ - * - * @param string $user - * @param string $filepath - * @param string $group - * @param string|int|string[]|int[] $permissions - * - * @return void - */ - public function userHasSharedFileWithGroupUsingTheSharingApi( - string $user, - string $filepath, - string $group, - $permissions = null - ) { - $response = $this->createAGroupShare( - $user, - $filepath, - $group, - $permissions - ); - $this->theHTTPStatusCodeShouldBe(200, "", $response); - $this->ocsContext->theOCSStatusCodeShouldBe("100,200", "", $response); - } - /** * @Then /^user "([^"]*)" should not be able to share (?:file|folder|entry) "([^"]*)" with (user|group) "([^"]*)"(?: with permissions (\d+))? using the sharing API$/ * @Then /^user "([^"]*)" should not be able to share (?:file|folder|entry) "([^"]*)" with (user|group) "([^"]*)" with permissions "([^"]*)" using the sharing API$/ diff --git a/tests/acceptance/bootstrap/SpacesContext.php b/tests/acceptance/bootstrap/SpacesContext.php index 87be7a0b8..515b19702 100644 --- a/tests/acceptance/bootstrap/SpacesContext.php +++ b/tests/acceptance/bootstrap/SpacesContext.php @@ -2851,39 +2851,6 @@ class SpacesContext implements Context { ); } - /** - * @Given /^user "([^"]*)" has shared a space "([^"]*)" with settings:$/ - * - * @param string $user - * @param string $spaceName - * @param TableNode $tableNode - * - * @return void - * @throws GuzzleException - */ - public function userHasSharedSpace( - string $user, - string $spaceName, - TableNode $tableNode - ): void { - $rows = $tableNode->getRowsHash(); - $response = $this->shareSpace($user, $spaceName, $rows); - $expectedHTTPStatus = "200"; - $this->featureContext->theHTTPStatusCodeShouldBe( - $expectedHTTPStatus, - "Expected response status code should be $expectedHTTPStatus", - $response - ); - $expectedOCSStatus = "200"; - Assert::assertEquals( - $expectedOCSStatus, - $this->ocsContext->getOCSResponseStatusCode( - $response - ), - "Expected OCS response status code $expectedOCSStatus" - ); - } - /** * @Given user :user has unshared a space :spaceName shared with :recipient * diff --git a/tests/acceptance/expected-failures-without-remotephp.md b/tests/acceptance/expected-failures-without-remotephp.md index b510d89fe..6543d6377 100644 --- a/tests/acceptance/expected-failures-without-remotephp.md +++ b/tests/acceptance/expected-failures-without-remotephp.md @@ -3,9 +3,9 @@ #### [REPORT request without remote.php returns empty result (only with dav/spaces path)](https://github.com/owncloud/ocis/issues/10329) - [apiContract/sharesReport.feature:43](https://github.com/opencloud-eu/opencloud/blob/main/tests/acceptance/features/apiContract/sharesReport.feature#L43) -- [apiContract/sharesReport.feature:68](https://github.com/opencloud-eu/opencloud/blob/main/tests/acceptance/features/apiContract/sharesReport.feature#L68) -- [apiContract/sharesReport.feature:134](https://github.com/opencloud-eu/opencloud/blob/main/tests/acceptance/features/apiContract/sharesReport.feature#L134) -- [apiContract/sharesReport.feature:164](https://github.com/opencloud-eu/opencloud/blob/main/tests/acceptance/features/apiContract/sharesReport.feature#L164) +- [apiContract/sharesReport.feature:84](https://github.com/opencloud-eu/opencloud/blob/main/tests/acceptance/features/apiContract/sharesReport.feature#L84) +- [apiContract/sharesReport.feature:150](https://github.com/opencloud-eu/opencloud/blob/main/tests/acceptance/features/apiContract/sharesReport.feature#L150) +- [apiContract/sharesReport.feature:180](https://github.com/opencloud-eu/opencloud/blob/main/tests/acceptance/features/apiContract/sharesReport.feature#L180) - [apiContract/spacesReport.feature:16](https://github.com/opencloud-eu/opencloud/blob/main/tests/acceptance/features/apiContract/spacesReport.feature#L16) - [apiContract/spacesReport.feature:35](https://github.com/opencloud-eu/opencloud/blob/main/tests/acceptance/features/apiContract/spacesReport.feature#L35) - [apiContract/spacesReport.feature:55](https://github.com/opencloud-eu/opencloud/blob/main/tests/acceptance/features/apiContract/spacesReport.feature#L55) diff --git a/tests/acceptance/features/coreApiShareOperationsToShares1/accessToShare.feature b/tests/acceptance/features/coreApiShareOperationsToShares1/accessToShare.feature index 89f03a38d..f330acf3b 100644 --- a/tests/acceptance/features/coreApiShareOperationsToShares1/accessToShare.feature +++ b/tests/acceptance/features/coreApiShareOperationsToShares1/accessToShare.feature @@ -21,6 +21,7 @@ Feature: sharing | shareType | user | | permissionsRole | Viewer | And using SharingNG + And user "Brian" has a share "textfile0.txt" synced When user "Brian" gets all the shares shared with him using the sharing API Then the OCS status code should be "" And the HTTP status code should be "200" @@ -47,6 +48,8 @@ Feature: sharing | shareType | user | | permissionsRole | Viewer | And using SharingNG + And user "Brian" has a share "textfile1.txt" synced + And user "Brian" has a share "textfile0.txt" synced When user "Brian" gets all the shares shared with him that are received as file "/Shares/textfile1.txt" using the provisioning API Then the OCS status code should be "" And the HTTP status code should be "200" @@ -73,6 +76,8 @@ Feature: sharing | shareType | user | | permissionsRole | Viewer | And using SharingNG + And user "Brian" has a share "textfile0.txt" synced + And user "Brian" has a share "textfile1.txt" synced When user "Brian" gets all the shares shared with him that are received as file "/Shares/textfile0.txt" using the provisioning API Then the OCS status code should be "" And the HTTP status code should be "200" @@ -94,6 +99,7 @@ Feature: sharing | shareType | group | | permissionsRole | Viewer | And using SharingNG + And user "Brian" has a share "textfile0.txt" synced When user "Brian" gets all the shares shared with him using the sharing API Then the OCS status code should be "" And the HTTP status code should be "200"