-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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] Refactor createShareToShareFolder.feature to use Shares folder #37881
Conversation
Codecov Report
@@ Coverage Diff @@
## master #37881 +/- ##
=========================================
Coverage 64.75% 64.75%
Complexity 19403 19403
=========================================
Files 1285 1285
Lines 75823 75823
Branches 1336 1336
=========================================
Hits 49096 49096
Misses 26333 26333
Partials 394 394
Flags with carried forward coverage won't be shown. Click here to find out more. Continue to review full report at Codecov.
|
ed0d145
to
b753dbb
Compare
|
For a start, I could change the words to:
That is more the standard grammar that we use. Not mentioning administrator makes it a bit less like an "action" step. We could also say:
That would not imply that any action has to be done - on some system-under-test it might need a setting to be set/changed, on another system-under-test it might be "is" already by default. |
40bd9e0
to
806b69d
Compare
@@ -1923,11 +1943,11 @@ public function checkingLastShareIDIsIncluded() { | |||
} | |||
|
|||
/** | |||
* @Then /^the last share_id should not be included in the response/ | |||
* @Then /^the last share id should not be included in the response/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note: I took the opportunity to change the step text slightly.
@@ -1966,15 +1986,15 @@ public function theResponseShouldNotContainAnyShareIds() { | |||
} | |||
|
|||
/** | |||
* @Then user :user should not see share_id of last share | |||
* @Then user :user should not see the share id of the last share |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note: I took the opportunity to change the step text slightly.
@@ -2462,7 +2482,7 @@ public function userHasDeletedPublicLinkShareNamedUsingTheSharingApi( | |||
} | |||
|
|||
/** | |||
* @When /^user "([^"]*)" (declines|accepts) the share "([^"]*)" offered by user "([^"]*)" using the sharing API$/ | |||
* @When /^user "([^"]*)" (declines|accepts) share "([^"]*)" offered by user "([^"]*)" using the sharing API$/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note: I took the opportunity to change the step text slightly.
@@ -2504,7 +2524,7 @@ public function userReactsToShareOfferedBy($user, $action, $share, $offeredBy) { | |||
} | |||
|
|||
/** | |||
* @Given /^user "([^"]*)" has (declined|accepted) the share "([^"]*)" offered by user "([^"]*)"$/ | |||
* @Given /^user "([^"]*)" has (declined|accepted) share "([^"]*)" offered by user "([^"]*)"$/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note: I took the opportunity to change the step text slightly.
@@ -494,7 +494,7 @@ public function slowdownDavRequests($method, $seconds) { | |||
public function destinationHeaderValue($user, $fileDestination) { | |||
$fullUrl = $this->getBaseUrl() . '/' . | |||
WebDavHelper::getDavPath($user, $this->getDavPathVersion()); | |||
return $fullUrl . '/' . \ltrim($fileDestination, '/'); | |||
return \rtrim($fullUrl, '/') . '/' . \ltrim($fileDestination, '/'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When developing this PR, I noticed that some requests had a double-slash here. If WebDavHelper::getDavPath
already ends with a slash /
then we do not want to end up with 2 slashes. (the server was responding OK, but it will be nicer to test the ordinary case when the request URL has just a single slash between each part)
@@ -1373,7 +1373,7 @@ public function asFileOrFolderShouldExist( | |||
); | |||
Assert::assertTrue( | |||
$this->isEtagValid(), | |||
"$entry '$path' expected to exist but not found" | |||
"$entry '$path' expected to exist for user $user but not found" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I enhanced this message. In scenario outlines with multiple users, it was not clear which user was missing the expected file or folder.
dcf6137
to
304d853
Compare
Description
This is a way to get sharing API test scenarios that will be valid in both oC10 and OCIS. OCIS always puts received shares into a folder called
Shares
for the share receiver. On OCIS, auto-accept shares is always disabled.keep the existing oC10 sharing scenarios that deliver shares into the root
/
folder of the share receiver. Tag themnotToImplementOnOCIS
. That maintains the test coverage of the default sharing on oC10 and the scenarios will not get run on OCIS.make new scenarios in new feature files
*ToSharesFolder.feature
- for examplecreateShareToSharesFolder.feature
. In those scenarios, set the folder for received shares to "Shares".Given the administrator has set the default folder for received shares to "Shares"
And adjust the test steps and expectations so that the share receiver expects the shares in
/Shares
folder.Put no specific tag on these test scenarios - they should pass on both oC10 and OCIS.
That tests a full range of oC10 behavior when the default folder for received shares is configured, and also tests sharing behavior in OCIS.
in the new scenarios, disable auto-accept shares. On OCIS this will do nothing (auto-accept shares is already disabled). On oC10 this will provide the same expected behavior as on OCIS.
Given auto-accept shares has been disabled
And adjust the scenarios so that they have steps to accept a share before the receiver tries to access it. e.g.
So the pattern of these new feature files will have a
Background
that has at least these lines:And such features should work the same way on oC10 and OCIS - so the scenarios can be run on both.
apiShareManagementBasic
suite becomesapiShareToRootManagementBasic
andapiShareToSharesManagementBasic
Related Issue
owncloud/ocis#518
How Has This Been Tested?
CI
Types of changes
Checklist: