Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[tests-only][full-ci] changed wording of mount unmount to enable and disable sync #8786

Merged
merged 1 commit into from
Apr 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions tests/TestHelpers/GraphHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -1905,7 +1905,7 @@ public static function getSharesSharedByMe(
* @return ResponseInterface
* @throws GuzzleException
*/
public static function unmountShare(
public static function disableShareSync(
string $baseUrl,
string $xRequestId,
string $user,
Expand Down Expand Up @@ -1934,7 +1934,7 @@ public static function unmountShare(
* @return ResponseInterface
* @throws GuzzleException
*/
public static function mountShare(
public static function enableShareSync(
string $baseUrl,
string $xRequestId,
string $user,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Feature: mount or unmount incoming share
Feature: enable or disable sync of incoming shares
As a user
I want to have control over the share received
So that I can filter out the files and folder shared with Me
Expand All @@ -11,7 +11,7 @@ Feature: mount or unmount incoming share
And using spaces DAV path


Scenario Outline: unmount shared resource
Scenario Outline: disable sync of shared resource
And user "Alice" has created folder "FolderToShare"
And user "Alice" has uploaded file with content "hello world" to "/textfile0.txt"
And user "Alice" has sent the following share invitation:
Expand All @@ -20,7 +20,7 @@ Feature: mount or unmount incoming share
| sharee | Brian |
| shareType | user |
| permissionsRole | Viewer |
When user "Brian" unmounts share "<resource>" using the Graph API
When user "Brian" disables sync of share "<resource>" using the Graph API
And user "Brian" lists the shares shared with him using the Graph API
Then the HTTP status code of responses on all endpoints should be "200"
And the JSON data of the response should match
Expand Down Expand Up @@ -56,7 +56,7 @@ Feature: mount or unmount incoming share
| FolderToShare |


Scenario Outline: mount shared resource when auto-sync is disabled
Scenario Outline: enable sync of shared resource when auto-sync is disabled
Given user "Brian" has disabled the auto-sync share
And user "Alice" has uploaded file with content "hello world" to "/textfile0.txt"
And user "Alice" has created folder "folder"
Expand All @@ -66,7 +66,7 @@ Feature: mount or unmount incoming share
| sharee | Brian |
| shareType | user |
| permissionsRole | Viewer |
When user "Brian" mounts share "<resource>" offered by "Alice" from "Personal" space using the Graph API
When user "Brian" enables sync of share "<resource>" offered by "Alice" from "Personal" space using the Graph API
Then the HTTP status code should be "201"
And the JSON data of the response should match
"""
Expand Down Expand Up @@ -103,7 +103,7 @@ Feature: mount or unmount incoming share
| sharee | grp1 |
| shareType | group |
| permissionsRole | Viewer |
When user "Alice" mounts share "<resource>" offered by "Carol" from "Personal" space using the Graph API
When user "Alice" enables sync of share "<resource>" offered by "Carol" from "Personal" space using the Graph API
Then the HTTP status code should be "201"
And the JSON data of the response should match
"""
Expand Down Expand Up @@ -140,7 +140,7 @@ Feature: mount or unmount incoming share
| sharee | grp1 |
| shareType | group |
| permissionsRole | Viewer |
When user "Alice" unmounts share "<resource>" using the Graph API
When user "Alice" disables sync of share "<resource>" using the Graph API
Then the HTTP status code should be "200"
And user "Alice" should have sync disabled for share "<resource>"
And user "Brian" should have sync enabled for share "<resource>"
Expand Down
35 changes: 12 additions & 23 deletions tests/acceptance/features/bootstrap/SharingNgContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -561,42 +561,31 @@ public function forUserTheSpaceSharesShouldContainTheseEntries(string $user, str
}

/**
* @When user :user disables sync of share :share using the Graph API
*
* @param string $user
* @param string $itemId
* @param string $shareSpaceId
*
* @return ResponseInterface
* @return void
* @throws Exception
*/
public function unmountShare(string $user, string $itemId, string $shareSpaceId): ResponseInterface {
return GraphHelper::unmountShare(
public function userDisablesSyncOfShareUsingTheGraphApi(string $user):void {
$shareItemId = $this->featureContext->shareNgGetLastCreatedUserGroupShareID();
$shareSpaceId = FeatureContext::SHARES_SPACE_ID;
$itemId = $shareSpaceId . '!' . $shareItemId;
$response = GraphHelper::disableShareSync(
$this->featureContext->getBaseUrl(),
$this->featureContext->getStepLineRef(),
$this->featureContext->getActualUsername($user),
$this->featureContext->getPasswordForUser($user),
$itemId,
$shareSpaceId,
);
}

/**
* @When user :user unmounts share :share using the Graph API
*
* @param string $user
*
* @return void
* @throws Exception
*/
public function userUnmountsShareUsingTheGraphApi(string $user):void {
$shareItemId = $this->featureContext->shareNgGetLastCreatedUserGroupShareID();
$shareSpaceId = FeatureContext::SHARES_SPACE_ID;
$itemId = $shareSpaceId . '!' . $shareItemId;
$this->featureContext->setResponse($this->unmountShare($user, $itemId, $shareSpaceId));
$this->featureContext->setResponse($response);
$this->featureContext->pushToLastStatusCodesArrays();
}

/**
* @When user :user mounts share :share offered by :offeredBy from :space space using the Graph API
* @When user :user enables sync of share :share offered by :offeredBy from :space space using the Graph API
*
* @param string $user
* @param string $share
Expand All @@ -606,11 +595,11 @@ public function userUnmountsShareUsingTheGraphApi(string $user):void {
* @return void
* @throws Exception
*/
public function userMountsShareOfferedByFromSpaceUsingTheGraphApi(string $user, string $share, string $offeredBy, string $space):void {
public function userEnablesSyncOfShareUsingTheGraphApi(string $user, string $share, string $offeredBy, string $space):void {
$share = ltrim($share, '/');
$itemId = $this->spacesContext->getResourceId($offeredBy, $space, $share);
$shareSpaceId = FeatureContext::SHARES_SPACE_ID;
$response = GraphHelper::mountShare(
$response = GraphHelper::enableShareSync(
$this->featureContext->getBaseUrl(),
$this->featureContext->getStepLineRef(),
$this->featureContext->getActualUsername($user),
Expand Down