Compare commits

...
Author SHA1 Message Date
Prajwol Amatya eab1964d25 Automated changelog update [skip ci] 2025-12-12 00:07:25 +00:00
Prajwol Amatya 60087e6905 Automated changelog update [skip ci] 2025-12-11 00:08:35 +00:00
Prajwol Amatya a0763ab979 Automated changelog update [skip ci] 2025-12-09 00:02:48 +00:00
Prajwol Amatya fa95d658c0 Automated changelog update [skip ci] 2025-12-06 00:20:59 +00:00
Prajwol Amatya 23069f50c8 Automated changelog update [skip ci] 2025-12-04 00:07:35 +00:00
Prajwol Amatya d2a05c9258 Automated changelog update [skip ci] 2025-11-29 00:06:41 +00:00
Prajwol Amatya 5bb6dc8d99 Merge pull request #11800 from owncloud/bump-web11.0-commit-id
[tests-only][full-ci]bump latest web commit id
2025-11-07 17:19:36 +05:45
Prajwol Amatya 219919b440 bump latest web commit id
Signed-off-by: Prajwol Amatya <prajwolamatya11@gmail.com>
2025-11-07 16:43:12 +05:45
Sawjan Gurung e4fc7c9dfb Merge pull request #11730 from owncloud/test/bump-web-stable-11.0-commitId
[tests-only][full-ci] Bump web stable 11.0 commit id
2025-10-16 09:32:00 +05:45
pradip 49716045dd test: bump web-stable-11.0-correct commit Id 2025-10-15 16:38:25 +05:45
Phil Davis 1fefdf2219 Merge pull request #11652 from owncloud/tests/backport-fix-regex
[tests-only][full-ci] Backport 7.0-new / fix the correct regex on test script
2025-09-16 08:48:13 +05:45
nabim777 0ade14c0e3 tests: add comment for behat output format handling
Signed-off-by: nabim777 <nabinalemagar019@gmail.com>
2025-09-15 17:35:45 +05:45
nabim777 1880e771a8 fix: correct regex on test script
Signed-off-by: nabim777 <nabinalemagar019@gmail.com>
2025-09-15 12:50:05 +05:45
Nalem7 44ec542bd8 Automated changelog update [skip ci] 2025-08-13 00:46:22 +00:00
Nalem7 05a293af63 Automated changelog update [skip ci] 2025-08-12 03:30:27 +00:00
Nalem7 b1a4e8c656 Automated changelog update [skip ci] 2025-08-05 00:02:08 +00:00
Nalem7 d0e8ce642d Automated changelog update [skip ci] 2025-08-04 04:09:51 +00:00
Nalem7 45d9ed8333 Merge pull request #11548 from owncloud/backport/disable-clone-on-notification
[tests-only][full-ci] Backport/disable clone on notification
2025-07-22 12:16:30 +05:45
Niraj Acharya 625c2050f7 chore(ci):skip clone step in notification pipeline
Signed-off-by: nabim777 <nabinalemagar019@gmail.com>
2025-07-22 09:18:05 +05:45
Prajwol Amatya 3d2366b5df Merge pull request #11536 from owncloud/backport-pr-11534-2
[tests-only][full-ci] update expiration date time in test scenraios
2025-07-15 23:59:46 -07:00
Prajwol Amatya 22c2249ecb update expiration date time in test scenraios 2025-07-16 11:34:39 +05:45
Sawjan Gurung 220cd78423 Automated changelog update [skip ci] 2025-06-20 04:13:15 +00:00
Sawjan Gurung 406b06923c Automated changelog update [skip ci] 2025-06-15 01:00:01 +00:00
Sawjan Gurung 449dbc8ca6 Automated changelog update [skip ci] 2025-06-14 01:00:46 +00:00
Sawjan Gurung 49ca9f4369 Automated changelog update [skip ci] 2025-06-12 04:11:35 +00:00
Sawjan Gurung 86b7fb688a Merge pull request #11402 from owncloud/test/port-share-checks
[tests-only][full-ci] check share sync status before actions
2025-06-06 12:38:54 +05:45
Saw-jan 8d179b6349 test: check share sync status before actions
Signed-off-by: Saw-jan <saw.jan.grg3e@gmail.com>
2025-06-06 09:52:20 +05:45
Sawjan Gurung 482e4fba78 Merge pull request #11393 from owncloud/chore/port-quota-fixes
[full-ci][tests-only] port quota fixes
2025-06-05 10:10:35 +05:45
Saw-jan da04d34aa9 test: fix method args
Signed-off-by: Saw-jan <saw.jan.grg3e@gmail.com>
2025-06-04 17:07:25 +05:45
Saw-jan 58851e0013 test: skip spaces that are marked as deleted
Signed-off-by: Saw-jan <saw.jan.grg3e@gmail.com>
2025-06-04 16:28:09 +05:45
Saw-jan c39582459f test: fix shares space search 2025-06-04 16:28:06 +05:45
Sawjan Gurung f37088906c test: combine spaces and fix user deletion 2025-06-04 16:27:58 +05:45
Saw-jan 3338c95767 test: use store for personal, shares and created spaces 2025-06-04 16:26:24 +05:45
Saw-jan 6a85835c2e test: combine similar steps 2025-06-04 16:20:27 +05:45
Sawjan Gurung a0eaee4988 Merge pull request #11383 from owncloud/backport/fix-matrix-mesgs
[full-ci] Backport: Show build source (branch, tag, or cron) in Matrix notification
2025-06-02 13:39:35 +05:45
nabim777 07ffaa110c CI: notify on failed and passed for tag events
Signed-off-by: nabim777 <nabinalemagar019@gmail.com>
2025-05-30 17:05:36 +05:45
nabim777 2063d7716e CI: show correct build source (branch, tag, or cron) in Matrix notifications
Signed-off-by: nabim777 <nabinalemagar019@gmail.com>
2025-05-30 13:10:23 +05:45
Sawjan Gurung bbee9caad8 Merge pull request #11370 from owncloud/CI/add-matrix-notification-stable-7
[full-ci] Backport: Add matrix notification
2025-05-27 17:37:12 +05:45
nabim777 3435369f1f CI: Fixed the matrix notification script file
Signed-off-by: nabim777 <nabinalemagar019@gmail.com>
2025-05-27 16:24:32 +05:45
Niraj Acharya 6b07eaf874 send build notification to matrix 2025-05-27 16:24:17 +05:45
Sawjan Gurung b8f6e1fc63 Merge pull request #11228 from owncloud/port/k6-n-playwright
[full-ci][tests-only] chore: port skip k6 and web bump
2025-04-11 12:49:21 +05:45
Saw-jan 201aecf766 chore: bump web commit id 2025-04-11 10:33:51 +05:45
Saw-jan e3c0c91e6f ci: run k6 for master branch unless specified in PR title
Signed-off-by: Saw-jan <saw.jan.grg3e@gmail.com>
2025-04-11 10:29:12 +05:45
kobergj 525d63b679 Automated changelog update [skip ci] 2025-03-12 00:55:49 +00:00
kobergj 56056e2cfd Automated changelog update [skip ci] 2025-02-27 12:31:34 +00:00
kobergj 920462283e Merge pull request #11077 from kobergj/FixDrone7.0
Fix `.drone.star` for 7.0 release
2025-02-27 13:29:56 +01:00
Julian Koberg 0a59d112ca fix(ocis): fix .drone.star for 7.0
Signed-off-by: Julian Koberg <jkoberg@MBP-Julian-Koberg.local>
2025-02-27 11:44:57 +01:00
kobergj 5abc047a3e Merge pull request #10979 from owncloud/release-7.0.1
[full-ci] release 7.0.1
2025-02-07 12:12:44 +01:00
Julian Koberg 1f2f50f382 release 7.0.1
Signed-off-by: Julian Koberg <jkoberg@MBP-Julian-Koberg.local>
2025-02-07 11:18:37 +01:00
32 changed files with 893 additions and 865 deletions

No files matched your search

+2 -2
View File
@@ -1,3 +1,3 @@
# The test runner source for UI tests
WEB_COMMITID=264014d2f2a216de72114e5453cfa684ab275978
WEB_BRANCH=stable-11.0
WEB_COMMITID=caf280aa070a0c35e4b184b230d218bfd2be95b3
WEB_BRANCH=stable-11.0-correct
+37 -39
View File
@@ -35,7 +35,6 @@ PLUGINS_GIT_ACTION = "plugins/git-action:1"
PLUGINS_MANIFEST = "plugins/manifest:1"
PLUGINS_S3 = "plugins/s3:1"
PLUGINS_S3_CACHE = "plugins/s3-cache:1"
PLUGINS_SLACK = "plugins/slack:1"
REDIS = "redis:6-alpine"
SONARSOURCE_SONAR_SCANNER_CLI = "sonarsource/sonar-scanner-cli:11.0"
@@ -299,11 +298,6 @@ config = {
"tikaNeeded": True,
},
},
"rocketchat": {
"channel": "builds",
"channel_cron": "builds",
"from_secret": "rocketchat_talk_webhook",
},
"binaryReleases": {
"os": ["linux", "darwin"],
},
@@ -459,7 +453,7 @@ def cachePipeline(name, steps):
"steps": steps,
"trigger": {
"ref": [
"refs/heads/master",
"refs/heads/stable-*",
"refs/tags/**",
"refs/pull/**",
],
@@ -666,7 +660,7 @@ def testOcis(ctx):
"steps": steps,
"trigger": {
"ref": [
"refs/heads/master",
"refs/heads/stable-*",
"refs/pull/**",
],
},
@@ -698,7 +692,7 @@ def scanOcis(ctx):
"steps": steps,
"trigger": {
"ref": [
"refs/heads/master",
"refs/heads/stable-*",
"refs/pull/**",
],
},
@@ -722,7 +716,7 @@ def buildOcisBinaryForTesting(ctx):
rebuildBuildArtifactCache(ctx, "ocis-binary-amd64", "ocis/bin"),
"trigger": {
"ref": [
"refs/heads/master",
"refs/heads/stable-*",
"refs/pull/**",
],
},
@@ -809,7 +803,7 @@ def uploadScanResults(ctx):
],
"trigger": {
"ref": [
"refs/heads/master",
"refs/heads/stable-*",
"refs/pull/**",
],
"status": [
@@ -952,7 +946,7 @@ def codestyle(ctx):
"depends_on": [],
"trigger": {
"ref": [
"refs/heads/master",
"refs/heads/stable-*",
"refs/pull/**",
],
},
@@ -1019,7 +1013,7 @@ def localApiTestPipeline(ctx):
"depends_on": getPipelineNames(buildOcisBinaryForTesting(ctx)),
"trigger": {
"ref": [
"refs/heads/master",
"refs/heads/stable-*",
"refs/pull/**",
],
},
@@ -1085,7 +1079,7 @@ def cs3ApiTests(ctx, storage, accounts_hash_difficulty = 4):
"depends_on": getPipelineNames(buildOcisBinaryForTesting(ctx)),
"trigger": {
"ref": [
"refs/heads/master",
"refs/heads/stable-*",
"refs/pull/**",
],
},
@@ -1204,7 +1198,7 @@ def wopiValidatorTests(ctx, storage, wopiServerType, accounts_hash_difficulty =
"depends_on": getPipelineNames(buildOcisBinaryForTesting(ctx)),
"trigger": {
"ref": [
"refs/heads/master",
"refs/heads/stable-*",
"refs/pull/**",
],
},
@@ -1256,7 +1250,7 @@ def coreApiTests(ctx, part_number = 1, number_of_parts = 1, with_remote_php = Fa
"depends_on": getPipelineNames(buildOcisBinaryForTesting(ctx)),
"trigger": {
"ref": [
"refs/heads/master",
"refs/heads/stable-*",
"refs/pull/**",
],
},
@@ -1297,7 +1291,7 @@ def e2eTestPipeline(ctx):
e2e_trigger = {
"ref": [
"refs/heads/master",
"refs/heads/stable-*",
"refs/tags/**",
"refs/pull/**",
],
@@ -1410,7 +1404,7 @@ def multiServiceE2ePipeline(ctx):
e2e_trigger = {
"ref": [
"refs/heads/master",
"refs/heads/stable-*",
"refs/pull/**",
],
}
@@ -1700,7 +1694,7 @@ def dockerRelease(ctx, arch, repo, build_type):
"depends_on": depends_on,
"trigger": {
"ref": [
"refs/heads/master",
"refs/heads/stable-*",
"refs/tags/v*",
"refs/pull/**",
],
@@ -1861,7 +1855,7 @@ def binaryRelease(ctx, arch, build_type, target, depends_on = []):
"depends_on": depends_on,
"trigger": {
"ref": [
"refs/heads/master",
"refs/heads/stable-*",
"refs/tags/v*",
"refs/pull/**",
],
@@ -1995,7 +1989,7 @@ def licenseCheck(ctx):
],
"trigger": {
"ref": [
"refs/heads/master",
"refs/heads/stable-*",
"refs/tags/v*",
"refs/pull/**",
],
@@ -2062,7 +2056,7 @@ def releaseDockerManifest(ctx, repo, build_type):
"steps": steps,
"trigger": {
"ref": [
"refs/heads/master",
"refs/heads/stable-*",
"refs/tags/v*",
],
},
@@ -2109,7 +2103,7 @@ def changelog():
"push",
],
"message": "Automated changelog update [skip ci]",
"branch": "master",
"branch": "stable-7.0-new",
"author_email": "devops@owncloud.com",
"author_name": "ownClouders",
"netrc_machine": "github.com",
@@ -2131,7 +2125,7 @@ def changelog():
],
"trigger": {
"ref": [
"refs/heads/master",
"refs/heads/stable-*",
"refs/pull/**",
],
},
@@ -2165,7 +2159,7 @@ def releaseDockerReadme(ctx, repo, build_type):
],
"trigger": {
"ref": [
"refs/heads/master",
"refs/heads/stable-*",
"refs/tags/v*",
],
},
@@ -2215,7 +2209,7 @@ def docs():
},
"pages_directory": "docs/hugo/content/",
"copy_contents": "true",
"target_branch": "docs",
"target_branch": "docs-stable-7.0",
"delete": "true",
},
"when": {
@@ -2237,7 +2231,7 @@ def docs():
],
"trigger": {
"ref": [
"refs/heads/master",
"refs/heads/stable-*",
"refs/pull/**",
],
},
@@ -2282,10 +2276,8 @@ def makeGoGenerate(module):
def notify(ctx):
status = ["failure"]
channel = config["rocketchat"]["channel"]
if ctx.build.event == "cron":
if ctx.build.event in ["cron", "tag"]:
status.append("success")
channel = config["rocketchat"]["channel_cron"]
return {
"kind": "pipeline",
@@ -2296,20 +2288,23 @@ def notify(ctx):
},
"steps": [
{
"name": "notify-rocketchat",
"image": PLUGINS_SLACK,
"settings": {
"webhook": {
"from_secret": config["rocketchat"]["from_secret"],
"name": "notify-matrix",
"image": OC_CI_ALPINE,
"environment": {
"MATRIX_TOKEN": {
"from_secret": "matrix_token",
},
"channel": channel,
},
"commands": [
"wget https://raw.githubusercontent.com/%s/%s/tests/config/drone/notification.sh" % (ctx.repo.slug, ctx.build.commit),
"bash notification.sh",
],
},
],
"depends_on": [],
"trigger": {
"ref": [
"refs/heads/master",
"refs/heads/stable-*",
"refs/heads/release*",
"refs/tags/**",
],
@@ -2741,7 +2736,7 @@ def genericCachePurge(flush_path):
],
"trigger": {
"ref": [
"refs/heads/master",
"refs/heads/stable-*",
"refs/pull/**",
],
"status": [
@@ -2934,7 +2929,7 @@ def litmus(ctx, storage):
"depends_on": getPipelineNames(buildOcisBinaryForTesting(ctx)),
"trigger": {
"ref": [
"refs/heads/master",
"refs/heads/stable-*",
"refs/pull/**",
],
},
@@ -3250,9 +3245,11 @@ def k6LoadTests(ctx):
script_link = "%s/%s/tests/config/drone/run_k6_tests.sh" % (ocis_git_base_url, ctx.build.commit)
event_array = ["cron"]
trigger_ref = ["refs/heads/master"]
if "k6-test" in ctx.build.title.lower():
event_array.append("pull_request")
trigger_ref.append("refs/pull/**")
return [{
"kind": "pipeline",
@@ -3305,6 +3302,7 @@ def k6LoadTests(ctx):
"depends_on": [],
"trigger": {
"event": event_array,
"ref": trigger_ref,
},
}]
+432 -486
View File
File diff suppressed because it is too large. Load diff
@@ -0,0 +1,6 @@
Enhancement: Update Web to v11.0.7
- Bugfix [owncloud/web#12167](https://github.com/owncloud/web/pull/12167): Replace text editor: #12167
https://github.com/owncloud/ocis/pull/10978
https://github.com/owncloud/web/releases/tag/v11.0.7
+1 -1
View File
@@ -16,7 +16,7 @@ var (
// LatestTag is the latest released version plus the dev meta version.
// Will be overwritten by the release pipeline
// Needs a manual change for every tagged release
LatestTag = "7.0.0+dev"
LatestTag = "7.0.1+dev"
// Date indicates the build date.
// This has been removed, it looks like you can only replace static strings with recent go versions
+1 -1
View File
@@ -1,6 +1,6 @@
SHELL := bash
NAME := web
WEB_ASSETS_VERSION = v11.0.6
WEB_ASSETS_VERSION = v11.0.7
include ../../.make/recursion.mk
+1 -1
View File
@@ -2,7 +2,7 @@
sonar.projectKey=owncloud_ocis
sonar.organization=owncloud-1
sonar.projectName=ocis
sonar.projectVersion=7.0.0
sonar.projectVersion=7.0.1
sonar.host.url=https://sonarcloud.io
# =====================================================
+4 -2
View File
@@ -1041,7 +1041,8 @@ class GraphHelper {
array $body = [],
array $headers = []
): ResponseInterface {
$url = self::getFullUrl($baseUrl, 'me/drives' . $urlArguments);
$urlArguments = $urlArguments ? "?$urlArguments" : "";
$url = self::getFullUrl($baseUrl, "me/drives" . $urlArguments);
return HttpRequestHelper::get($url, $xRequestId, $user, $password, $headers, $body);
}
@@ -1070,7 +1071,8 @@ class GraphHelper {
array $body = [],
array $headers = []
): ResponseInterface {
$url = self::getFullUrl($baseUrl, 'drives/' . $urlArguments);
$urlArguments = $urlArguments ? "?$urlArguments" : "";
$url = self::getFullUrl($baseUrl, "drives" . $urlArguments);
return HttpRequestHelper::get($url, $xRequestId, $user, $password, $headers, $body);
}
@@ -55,7 +55,7 @@ class HttpRequestHelper {
*
* @return int
*/
public static function numRetriesOnHttpTooEarly():int {
public static function maxHTTPRequestRetries(): int {
// Currently reva and oCIS may return HTTP_TOO_EARLY
// So try up to 10 times before giving up.
return 10;
@@ -203,7 +203,7 @@ class HttpRequestHelper {
$debugResponses = false;
}
$sendRetryLimit = self::numRetriesOnHttpTooEarly();
$sendRetryLimit = self::maxHTTPRequestRetries();
$sendCount = 0;
$sendExceptionHappened = false;
do {
@@ -1734,8 +1734,6 @@ class FeatureContext extends BehatVariablesContext {
return $this->getAdminPassword();
} elseif (\array_key_exists($username, $this->createdUsers)) {
return (string)$this->createdUsers[$username]['password'];
} elseif (\array_key_exists($username, $this->createdRemoteUsers)) {
return (string)$this->createdRemoteUsers[$username]['password'];
}
// The user has not been created yet, see if there is a replacement
@@ -1810,12 +1808,6 @@ class FeatureContext extends BehatVariablesContext {
}
return $userName;
}
if (\array_key_exists($username, $this->createdRemoteUsers)) {
if (isset($this->createdRemoteUsers[$username]['displayname'])) {
return (string)$this->createdRemoteUsers[$username]['displayname'];
}
return $userName;
}
// The user has not been created yet, see if there is a replacement
// defined for the user.
@@ -1871,9 +1863,6 @@ class FeatureContext extends BehatVariablesContext {
if (\array_key_exists($username, $this->createdUsers)) {
return (string)$this->createdUsers[$username]['email'];
}
if (\array_key_exists($username, $this->createdRemoteUsers)) {
return (string)$this->createdRemoteUsers[$username]['email'];
}
// The user has not been created yet, see if there is a replacement
// defined for the user.
+61 -24
View File
@@ -92,18 +92,27 @@ class GraphContext implements Context {
*
* @param string $byUser
* @param string $user
* @param string $userName
* @param string $newUsername
*
* @return void
* @throws GuzzleException
* @throws Exception
*/
public function theUserChangesTheUserNameOfUserToUsingTheGraphApi(string $byUser, string $user, string $userName): void {
$response = $this->editUserUsingTheGraphApi($byUser, $user, $userName);
public function theUserChangesTheUserNameOfUserToUsingTheGraphApi(
string $byUser,
string $user,
string $newUsername
): void {
$response = $this->editUserUsingTheGraphApi($byUser, $user, $newUsername);
$this->featureContext->setResponse($response);
// need to add user to list to delete him after test
if (!empty($userName) && $this->featureContext->getAttributeOfCreatedUser($userName, 'id')) {
$this->featureContext->addUserToCreatedUsersList($userName, $this->featureContext->getUserPassword($user));
// save the updated user
if (!empty($newUsername) && $response->getStatusCode() === 200) {
$this->featureContext->rememberThatUserIsNotExpectedToExist($user);
$this->featureContext->addUserToCreatedUsersList(
$newUsername,
$this->featureContext->getUserPassword($user)
);
}
}
@@ -274,13 +283,17 @@ class GraphContext implements Context {
*/
public function adminDeletesUserUsingTheGraphApi(string $user, ?string $byUser = null): ResponseInterface {
$credentials = $this->getAdminOrUserCredentials($byUser);
return GraphHelper::deleteUser(
$response = GraphHelper::deleteUser(
$this->featureContext->getBaseUrl(),
$this->featureContext->getStepLineRef(),
$credentials["username"],
$credentials["password"],
$user
);
if ($response->getStatusCode() === 204) {
$this->featureContext->rememberThatUserIsNotExpectedToExist($user);
}
return $response;
}
/**
@@ -310,21 +323,30 @@ class GraphContext implements Context {
/**
* sends a request to delete a user with the help of userID using the Graph API
*
* @param string $userId
* @param string $user
* @param string $byUser
*
* @return ResponseInterface
* @throws GuzzleException
*/
public function deleteUserByUserIdUsingTheGraphApi(string $userId, string $byUser): ResponseInterface {
public function deleteUserByUserId(string $user, string $byUser): ResponseInterface {
if ($user === "nonexistent") {
$userId = WebDavHelper::generateUUIDv4();
} else {
$userId = $this->featureContext->getUserIdByUserName($user);
}
$credentials = $this->getAdminOrUserCredentials($byUser);
return GraphHelper::deleteUserByUserId(
$response = GraphHelper::deleteUserByUserId(
$this->featureContext->getBaseUrl(),
$this->featureContext->getStepLineRef(),
$credentials["username"],
$credentials["password"],
$userId
);
if ($response->getStatusCode() === 204) {
$this->featureContext->rememberThatUserIsNotExpectedToExist($user);
}
return $response;
}
/**
@@ -338,8 +360,7 @@ class GraphContext implements Context {
* @throws GuzzleException
*/
public function theUserDeletesAUserUsingTheGraphAPI(string $byUser, string $user): void {
$userId = $this->featureContext->getUserIdByUserName($user);
$this->featureContext->setResponse($this->deleteUserByUserIdUsingTheGraphApi($userId, $byUser));
$this->featureContext->setResponse($this->deleteUserByUserId($user, $byUser));
}
/**
@@ -352,8 +373,7 @@ class GraphContext implements Context {
* @throws Exception
*/
public function theUserTriesToDeleteNonExistingUser(string $byUser): void {
$userId = WebDavHelper::generateUUIDv4();
$this->featureContext->setResponse($this->deleteUserByUserIdUsingTheGraphApi($userId, $byUser));
$this->featureContext->setResponse($this->deleteUserByUserId("nonexistent", $byUser));
}
/**
@@ -667,11 +687,12 @@ class GraphContext implements Context {
$rows["email"],
$rows["displayName"]
);
$this->featureContext->setResponse($response);
// add created user to list except for the user with an empty name
// because request /graph/v1.0/users/emptyUserName exits with 200
// and we cannot check that the user with empty name doesn't exist
if (!empty($rows["userName"])) {
if (!empty($rows["userName"]) && $response->getStatusCode() === 201) {
$this->featureContext->addUserToCreatedUsersList(
$rows["userName"],
$rows["password"],
@@ -679,7 +700,6 @@ class GraphContext implements Context {
$rows["email"]
);
}
$this->featureContext->setResponse($response);
}
/**
@@ -2537,7 +2557,9 @@ class GraphContext implements Context {
if ($retryEnabled) {
foreach ($jsonBody->value as $share) {
$autoSync = $this->featureContext->getUserAutoSyncSetting($credentials['username']);
$tryAgain = !$share->{'@client.synchronize'} && $autoSync && $retried < HttpRequestHelper::numRetriesOnHttpTooEarly();
$tryAgain = !$share->{'@client.synchronize'}
&& $autoSync
&& $retried < HttpRequestHelper::maxHTTPRequestRetries();
if ($tryAgain) {
$retried += 1;
@@ -2772,8 +2794,12 @@ class GraphContext implements Context {
* @return void
* @throws Exception
*/
public function userListsTheActivitiesForResourceOfSpaceUsingTheGraphAPI(string $user, string $resource, string $spaceName): void {
$resourceId = $this->featureContext->spacesContext->getResourceId($user, $spaceName, $resource);
public function userListsTheActivitiesForResourceOfSpaceUsingTheGraphAPI(
string $user,
string $resource,
string $spaceName
): void {
$resourceId = $this->spacesContext->getResourceId($user, $spaceName, $resource);
$response = GraphHelper::getActivities(
$this->featureContext->getBaseUrl(),
$this->featureContext->getStepLineRef(),
@@ -2820,8 +2846,13 @@ class GraphContext implements Context {
*
* @return void
*/
public function userTriesToListActivitiesOfFileFromSpaceOwnedByUserUsingTheGraphApi(string $user, string $file, string $owner, string $spaceName): void {
$resourceId = $this->featureContext->spacesContext->getResourceId($owner, $spaceName, $file);
public function userTriesToListActivitiesOfFileFromSpaceOwnedByUserUsingTheGraphApi(
string $user,
string $file,
string $owner,
string $spaceName
): void {
$resourceId = $this->spacesContext->getResourceId($owner, $spaceName, $file);
$response = GraphHelper::getActivities(
$this->featureContext->getBaseUrl(),
$this->featureContext->getStepLineRef(),
@@ -2841,7 +2872,7 @@ class GraphContext implements Context {
* @return void
*/
public function userListsTheActivitiesOfSpaceUsingTheGraphApi(string $user, string $spaceName): void {
$spaceId = ($this->featureContext->spacesContext->getSpaceByName($user, $spaceName))["id"];
$spaceId = ($this->spacesContext->getSpaceByName($user, $spaceName))["id"];
$response = GraphHelper::getActivities(
$this->featureContext->getBaseUrl(),
$this->featureContext->getStepLineRef(),
@@ -2904,8 +2935,14 @@ class GraphContext implements Context {
*
* @return void
*/
public function userListsTheActivitiesForFolderOfSpaceWithDepthOrLimitUsingTheGraphApi(string $user, string $resource, string $spaceName, string $filterType, string $filterValue): void {
$resourceId = $this->featureContext->spacesContext->getResourceId($user, $spaceName, $resource);
public function userListsTheActivitiesForFolderOfSpaceWithDepthOrLimitUsingTheGraphApi(
string $user,
string $resource,
string $spaceName,
string $filterType,
string $filterValue
): void {
$resourceId = $this->spacesContext->getResourceId($user, $spaceName, $resource);
$response = GraphHelper::getActivities(
$this->featureContext->getBaseUrl(),
$this->featureContext->getStepLineRef(),
+43 -79
View File
@@ -41,12 +41,6 @@ trait Provisioning {
* key is the lowercase username, value is an array of user attributes
*/
private array $createdUsers = [];
/**
* list of users that were created on the remote server during test runs
* key is the lowercase username, value is an array of user attributes
*/
private array $createdRemoteUsers = [];
private array $startingGroups = [];
private array $createdRemoteGroups = [];
private array $createdGroups = [];
@@ -86,14 +80,7 @@ trait Provisioning {
/**
* @return array
*/
public function getAllCreatedUsers():array {
return array_merge($this->createdUsers, $this->createdRemoteUsers);
}
/**
* @return array
*/
public function getCreatedGroups():array {
public function getCreatedGroups(): array {
return $this->createdGroups;
}
@@ -107,7 +94,7 @@ trait Provisioning {
*/
public function getUserDisplayName(string $username):string {
$normalizedUsername = $this->normalizeUsername($username);
$users = $this->getAllCreatedUsers();
$users = $this->getCreatedUsers();
if (isset($users[$normalizedUsername]['displayname'])) {
$displayName = (string) $users[$normalizedUsername]['displayname'];
if ($displayName !== '') {
@@ -125,7 +112,7 @@ trait Provisioning {
* @throws Exception
*/
public function getAttributeOfCreatedUser(string $user, string $attribute) {
$usersList = $this->getAllCreatedUsers();
$usersList = $this->getCreatedUsers();
$normalizedUsername = $this->normalizeUsername($user);
if (\array_key_exists($normalizedUsername, $usersList)) {
if (\array_key_exists($attribute, $usersList[$normalizedUsername])) {
@@ -175,8 +162,6 @@ trait Provisioning {
$password = $this->getAdminPassword();
} elseif (\array_key_exists($normalizedUsername, $this->createdUsers)) {
$password = $this->createdUsers[$normalizedUsername]['password'];
} elseif (\array_key_exists($normalizedUsername, $this->createdRemoteUsers)) {
$password = $this->createdRemoteUsers[$normalizedUsername]['password'];
} else {
throw new Exception(
"user '$username' was not created by this test run"
@@ -754,7 +739,6 @@ trait Provisioning {
$this->userExists($user),
"User '$user' should not exist but does exist"
);
$this->rememberThatUserIsNotExpectedToExist($user);
}
/**
@@ -841,7 +825,6 @@ trait Provisioning {
$this->userExists($user),
"User '$user' should not exist but does exist"
);
$this->rememberThatUserIsNotExpectedToExist($user);
}
/**
@@ -941,20 +924,22 @@ trait Provisioning {
*
* @return void
*/
public function initializeUser(string $user, string $password):void {
$url = $this->getBaseUrl() . "/graph/v1.0/users/$user";
public function initializeUser(string $user, string $password): void {
if (OcisHelper::isTestingOnReva()) {
$url = $this->getBaseUrl()
. "/ocs/v$this->ocsApiVersion.php/cloud/users/$user";
$url = $this->getBaseUrl() . "/ocs/v$this->ocsApiVersion.php/cloud/users/$user";
HttpRequestHelper::get(
$url,
$this->getStepLineRef(),
$user,
$password
);
return;
}
HttpRequestHelper::get(
$url,
$this->getStepLineRef(),
$user,
$password
);
// initialize user by requesting drives
// NOTE: this should not be removed,
// as it will save the Personal and Shares drives information
$this->spacesContext->getSpaceByName($user, 'Personal');
}
/**
@@ -962,8 +947,8 @@ trait Provisioning {
* makes it possible to use this list in other test steps
* or to delete them at the end of the test
*
* @param string|null $user
* @param string|null $password
* @param string $user
* @param string $password
* @param string|null $displayName
* @param string|null $email
* @param string|null $userId only set for the users created using the Graph API
@@ -973,8 +958,8 @@ trait Provisioning {
* @throws JsonException
*/
public function addUserToCreatedUsersList(
?string $user,
?string $password,
string $user,
string $password,
?string $displayName = null,
?string $email = null,
?string $userId = null,
@@ -982,30 +967,17 @@ trait Provisioning {
):void {
$user = $this->getActualUsername($user);
$normalizedUsername = $this->normalizeUsername($user);
$userData = [
"password" => $password,
"displayname" => $displayName,
"email" => $email,
"shouldExist" => $shouldExist,
"actualUsername" => $user,
"id" => $userId
];
if ($this->currentServer === 'LOCAL') {
// Only remember this user creation if it was expected to have been successful
// or the user has not been processed before. Some tests create a user the
// first time (successfully) and then purposely try to create the user again.
// The 2nd user creation is expected to fail, and in that case we want to
// still remember the details of the first user creation.
if ($shouldExist || !\array_key_exists($normalizedUsername, $this->createdUsers)) {
$this->createdUsers[$normalizedUsername] = $userData;
}
} elseif ($this->currentServer === 'REMOTE') {
// See comment above about the LOCAL case. The logic is the same for the remote case.
if ($shouldExist || !\array_key_exists($normalizedUsername, $this->createdRemoteUsers)) {
$this->createdRemoteUsers[$normalizedUsername] = $userData;
$this->createdUsers[$normalizedUsername] = $userData;
}
if ($shouldExist || !\array_key_exists($normalizedUsername, $this->createdUsers)) {
$this->createdUsers[$normalizedUsername] = [
"password" => $password,
"displayname" => $displayName,
"email" => $email,
"shouldExist" => $shouldExist,
"actualUsername" => $user,
"id" => $userId,
"serverType" => $this->currentServer
];
}
}
@@ -1023,14 +995,8 @@ trait Provisioning {
string $password
):void {
$normalizedUsername = $this->normalizeUsername($user);
if ($this->currentServer === 'LOCAL') {
if (\array_key_exists($normalizedUsername, $this->createdUsers)) {
$this->createdUsers[$normalizedUsername]['password'] = $password;
}
} elseif ($this->currentServer === 'REMOTE') {
if (\array_key_exists($normalizedUsername, $this->createdRemoteUsers)) {
$this->createdRemoteUsers[$user]['password'] = $password;
}
if (\array_key_exists($normalizedUsername, $this->createdUsers)) {
$this->createdUsers[$normalizedUsername]['password'] = $password;
}
}
@@ -1769,6 +1735,9 @@ trait Provisioning {
// users can be deleted using the username in the GraphApi too
$response = $this->graphContext->adminDeletesUserUsingTheGraphApi($user);
}
if ($response->getStatusCode() === 204) {
$this->rememberThatUserIsNotExpectedToExist($user);
}
return $response;
}
@@ -1975,25 +1944,20 @@ trait Provisioning {
*/
public function cleanupDatabaseUsers():void {
$previousServer = $this->currentServer;
$this->usingServer('LOCAL');
foreach ($this->createdUsers as $userData) {
// do not try to delete if user doesn't exist
if (!$userData["shouldExist"]) {
continue;
}
$this->usingServer($userData["serverType"]);
$user = $userData['actualUsername'];
$this->deleteUser($user);
$response = $this->deleteUser($user);
$this->theHTTPStatusCodeShouldBe(204, "Failed to delete user '$user'", $response);
Assert::assertFalse(
$this->userExists($user),
"User '$user' should not exist but does exist"
);
$this->rememberThatUserIsNotExpectedToExist($user);
}
$this->usingServer('REMOTE');
foreach ($this->createdRemoteUsers as $userData) {
$user = $userData['actualUsername'];
$this->deleteUser($user);
Assert::assertFalse(
$this->userExists($user),
"User '$user' should not exist but does exist"
);
$this->rememberThatUserIsNotExpectedToExist($user);
}
$this->usingServer($previousServer);
}
@@ -162,7 +162,7 @@ class SettingsContext implements Context {
$decodedBody = \json_decode($rawBody, true, 512, JSON_THROW_ON_ERROR);
$tryAgain = false;
} catch (Exception $e) {
$tryAgain = $retried < HttpRequestHelper::numRetriesOnHttpTooEarly();
$tryAgain = $retried < HttpRequestHelper::maxHTTPRequestRetries();
if (!$tryAgain) {
throw $e;
@@ -72,11 +72,7 @@ class SharingNgContext implements Context {
$bodyRows = $body->getRowsHash();
$resource = $bodyRows['resource'] ?? "";
if ($bodyRows['space'] === 'Personal' || $bodyRows['space'] === 'Shares') {
$space = $this->spacesContext->getSpaceByName($user, $bodyRows['space']);
} else {
$space = $this->spacesContext->getCreatedSpace($bodyRows['space']);
}
$space = $this->spacesContext->getSpaceByName($user, $bodyRows['space']);
$spaceId = $space['id'];
if ($resource === '' && !\in_array($bodyRows['space'], ['Personal', 'Shares'])) {
@@ -251,11 +247,7 @@ class SharingNgContext implements Context {
string $fileId = null,
bool $federatedShare = false
): ResponseInterface {
if ($shareInfo['space'] === 'Personal' || $shareInfo['space'] === 'Shares') {
$space = $this->spacesContext->getSpaceByName($user, $shareInfo['space']);
} else {
$space = $this->spacesContext->getCreatedSpace($shareInfo['space']);
}
$space = $this->spacesContext->getSpaceByName($user, $shareInfo['space']);
$spaceId = $space['id'];
// $fileId is used for trying to share deleted files
@@ -336,11 +328,7 @@ class SharingNgContext implements Context {
public function sendDriveShareInvitation(string $user, TableNode $table, bool $federatedShare = false): ResponseInterface {
$shareeIds = [];
$rows = $table->getRowsHash();
if ($rows['space'] === 'Personal' || $rows['space'] === 'Shares') {
$space = $this->spacesContext->getSpaceByName($user, $rows['space']);
} else {
$space = $this->spacesContext->getCreatedSpace($rows['space']);
}
$space = $this->spacesContext->getSpaceByName($user, $rows['space']);
$spaceId = $space['id'];
$sharees = array_map('trim', explode(',', $rows['sharee']));
@@ -581,11 +569,7 @@ class SharingNgContext implements Context {
*/
public function updateResourceShare(string $user, TableNode $body, string $permissionID): ResponseInterface {
$bodyRows = $body->getRowsHash();
if ($bodyRows['space'] === 'Personal' || $bodyRows['space'] === 'Shares') {
$space = $this->spacesContext->getSpaceByName($user, $bodyRows['space']);
} else {
$space = $this->spacesContext->getCreatedSpace($bodyRows['space']);
}
$space = $this->spacesContext->getSpaceByName($user, $bodyRows['space']);
$spaceId = $space["id"];
// for updating role of project space shared, we do not need to provide resource
$resource = $bodyRows['resource'] ?? '';
@@ -1358,7 +1342,7 @@ class SharingNgContext implements Context {
return;
}
$tryAgain = !$shareSynced && $retried < HttpRequestHelper::numRetriesOnHttpTooEarly();
$tryAgain = !$shareSynced && $retried < HttpRequestHelper::maxHTTPRequestRetries();
if ($tryAgain) {
$retried += 1;
echo "[INFO] Wait for share sync status...";
+155 -129
View File
@@ -54,7 +54,7 @@ class SpacesContext implements Context {
/**
* key is space name and value is the username that created the space
*/
private array $createdSpaces;
private array $createdSpaces = [];
private string $ocsApiUrl = '/ocs/v2.php/apps/files_sharing/api/v1/shares';
/**
@@ -74,6 +74,27 @@ class SpacesContext implements Context {
*/
private array $storedEtags = [];
/**
* @param string $spaceCreator
* @param object $space
*
* @return void
*/
public function addToCreatedSpace(string $spaceCreator, object $space): void {
$spaceName = $space->name;
$this->createdSpaces[$spaceName] = $space;
$this->createdSpaces[$spaceName]->spaceCreator = $spaceCreator;
$this->createdSpaces[$spaceName]->fileId = $space->id . '!' . $space->owner->user->id;
$this->createdSpaces[$spaceName]->serverType = $this->featureContext->getCurrentServer();
}
/**
* @return array
*/
public function getCreatedSpaces(): array {
return $this->createdSpaces;
}
/**
* @param string $spaceName
*
@@ -87,46 +108,38 @@ class SpacesContext implements Context {
return $this->createdSpaces[$spaceName]['spaceCreator'];
}
/**
* @param string $spaceCreator
* @param ResponseInterface $response
*
* @return void
*/
public function addCreatedSpace(string $spaceCreator, ResponseInterface $response): void {
$response = $this->featureContext->getJsonDecodedResponseBodyContent($response);
$spaceName = $response->name;
$this->createdSpaces[$spaceName] = [];
$this->createdSpaces[$spaceName]['id'] = $response->id;
$this->createdSpaces[$spaceName]['spaceCreator'] = $spaceCreator;
$this->createdSpaces[$spaceName]['fileId'] = $response->id . '!' . $response->owner->user->id;
}
/**
* @param string $spaceName
*
* @return array
*/
public function getCreatedSpace(string $spaceName): array {
return $this->createdSpaces[$spaceName];
}
private array $availableSpaces = [];
private array $personalSpaces = [];
/**
* @return array
*/
public function getAvailableSpaces(): array {
return $this->availableSpaces;
public function getPersonalSpaces(): array {
return $this->personalSpaces;
}
/**
* @param array $availableSpaces
* @param string $user
*
* @return object|null
*/
public function getPersonalSpaceForUser(string $user): ?object {
$spaceName = $this->featureContext->getUserDisplayName($user);
if (!isset($this->personalSpaces[$spaceName])) {
return null;
}
return $this->personalSpaces[$spaceName];
}
/**
* @param string $user
* @param object $space
*
* @return void
*/
public function setAvailableSpaces(array $availableSpaces): void {
$this->availableSpaces = $availableSpaces;
public function addPersonalSpaceForUser(string $user, object $space): void {
$spaceName = $this->featureContext->getUserDisplayName($user);
$this->personalSpaces[$spaceName] = $space;
$this->personalSpaces[$spaceName]->serverType = $this->featureContext->getCurrentServer();
}
/**
@@ -175,8 +188,6 @@ class SpacesContext implements Context {
}
/**
* The method finds available spaces to the user and returns the space by spaceName
*
* @param string $user
* @param string $spaceName
*
@@ -184,26 +195,74 @@ class SpacesContext implements Context {
* @throws GuzzleException
*/
public function getSpaceByName(string $user, string $spaceName): array {
$password = $this->featureContext->getPasswordForUser($user);
$createdSpaces = $this->getCreatedSpaces();
$personalSpaces = $this->getPersonalSpaces();
$allSpaces = \array_merge($createdSpaces, $personalSpaces);
if ($spaceName === "Personal") {
$spaceName = $this->featureContext->getUserDisplayName($user);
}
if (strtolower($user) === 'admin') {
$listSpacesFn = 'listAllAvailableSpaces';
} else {
$listSpacesFn = 'listAllAvailableSpacesOfUser';
if (isset($allSpaces[$spaceName])
&& $allSpaces[$spaceName]->serverType === $this->featureContext->getCurrentServer()
) {
return json_decode(json_encode($allSpaces[$spaceName]), true);
}
// Sometimes listing available spaces might not return newly created/shared spaces.
// So we try again until we find the space or we reach the max number of retries (i.e. 10)
$retried = 0;
do {
// empty the available spaces array
$this->setAvailableSpaces([]);
// list 'me/drives' as given user
$response = GraphHelper::getMySpaces(
$this->featureContext->getBaseUrl(),
$user,
$password,
"",
$this->featureContext->getStepLineRef()
);
// NOTE: user can be created with empty password
// so if that's the case, the user won't be able to request using empty password
// and user won't have personal space.
if ($response->getStatusCode() === 401 && !$password) {
return [];
}
$this->featureContext->theHttpStatusCodeShouldBe(
200,
"Failed to fetch me/drives for user '$user'",
$response
);
$spaces = $this->featureContext->getJsonDecodedResponseBodyContent($response)->value;
$this->$listSpacesFn($user);
$spaces = $this->getAvailableSpaces();
$found = false;
$foundSpace = [];
$tryAgain = !\array_key_exists($spaceName, $spaces) && $retried < HttpRequestHelper::numRetriesOnHttpTooEarly();
// update the Shares space with other properties
// NOTE: the order of drives list can be different
// so this extra loop is needed to find and update the Shares space properties
if ($allSpaces["Shares"]->name !== "Shares") {
foreach ($spaces as $space) {
if ($space->name === "Shares") {
$this->addPersonalSpaceForUser("Shares", $space);
break;
}
}
}
foreach ($spaces as $space) {
if ($space->name === $spaceName && !isset($space->root->deleted)) {
$found = true;
$foundSpace = $space;
if ($space->driveType === "project") {
$this->addToCreatedSpace($user, $space);
} elseif (!($space->name === "Shares" && $space->driveType === "virtual")) {
$this->addPersonalSpaceForUser($user, $space);
}
break;
}
}
$tryAgain = !$found && $retried < HttpRequestHelper::maxHTTPRequestRetries();
if ($tryAgain) {
$retried += 1;
echo "Space '$spaceName' not found for user '$user', retrying ($retried)...\n";
@@ -212,9 +271,8 @@ class SpacesContext implements Context {
}
} while ($tryAgain);
Assert::assertArrayHasKey($spaceName, $spaces, "Space with name '$spaceName' for user '$user' not found");
Assert::assertNotEmpty($spaces[$spaceName]["root"]["webDavUrl"], "WebDavUrl for space with name '$spaceName' for user '$user' not found");
return $spaces[$spaceName];
Assert::assertTrue($found, "Space '$spaceName' not found for user '$user'");
return json_decode(json_encode($foundSpace), true);
}
/**
@@ -426,6 +484,18 @@ class SpacesContext implements Context {
$this->checksumContext = BehatHelper::getContext($scope, $environment, 'ChecksumContext');
$this->filesVersionsContext = BehatHelper::getContext($scope, $environment, 'FilesVersionsContext');
$this->archiverContext = BehatHelper::getContext($scope, $environment, 'ArchiverContext');
// add Shares space as its drive-id is known
// NOTE: this cannot be moved into a constructor method
// because it uses the $this->featureContext object
$this->personalSpaces = [
"Shares" => (object)[
"id" => GraphHelper::SHARES_SPACE_ID,
// let 'name' be empty, it is used to update the shares space later on
"name" => "",
"serverType" => $this->featureContext->getCurrentServer()
]
];
}
/**
@@ -450,22 +520,16 @@ class SpacesContext implements Context {
* @throws Exception|GuzzleException
*/
public function deleteAllProjectSpaces(): void {
$query = "\$filter=driveType eq project";
$userAdmin = $this->featureContext->getAdminUsername();
$drives = $this->getCreatedSpaces();
$this->listAllAvailableSpaces(
$userAdmin,
$query
);
$drives = $this->getAvailableSpaces();
foreach ($drives as $value) {
if (!\array_key_exists("deleted", $value["root"])) {
foreach ($drives as $drive) {
if (!isset($drive->root->deleted)) {
GraphHelper::disableSpace(
$this->featureContext->getBaseUrl(),
$userAdmin,
$this->featureContext->getPasswordForUser($userAdmin),
$value["id"],
$drive->id,
$this->featureContext->getStepLineRef()
);
}
@@ -473,7 +537,7 @@ class SpacesContext implements Context {
$this->featureContext->getBaseUrl(),
$userAdmin,
$this->featureContext->getPasswordForUser($userAdmin),
$value["id"],
$drive->id,
$this->featureContext->getStepLineRef()
);
}
@@ -539,18 +603,20 @@ class SpacesContext implements Context {
* @throws GuzzleException
* @throws Exception
*/
public function listAllAvailableSpacesOfUser(string $user, string $query = '', array $headers = []): ResponseInterface {
$response = GraphHelper::getMySpaces(
public function listAllMySpaces(
string $user,
string $query = '',
array $headers = []
): ResponseInterface {
return GraphHelper::getMySpaces(
$this->featureContext->getBaseUrl(),
$user,
$this->featureContext->getPasswordForUser($user),
"?" . $query,
$query,
$this->featureContext->getStepLineRef(),
[],
$headers
);
$this->rememberTheAvailableSpaces($response);
return $response;
}
/**
@@ -566,7 +632,7 @@ class SpacesContext implements Context {
* @throws Exception
*/
public function theUserListsAllHisAvailableSpacesUsingTheGraphApi(string $user, string $query = ''): void {
$this->featureContext->setResponse($this->listAllAvailableSpacesOfUser($user, $query));
$this->featureContext->setResponse($this->listAllMySpaces($user, $query));
}
/**
@@ -589,30 +655,7 @@ class SpacesContext implements Context {
foreach ($headersTable as $row) {
$headers[$row['header']] = $row ['value'];
}
$this->featureContext->setResponse($this->listAllAvailableSpacesOfUser($user, '', $headers));
}
/**
* The method is used on the administration setting tab, which only the Admin user and the Space admin user have access to
*
* @param string $user
* @param string $query
*
* @return ResponseInterface
*
* @throws GuzzleException
* @throws Exception
*/
public function listAllAvailableSpaces(string $user, string $query = ''): ResponseInterface {
$response = GraphHelper::getAllSpaces(
$this->featureContext->getBaseUrl(),
$user,
$this->featureContext->getPasswordForUser($user),
"?" . $query,
$this->featureContext->getStepLineRef()
);
$this->rememberTheAvailableSpaces($response);
return $response;
$this->featureContext->setResponse($this->listAllMySpaces($user, '', $headers));
}
/**
@@ -629,9 +672,14 @@ class SpacesContext implements Context {
* @throws Exception
*/
public function theUserListsAllAvailableSpacesUsingTheGraphApi(string $user, string $query = ''): void {
$this->featureContext->setResponse(
$this->listAllAvailableSpaces($user, $query)
$response = GraphHelper::getAllSpaces(
$this->featureContext->getBaseUrl(),
$user,
$this->featureContext->getPasswordForUser($user),
$query,
$this->featureContext->getStepLineRef()
);
$this->featureContext->setResponse($response);
}
/**
@@ -647,7 +695,6 @@ class SpacesContext implements Context {
*/
public function theUserLooksUpTheSingleSpaceUsingTheGraphApiByUsingItsId(string $user, string $spaceName, string $ownerUser = ''): void {
$space = $this->getSpaceByName(($ownerUser !== "") ? $ownerUser : $user, $spaceName);
Assert::assertIsArray($space);
Assert::assertNotEmpty($space["id"]);
Assert::assertNotEmpty($space["root"]["webDavUrl"]);
$this->featureContext->setResponse(
@@ -693,37 +740,11 @@ class SpacesContext implements Context {
);
$this->featureContext->setResponse($response);
if ($response->getStatusCode() === 201) {
$this->addCreatedSpace($user, $response);
$space = $this->featureContext->getJsonDecodedResponseBodyContent($response);
$this->addToCreatedSpace($user, $space);
}
}
/**
* Remember the available Spaces
*
* @param ResponseInterface|null $response
*
* @return void
*
* @throws Exception
*/
public function rememberTheAvailableSpaces(?ResponseInterface $response = null): void {
if ($response) {
$rawBody = $response->getBody()->getContents();
} else {
$rawBody = $this->featureContext->getResponse()->getBody()->getContents();
}
$drives = json_decode($rawBody, true, 512, JSON_THROW_ON_ERROR);
if (isset($drives["value"])) {
$drives = $drives["value"];
}
$spaces = [];
foreach ($drives as $drive) {
$spaces[$drive["name"]] = $drive;
}
$this->setAvailableSpaces($spaces);
}
/**
* @param string $user
* @param string $spaceName
@@ -1004,7 +1025,7 @@ class SpacesContext implements Context {
string $grantedUser,
string $role
): void {
$response = $this->listAllAvailableSpacesOfUser($user);
$response = $this->listAllMySpaces($user);
$this->featureContext->theHTTPStatusCodeShouldBe(
200,
"Expected response status code should be 200",
@@ -1054,7 +1075,7 @@ class SpacesContext implements Context {
string $shouldOrNot,
string $spaceName
): void {
$response = $this->listAllAvailableSpacesOfUser($user);
$response = $this->listAllMySpaces($user);
$this->featureContext->theHTTPStatusCodeShouldBe(
200,
"Expected response status code should be 200",
@@ -1080,7 +1101,7 @@ class SpacesContext implements Context {
string $user,
string $spaceName
): void {
$response = $this->listAllAvailableSpacesOfUser($user);
$response = $this->listAllMySpaces($user);
$this->featureContext->theHTTPStatusCodeShouldBe(
200,
"Expected response status code should be 200",
@@ -1550,8 +1571,7 @@ class SpacesContext implements Context {
}
/**
* @Given /^user "([^"]*)" has changed the quota of the personal space of "([^"]*)" space to "([^"]*)"$/
* @Given /^user "([^"]*)" has changed the quota of the "([^"]*)" space to "([^"]*)"$/
* @Given /^user "([^"]*)" has changed the quota of space "([^"]*)" to "([^"]*)"$/
*
* @param string $user
* @param string $spaceName
@@ -1686,12 +1706,13 @@ class SpacesContext implements Context {
): void {
$space = ["name" => $spaceName, "driveType" => $spaceType, "quota" => ["total" => $quota]];
$response = $this->createSpace($user, $space);
$this->addCreatedSpace($user, $response);
$this->featureContext->theHTTPStatusCodeShouldBe(
201,
"Expected response status code should be 201 (Created)",
$response
);
$space = $this->featureContext->getJsonDecodedResponseBodyContent($response);
$this->addToCreatedSpace($user, $space);
}
/**
@@ -1711,12 +1732,13 @@ class SpacesContext implements Context {
): void {
$space = ["name" => $spaceName];
$response = $this->createSpace($user, $space);
$this->addCreatedSpace($user, $response);
$this->featureContext->theHTTPStatusCodeShouldBe(
201,
"Expected response status code should be 201 (Created)",
$response
);
$space = $this->featureContext->getJsonDecodedResponseBodyContent($response);
$this->addToCreatedSpace($user, $space);
}
/**
@@ -2276,10 +2298,14 @@ class SpacesContext implements Context {
string $fileContent,
string $destination
): array {
$response = $this->listAllAvailableSpacesOfUser($user);
$this->featureContext->theHTTPStatusCodeShouldBe(200, "", $response);
$spaceId = $this->getSpaceIdByName($user, $spaceName);
$response = $this->featureContext->uploadFileWithContent($user, $fileContent, $destination, $spaceId, true);
$space = $this->getSpaceByName($user, $spaceName);
$response = $this->featureContext->uploadFileWithContent(
$user,
$fileContent,
$destination,
$space["id"],
true
);
$this->featureContext->theHTTPStatusCodeShouldBe(['201', '204'], "", $response);
return $response->getHeader('oc-fileid');
}
@@ -4287,7 +4313,7 @@ class SpacesContext implements Context {
string $role,
string $expirationDate = null
): void {
$response = $this->listAllAvailableSpacesOfUser($user);
$response = $this->listAllMySpaces($user);
$this->featureContext->theHTTPStatusCodeShouldBe(
200,
"Expected response status code should be 200",
@@ -13,7 +13,7 @@ Feature: download multiple resources bundled into an archive
@issue-4637
Scenario Outline: download a single file
Given user "Alice" has uploaded file with content "some data" to "/textfile0.txt"
When user "Alice" downloads the <archive-type> archive of "/home/textfile0.txt" using the resource path and setting these headers:
When user "Alice" downloads the <archive-type> archive of "textfile0.txt" using the resource path and setting these headers:
| header | value |
| User-Agent | <user-agent> |
Then the HTTP status code should be "200"
@@ -30,7 +30,7 @@ Feature: download multiple resources bundled into an archive
Given user "Alice" has created folder "my_data"
And user "Alice" has uploaded file with content "some data" to "/my_data/textfile0.txt"
And user "Alice" has uploaded file with content "more data" to "/my_data/an_other_file.txt"
When user "Alice" downloads the <archive-type> archive of "/home/my_data" using the resource path and setting these headers:
When user "Alice" downloads the <archive-type> archive of "my_data" using the resource path and setting these headers:
| header | value |
| User-Agent | <user-agent> |
Then the HTTP status code should be "200"
@@ -52,10 +52,10 @@ Feature: download multiple resources bundled into an archive
And user "Alice" has created folder "more_data"
And user "Alice" has uploaded file with content "more data" to "/more_data/an_other_file.txt"
When user "Alice" downloads the archive of these items using the resource paths
| /home/textfile0.txt |
| /home/textfile1.txt |
| /home/my_data |
| /home/more_data |
| textfile0.txt |
| textfile1.txt |
| my_data |
| more_data |
Then the HTTP status code should be "200"
And the downloaded tar archive should contain these files:
| name | content |
@@ -107,10 +107,10 @@ Feature: download multiple resources bundled into an archive
| permissionsRole | Viewer |
And user "Brian" has a share "more_data" synced
When user "Brian" downloads the archive of these items using the resource path
| /home/Shares/textfile0.txt |
| /home/Shares/textfile1.txt |
| /home/Shares/my_data |
| /home/Shares/more_data |
| Shares/textfile0.txt |
| Shares/textfile1.txt |
| Shares/my_data |
| Shares/more_data |
Then the HTTP status code should be "200"
And the downloaded tar archive should contain these files:
| name | content |
@@ -156,7 +156,7 @@ Feature: download multiple resources bundled into an archive
| shareType | user |
| permissionsRole | Viewer |
And user "Brian" has a share "more_data" synced
When user "Brian" downloads the <archive-type> archive of "/home/Shares" using the resource path and setting these headers:
When user "Brian" downloads the <archive-type> archive of "Shares" using the resource path and setting these headers:
| header | value |
| User-Agent | <user-agent> |
Then the HTTP status code should be "200"
@@ -411,7 +411,7 @@ Feature: user GDPR (General Data Protection Regulation) report
Scenario: generate a GDPR report after the admin updates the quota of personal space
Given user "Admin" has changed the quota of the personal space of "Alice Hansen" space to "10000"
Given user "Admin" has changed the quota of space "Alice Hansen" to "10000"
When user "Alice" exports her GDPR report to "/.personal_data_export.json" using the Graph API
And user "Alice" downloads the content of GDPR report ".personal_data_export.json"
Then the HTTP status code of responses on each endpoint should be "202, 200" respectively
@@ -37,7 +37,7 @@ Feature: edit user
Examples:
| action description | user | http-status-code | new-user |
| change to a valid user name | Lionel | 200 | Lionel |
| user name characters | a*!_+-& | 200 | a*!_+-& |
| user name characters | a*!_-& | 200 | a*!_-& |
| change to existing user name | Brian | 409 | Carol |
| empty user name | | 400 | Carol |
@@ -11,7 +11,7 @@ Feature: lock files
Scenario Outline: lock a file
Given using <dav-path-version> DAV path
And user "Alice" has uploaded a file inside space "Alice Hansen" with content "some content" to "textfile.txt"
And user "Alice" has uploaded a file inside space "Personal" with content "some content" to "textfile.txt"
When user "Alice" locks file "textfile.txt" using the WebDAV API setting the following properties
| lockscope | exclusive |
Then the HTTP status code should be "200"
@@ -32,7 +32,7 @@ Feature: lock files
Scenario Outline: lock a file with a timeout
Given using <dav-path-version> DAV path
And user "Alice" has uploaded a file inside space "Alice Hansen" with content "some content" to "textfile.txt"
And user "Alice" has uploaded a file inside space "Personal" with content "some content" to "textfile.txt"
When user "Alice" locks file "textfile.txt" using the WebDAV API setting the following properties
| lockscope | exclusive |
| timeout | Second-5000 |
@@ -54,7 +54,7 @@ Feature: lock files
Scenario: lock a file using file-id
Given using spaces DAV path
And user "Alice" has uploaded a file inside space "Alice Hansen" with content "some content" to "textfile.txt"
And user "Alice" has uploaded a file inside space "Personal" with content "some content" to "textfile.txt"
And we save it into "FILEID"
When user "Alice" locks file "textfile.txt" using file-id "<<FILEID>>" using the WebDAV API setting the following properties
| lockscope | exclusive |
@@ -72,7 +72,7 @@ Feature: lock files
Scenario Outline: user cannot lock file twice
Given using <dav-path-version> DAV path
And user "Alice" has uploaded a file inside space "Alice Hansen" with content "some content" to "textfile.txt"
And user "Alice" has uploaded a file inside space "Personal" with content "some content" to "textfile.txt"
And user "Alice" has locked file "textfile.txt" setting the following properties
| lockscope | exclusive |
When user "Alice" tries to lock file "textfile.txt" using the WebDAV API setting the following properties
@@ -163,7 +163,7 @@ Feature: lock files
@issue-7599
Scenario Outline: lock a file in the shares
Given using <dav-path-version> DAV path
And user "Alice" has uploaded a file inside space "Alice Hansen" with content "some content" to "textfile.txt"
And user "Alice" has uploaded a file inside space "Personal" with content "some content" to "textfile.txt"
And user "Alice" has sent the following resource share invitation:
| resource | textfile.txt |
| space | Personal |
@@ -189,7 +189,7 @@ Feature: lock files
Scenario: lock a file in the shares using file-id
Given using spaces DAV path
And user "Alice" has uploaded a file inside space "Alice Hansen" with content "some content" to "textfile.txt"
And user "Alice" has uploaded a file inside space "Personal" with content "some content" to "textfile.txt"
And we save it into "FILEID"
And user "Alice" has sent the following resource share invitation:
| resource | textfile.txt |
@@ -213,7 +213,7 @@ Feature: lock files
Scenario Outline: viewer cannot lock a file in the shares using file-id
Given using spaces DAV path
And the administrator has enabled the permissions role "Secure Viewer"
And user "Alice" has uploaded a file inside space "Alice Hansen" with content "some content" to "textfile.txt"
And user "Alice" has uploaded a file inside space "Personal" with content "some content" to "textfile.txt"
And we save it into "FILEID"
And user "Alice" has sent the following resource share invitation:
| resource | textfile.txt |
@@ -233,7 +233,7 @@ Feature: lock files
Scenario: sharee cannot lock a resource exclusively locked by a sharer
Given using spaces DAV path
And user "Alice" has uploaded a file inside space "Alice Hansen" with content "some content" to "textfile.txt"
And user "Alice" has uploaded a file inside space "Personal" with content "some content" to "textfile.txt"
And we save it into "FILEID"
And user "Alice" has sent the following resource share invitation:
| resource | textfile.txt |
@@ -258,7 +258,7 @@ Feature: lock files
Scenario: sharer cannot lock a resource exclusively locked by a sharee
Given using spaces DAV path
And user "Alice" has uploaded a file inside space "Alice Hansen" with content "some content" to "textfile.txt"
And user "Alice" has uploaded a file inside space "Personal" with content "some content" to "textfile.txt"
And we save it into "FILEID"
And user "Alice" has sent the following resource share invitation:
| resource | textfile.txt |
@@ -249,7 +249,7 @@ Feature: unlock locked items
Scenario: unlock a file using file-id
Given using spaces DAV path
And user "Alice" has uploaded a file inside space "Alice Hansen" with content "some content" to "textfile.txt"
And user "Alice" has uploaded a file inside space "Personal" with content "some content" to "textfile.txt"
And we save it into "FILEID"
And user "Alice" has locked file "textfile.txt" using file-id "<<FILEID>>" setting the following properties
| lockscope | exclusive |
@@ -278,7 +278,7 @@ Feature: unlock locked items
Scenario: unlock a file in the shares using file-id
Given user "Brian" has been created with default attributes
And using spaces DAV path
And user "Alice" has uploaded a file inside space "Alice Hansen" with content "some content" to "textfile.txt"
And user "Alice" has uploaded a file inside space "Personal" with content "some content" to "textfile.txt"
And we save it into "FILEID"
And user "Alice" has sent the following resource share invitation:
| resource | textfile.txt |
@@ -19,7 +19,7 @@ Feature: Update permission of a share
| sharee | Brian |
| shareType | user |
| permissionsRole | Viewer |
| expirationDateTime | 2025-07-15T14:00:00Z |
| expirationDateTime | 2200-07-14T14:00:00Z |
When user "Alice" updates the last resource share with the following properties using the Graph API:
| space | Personal |
| resource | testfile.txt |
@@ -91,7 +91,7 @@ Feature: Update permission of a share
| sharee | Brian |
| shareType | user |
| permissionsRole | Viewer |
| expirationDateTime | 2025-07-15T14:00:00Z |
| expirationDateTime | 2200-07-15T14:00:00Z |
When user "Alice" updates the last resource share with the following properties using the Graph API:
| space | Personal |
| resource | <resource> |
@@ -394,7 +394,7 @@ Feature: Update permission of a share
| sharee | grp1 |
| shareType | group |
| permissionsRole | <permissions-role> |
| expirationDateTime | 2025-07-15T14:00:00Z |
| expirationDateTime | 2200-07-15T14:00:00Z |
When user "Alice" updates the last drive share with the following using root endpoint of the Graph API:
| permissionsRole | <new-permissions-role> |
| space | NewSpace |
@@ -474,7 +474,7 @@ Feature: Update permission of a share
| sharee | grp1 |
| shareType | group |
| permissionsRole | <permissions-role> |
| expirationDateTime | 2025-07-15T14:00:00Z |
| expirationDateTime | 2200-07-15T14:00:00Z |
When user "Alice" updates the last drive share with the following using root endpoint of the Graph API:
| expirationDateTime | |
| space | NewSpace |
@@ -554,7 +554,7 @@ Feature: Update permission of a share
| sharee | grp1 |
| shareType | group |
| permissionsRole | <permissions-role> |
| expirationDateTime | 2025-07-15T14:00:00Z |
| expirationDateTime | 2200-07-14T14:00:00Z |
When user "Alice" updates the last drive share with the following using root endpoint of the Graph API:
| expirationDateTime | 2200-07-15T14:00:00Z |
| space | NewSpace |
@@ -636,7 +636,7 @@ Feature: Update permission of a share
| sharee | grp1 |
| shareType | group |
| permissionsRole | <permissions-role> |
| expirationDateTime | 2025-07-15T14:00:00Z |
| expirationDateTime | 2200-07-15T14:00:00Z |
When user "Alice" updates the last drive share with the following using root endpoint of the Graph API:
| expirationDateTime | |
| permissionsRole | <new-permissions-role> |
@@ -717,7 +717,7 @@ Feature: Update permission of a share
| sharee | grp1 |
| shareType | group |
| permissionsRole | <permissions-role> |
| expirationDateTime | 2025-07-15T14:00:00Z |
| expirationDateTime | 2200-07-14T14:00:00Z |
When user "Alice" updates the last drive share with the following using root endpoint of the Graph API:
| expirationDateTime | 2200-07-15T14:00:00Z |
| permissionsRole | <new-permissions-role> |
@@ -799,7 +799,7 @@ Feature: Update permission of a share
| sharee | Brian |
| shareType | user |
| permissionsRole | <permissions-role> |
| expirationDateTime | 2025-07-15T14:00:00Z |
| expirationDateTime | 2200-07-15T14:00:00Z |
When user "Alice" updates the last drive share with the following using root endpoint of the Graph API:
| permissionsRole | <new-permissions-role> |
| space | NewSpace |
@@ -875,7 +875,7 @@ Feature: Update permission of a share
| sharee | Brian |
| shareType | user |
| permissionsRole | <permissions-role> |
| expirationDateTime | 2025-07-15T14:00:00Z |
| expirationDateTime | 2200-07-15T14:00:00Z |
When user "Alice" updates the last drive share with the following using root endpoint of the Graph API:
| expirationDateTime | |
| space | NewSpace |
@@ -951,7 +951,7 @@ Feature: Update permission of a share
| sharee | Brian |
| shareType | user |
| permissionsRole | <permissions-role> |
| expirationDateTime | 2025-07-15T14:00:00Z |
| expirationDateTime | 2200-07-14T14:00:00Z |
When user "Alice" updates the last drive share with the following using root endpoint of the Graph API:
| expirationDateTime | 2200-07-15T14:00:00Z |
| permissionsRole | <new-permissions-role> |
@@ -1033,7 +1033,7 @@ Feature: Update permission of a share
| sharee | Brian |
| shareType | user |
| permissionsRole | <permissions-role> |
| expirationDateTime | 2025-07-15T14:00:00Z |
| expirationDateTime | 2200-07-15T14:00:00Z |
When user "Alice" updates the last drive share with the following using root endpoint of the Graph API:
| expirationDateTime | |
| permissionsRole | <new-permissions-role> |
@@ -1110,7 +1110,7 @@ Feature: Update permission of a share
| sharee | Brian |
| shareType | user |
| permissionsRole | <permissions-role> |
| expirationDateTime | 2025-07-15T14:00:00Z |
| expirationDateTime | 2200-07-14T14:00:00Z |
When user "Alice" updates the last drive share with the following using root endpoint of the Graph API:
| expirationDateTime | 2200-07-15T14:00:00Z |
| permissionsRole | <new-permissions-role> |
@@ -519,7 +519,7 @@ Feature: Change data of space
Scenario Outline: user can't upload resource greater than set quota
Given the administrator has assigned the role "<user-role>" to user "Alice" using the Graph API
And user "Admin" has changed the quota of the personal space of "Alice Hansen" space to "15"
And user "Admin" has changed the quota of space "Alice Hansen" to "15"
When user "Alice" uploads a file inside space "Alice Hansen" with content "file is more than 15 bytes" to "file.txt" using the WebDAV API
Then the HTTP status code should be "507"
And for user "Alice" the space "Personal" should not contain these entries:
@@ -108,7 +108,7 @@ Feature: State of the quota
Scenario Outline: check the relative amount of quota of personal space
Given user "Admin" has changed the quota of the personal space of "Alice Hansen" space to "10000"
Given user "Admin" has changed the quota of space "Alice Hansen" to "10000"
And user "Alice" has uploaded file "<file-upload>" to "/demo.txt"
When the user "Alice" requests these endpoints with "GET" with basic auth
| endpoint |
@@ -141,7 +141,7 @@ Feature: State of the quota
Scenario: user can restore a file version even if there is not enough quota to do so
Given user "Admin" has changed the quota of the "Alice Hansen" space to "30"
Given user "Admin" has changed the quota of space "Alice Hansen" to "30"
And user "Alice" has uploaded file with content "file is less than 30 bytes" to "/file.txt"
And user "Alice" has uploaded file with content "reduceContent" to "/file.txt"
And user "Alice" has uploaded file with content "some content" to "newFile.txt"
@@ -57,7 +57,7 @@ Feature: Tag
Scenario: user creates tags for resources in the personal space
Given user "Alice" has created a folder "folderMain" in space "Alice Hansen"
And user "Alice" has uploaded a file inside space "Alice Hansen" with content "some content" to "file.txt"
And user "Alice" has uploaded a file inside space "Personal" with content "some content" to "file.txt"
When user "Alice" creates the following tags for folder "folderMain" of space "Alice Hansen":
| my tag |
| important |
@@ -331,7 +331,7 @@ Feature: sharing
| shareType | user |
| permissionsRole | Editor |
And user "Brian" has a share "FOLDER" synced
And user "Admin" has changed the quota of the personal space of "Alice Hansen" space to "1"
And user "Admin" has changed the quota of space "Alice Hansen" to "1"
When user "Brian" uploads a file inside space "Shares" with content "new description" to "/FOLDER/textfile.txt" using the WebDAV API
Then the HTTP status code should be "507"
And as "Alice" file "/FOLDER/textfile.txt" should not exist
@@ -348,7 +348,7 @@ Feature: sharing
| shareType | group |
| permissionsRole | Editor |
And user "Brian" has a share "FOLDER" synced
And user "Admin" has changed the quota of the personal space of "Alice Hansen" space to "1"
And user "Admin" has changed the quota of space "Alice Hansen" to "1"
When user "Brian" uploads a file inside space "Shares" with content "new description" to "/FOLDER/textfile.txt" using the WebDAV API
Then the HTTP status code should be "507"
And as "Alice" file "/FOLDER/textfile.txt" should not exist
@@ -363,7 +363,7 @@ Feature: sharing
| shareType | user |
| permissionsRole | Uploader |
And user "Brian" has a share "FOLDER" synced
And user "Admin" has changed the quota of the personal space of "Alice Hansen" space to "1"
And user "Admin" has changed the quota of space "Alice Hansen" to "1"
When user "Brian" uploads a file inside space "Shares" with content "new description" to "/FOLDER/textfile.txt" using the WebDAV API
Then the HTTP status code should be "507"
And as "Alice" file "/FOLDER/textfile.txt" should not exist
@@ -380,7 +380,7 @@ Feature: sharing
| shareType | group |
| permissionsRole | Uploader |
And user "Brian" has a share "FOLDER" synced
And user "Admin" has changed the quota of the personal space of "Alice Hansen" space to "10"
And user "Admin" has changed the quota of space "Alice Hansen" to "10"
When user "Brian" uploads a file inside space "Shares" with content "new descriptionfgshsywhhh" to "/FOLDER/textfile.txt" using the WebDAV API
Then the HTTP status code should be "507"
And as "Alice" file "/FOLDER/textfile.txt" should not exist
@@ -23,6 +23,7 @@ Feature: sharing
| sharee | grp1 |
| shareType | group |
| permissionsRole | File Editor |
And user "Brian" has a share "textfile0.txt" synced
And user "Brian" has moved file "/Shares/textfile0.txt" to "/Shares/anotherName.txt"
When user "Alice" deletes the last share using the sharing API
Then the OCS status code should be "<ocs-status-code>"
@@ -45,6 +46,7 @@ Feature: sharing
| sharee | Brian |
| shareType | user |
| permissionsRole | Viewer |
And user "Brian" has a share "textfile0.txt" synced
When user "Alice" deletes the last share using the sharing API
Then the OCS status code should be "<ocs-status-code>"
And the HTTP status code should be "200"
@@ -67,6 +69,7 @@ Feature: sharing
| sharee | Brian |
| shareType | user |
| permissionsRole | Viewer |
And user "Brian" has a share "sub" synced
When user "Alice" deletes folder "/common" using the WebDAV API
Then the HTTP status code should be "204"
And as "Brian" folder "/Shares/sub" should not exist
@@ -89,6 +92,7 @@ Feature: sharing
| sharee | Brian |
| shareType | user |
| permissionsRole | Editor |
And user "Brian" has a share "shared" synced
When user "Brian" deletes file "/Shares/shared/shared_file.txt" using the WebDAV API
Then the HTTP status code should be "204"
And as "Brian" file "/Shares/shared/shared_file.txt" should not exist
@@ -114,6 +118,7 @@ Feature: sharing
| sharee | Brian |
| shareType | user |
| permissionsRole | Editor |
And user "Brian" has a share "shared" synced
When user "Brian" deletes folder "/Shares/shared/sub" using the WebDAV API
Then the HTTP status code should be "204"
And as "Brian" folder "/Shares/shared/sub" should not exist
@@ -144,6 +149,7 @@ Feature: sharing
| sharee | grp1 |
| shareType | group |
| permissionsRole | Viewer |
And user "Brian" has a share "parent.txt" synced
And user "Carol" has stored etag of element "/PARENT"
And user "Brian" has stored etag of element "/"
And user "Brian" has stored etag of element "/Shares"
@@ -165,6 +171,7 @@ Feature: sharing
| sharee | Brian |
| shareType | user |
| permissionsRole | Viewer |
And user "Brian" has a share "shared" synced
When user "Brian" deletes file "/Shares/shared/shared_file.txt" using the WebDAV API
Then the HTTP status code should be "403"
And as "Alice" file "/shared/shared_file.txt" should exist
@@ -187,6 +194,7 @@ Feature: sharing
| sharee | Brian |
| shareType | user |
| permissionsRole | Uploader |
And user "Brian" has a share "shared" synced
When user "Brian" deletes file "/Shares/shared/shared_file.txt" using the WebDAV API
Then the HTTP status code should be "403"
And as "Alice" file "/shared/shared_file.txt" should exist
@@ -208,6 +216,7 @@ Feature: sharing
| sharee | Brian |
| shareType | user |
| permissionsRole | Uploader |
And user "Brian" has a share "shared" synced
And user "Brian" has uploaded file "filesForUpload/textfile.txt" to "/Shares/shared/textfile.txt"
When user "Brian" deletes file "/Shares/shared/textfile.txt" using the WebDAV API
Then the HTTP status code should be "403"
@@ -237,6 +246,7 @@ Feature: sharing
| sharee | grp1 |
| shareType | group |
| permissionsRole | <permission-role> |
And user "Brian" has a share "<shared-resource>" synced
When user "Brian" deletes the last share of user "Alice" using the sharing API
Then the OCS status code should be "996"
And the HTTP status code should be "<http-status-code>"
@@ -244,11 +254,11 @@ Feature: sharing
And as "Brian" entry "<received-entry>" should exist
And as "Carol" entry "<received-entry>" should exist
Examples:
| entry-to-share | permission-role | ocs-api-version | http-status-code | received-entry |
| /shared/shared_file.txt | File Editor | 1 | 200 | /Shares/shared_file.txt |
| /shared/shared_file.txt | File Editor | 2 | 500 | /Shares/shared_file.txt |
| /shared | Editor | 1 | 200 | /Shares/shared |
| /shared | Editor | 2 | 500 | /Shares/shared |
| entry-to-share | permission-role | ocs-api-version | http-status-code | received-entry | shared-resource |
| /shared/shared_file.txt | File Editor | 1 | 200 | /Shares/shared_file.txt | shared_file.txt |
| /shared/shared_file.txt | File Editor | 2 | 500 | /Shares/shared_file.txt | shared_file.txt |
| /shared | Editor | 1 | 200 | /Shares/shared | shared |
| /shared | Editor | 2 | 500 | /Shares/shared | shared |
Scenario Outline: individual share recipient tries to delete the share
@@ -262,17 +272,18 @@ Feature: sharing
| sharee | Brian |
| shareType | user |
| permissionsRole | <permission-role> |
And user "Brian" has a share "<shared-resource>" synced
When user "Brian" deletes the last share of user "Alice" using the sharing API
Then the OCS status code should be "996"
And the HTTP status code should be "<http-status-code>"
And as "Alice" entry "<entry-to-share>" should exist
And as "Brian" entry "<received-entry>" should exist
Examples:
| entry-to-share | permission-role | ocs-api-version | http-status-code | received-entry |
| /shared/shared_file.txt | File Editor | 1 | 200 | /Shares/shared_file.txt |
| /shared/shared_file.txt | File Editor | 2 | 500 | /Shares/shared_file.txt |
| /shared | Editor | 1 | 200 | /Shares/shared |
| /shared | Editor | 2 | 500 | /Shares/shared |
| entry-to-share | permission-role | ocs-api-version | http-status-code | received-entry | shared-resource |
| /shared/shared_file.txt | File Editor | 1 | 200 | /Shares/shared_file.txt | shared_file.txt |
| /shared/shared_file.txt | File Editor | 2 | 500 | /Shares/shared_file.txt | shared_file.txt |
| /shared | Editor | 1 | 200 | /Shares/shared | shared |
| /shared | Editor | 2 | 500 | /Shares/shared | shared |
@issue-720
Scenario Outline: request PROPFIND after sharer deletes the collaborator
@@ -284,6 +295,7 @@ Feature: sharing
| sharee | Brian |
| shareType | user |
| permissionsRole | File Editor |
And user "Brian" has a share "textfile0.txt" synced
When user "Alice" deletes the last share using the sharing API
Then the OCS status code should be "<ocs-status-code>"
And the HTTP status code should be "200"
@@ -304,6 +316,7 @@ Feature: sharing
| sharee | Brian |
| shareType | user |
| permissionsRole | File Editor |
And user "Brian" has a share "textfile0.txt" synced
When user "Brian" tries to delete the last share of user "Alice" using the sharing API
Then the HTTP status code should be "<http-status-code>"
And the OCS status code should be "996"
@@ -321,6 +334,7 @@ Feature: sharing
| sharee | Brian |
| shareType | user |
| permissionsRole | File Editor |
And user "Brian" has a share "textfile0.txt" synced
When user "Alice" unshares file "textfile0.txt" shared to "Brian"
Then the OCS status code should be "<ocs-status-code>"
And the HTTP status code should be "200"
@@ -20,6 +20,7 @@ Feature: sharing
| sharee | Brian |
| shareType | user |
| permissionsRole | Viewer |
And user "Brian" has a share "textfile0.txt" synced
And using SharingNG
When user "Brian" gets all the shares shared with him using the sharing API
Then the OCS status code should be "<ocs-status-code>"
@@ -46,6 +47,8 @@ Feature: sharing
| sharee | Brian |
| shareType | user |
| permissionsRole | Viewer |
And user "Brian" has a share "textfile0.txt" synced
And user "Brian" has a share "textfile1.txt" synced
And using SharingNG
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 "<ocs-status-code>"
@@ -72,6 +75,8 @@ Feature: sharing
| sharee | Brian |
| shareType | user |
| permissionsRole | Viewer |
And user "Brian" has a share "textfile0.txt" synced
And user "Brian" has a share "textfile1.txt" synced
And using SharingNG
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 "<ocs-status-code>"
@@ -93,6 +98,7 @@ Feature: sharing
| sharee | grp1 |
| shareType | group |
| permissionsRole | Viewer |
And user "Brian" has a share "textfile0.txt" synced
And using SharingNG
When user "Brian" gets all the shares shared with him using the sharing API
Then the OCS status code should be "<ocs-status-code>"
@@ -167,7 +167,7 @@ Feature: sharing
Scenario Outline: check quota of owners parent directory of a shared file
Given using <dav-path-version> DAV path
And user "Brian" has been created with default attributes
And user "Admin" has changed the quota of the personal space of "Brian Murphy" space to "0"
And user "Admin" has changed the quota of space "Brian Murphy" to "0"
And user "Alice" has uploaded file "filesForUpload/lorem.txt" to "/myfile.txt"
And user "Alice" has sent the following resource share invitation:
| resource | myfile.txt |
@@ -204,7 +204,7 @@ Feature: sharing
| shareType | user |
| permissionsRole | Editor |
And user "Brian" has a share "FOLDER" synced
And user "Admin" has changed the quota of the personal space of "Alice Hansen" space to "1"
And user "Admin" has changed the quota of space "Alice Hansen" to "1"
When user "Brian" uploads file "filesForUpload/textfile.txt" to "/Shares/FOLDER/myfile.txt" using the WebDAV API
Then the HTTP status code should be "507"
And as "Alice" file "/FOLDER/myfile.txt" should not exist
@@ -228,7 +228,7 @@ Feature: sharing
| shareType | group |
| permissionsRole | Editor |
And user "Brian" has a share "FOLDER" synced
And user "Admin" has changed the quota of the personal space of "Alice Hansen" space to "1"
And user "Admin" has changed the quota of space "Alice Hansen" to "1"
When user "Brian" uploads file "filesForUpload/textfile.txt" to "/Shares/FOLDER/myfile.txt" using the WebDAV API
Then the HTTP status code should be "507"
And as "Alice" file "/FOLDER/myfile.txt" should not exist
@@ -250,7 +250,7 @@ Feature: sharing
| shareType | user |
| permissionsRole | Uploader |
And user "Brian" has a share "FOLDER" synced
And user "Admin" has changed the quota of the personal space of "Alice Hansen" space to "1"
And user "Admin" has changed the quota of space "Alice Hansen" to "1"
When user "Brian" uploads file "filesForUpload/textfile.txt" to "/Shares/FOLDER/myfile.txt" using the WebDAV API
Then the HTTP status code should be "507"
And as "Alice" file "/FOLDER/myfile.txt" should not exist
@@ -274,7 +274,7 @@ Feature: sharing
| shareType | group |
| permissionsRole | Uploader |
And user "Brian" has a share "FOLDER" synced
And user "Admin" has changed the quota of the personal space of "Alice Hansen" space to "1"
And user "Admin" has changed the quota of space "Alice Hansen" to "1"
When user "Brian" uploads file "filesForUpload/textfile.txt" to "/Shares/FOLDER/myfile.txt" using the WebDAV API
Then the HTTP status code should be "507"
And as "Alice" file "/FOLDER/myfile.txt" should not exist
@@ -86,7 +86,7 @@ Feature: upload to a public link share
| space | Personal |
| permissionsRole | edit |
| password | %public% |
And user "Admin" has changed the quota of the personal space of "Alice Hansen" space to "1"
And user "Admin" has changed the quota of space "Alice Hansen" to "1"
When the public uploads file "test.txt" with password "%public%" and content "test2" using the public WebDAV API
Then the HTTP status code should be "507"
@@ -98,7 +98,7 @@ Feature: upload to a public link share
| space | Personal |
| permissionsRole | createOnly |
| password | %public% |
And user "Admin" has changed the quota of the personal space of "Alice Hansen" space to "1"
And user "Admin" has changed the quota of space "Alice Hansen" to "1"
When the public uploads file "test.txt" with password "%public%" and content "test2" using the public WebDAV API
Then the HTTP status code should be "507"
@@ -36,8 +36,8 @@ Feature: get quota
Scenario Outline: retrieving folder quota of shared folder with quota when no quota is set for recipient
Given using <dav-path-version> DAV path
And user "Brian" has been created with default attributes
And user "Admin" has changed the quota of the personal space of "Alice Hansen" space to "0"
And user "Admin" has changed the quota of the personal space of "Brian Murphy" space to "10000"
And user "Admin" has changed the quota of space "Alice Hansen" to "0"
And user "Admin" has changed the quota of space "Brian Murphy" to "10000"
And user "Brian" has created folder "/testquota"
And user "Brian" has uploaded file "/testquota/Brian.txt" of size 1000 bytes
And user "Brian" has sent the following resource share invitation:
@@ -61,7 +61,7 @@ Feature: get quota
@issue-8197
Scenario Outline: retrieving folder quota when quota is set and a file was uploaded
Given using <dav-path-version> DAV path
And user "Admin" has changed the quota of the personal space of "Alice Hansen" space to "10000"
And user "Admin" has changed the quota of space "Alice Hansen" to "10000"
And user "Alice" has uploaded file "/prueba.txt" of size 1000 bytes
When user "Alice" gets the following properties of folder "/" using the WebDAV API
| propertyName |
@@ -78,7 +78,7 @@ Feature: get quota
Scenario Outline: retrieving folder quota when quota is set and a file was received
Given using <dav-path-version> DAV path
And user "Brian" has been created with default attributes
And user "Admin" has changed the quota of the personal space of "Brian Murphy" space to "10000"
And user "Admin" has changed the quota of space "Brian Murphy" to "10000"
And user "Alice" has uploaded file "/Alice.txt" of size 93 bytes
And user "Alice" has sent the following resource share invitation:
| resource | Alice.txt |
+2 -1
View File
@@ -261,10 +261,11 @@ function run_behat_tests() {
FAILED_SCENARIO_PATHS_COLORED=`awk '/Failed scenarios:/',0 ${TEST_LOG_FILE} | grep -a feature`
# There will be some ANSI escape codes for color in the FEATURE_COLORED var.
# Strip them out so we can pass just the ordinary feature details to Behat.
# Also strip everything after ".feature:XX", including text such as "(on line xx)" added by Behat indicating the failing step's line number.
# Thanks to https://en.wikipedia.org/wiki/Tee_(command) and
# https://stackoverflow.com/questions/23416278/how-to-strip-ansi-escape-sequences-from-a-variable
# for ideas.
FAILED_SCENARIO_PATHS=$(echo "${FAILED_SCENARIO_PATHS_COLORED}" | sed "s/\x1b[^m]*m//g")
FAILED_SCENARIO_PATHS=$(echo "${FAILED_SCENARIO_PATHS_COLORED}" | sed "s/\x1b\[[0-9;]*m//g" | sed 's/\(\.feature:[0-9]\+\).*/\1/')
# If something else went wrong, and there were no failed scenarios,
# then the awk, grep, sed command sequence above ends up with an empty string.
+55
View File
@@ -0,0 +1,55 @@
#!/usr/bin/env bash
set -e
COMMIT_SHA_SHORT=${DRONE_COMMIT:0:8}
BUILD_STATUS="✅ Success"
ROOMID="!rnWsCVUmDHDJbiSPMM:matrix.org"
# helper functions
log_error() {
echo -e "\e[31m$1\e[0m"
}
log_info() {
echo -e "\e[37m$1\e[0m"
}
log_success() {
echo -e "\e[32m$1\e[0m"
}
# Determine build source: nightly, tag or branch
if [[ "$DRONE_BUILD_EVENT" == "cron" ]]; then
BUILD_SOURCE="nightly-$DRONE_BRANCH"
elif [[ "$DRONE_BUILD_EVENT" == "tag" ]]; then
BUILD_SOURCE="tag $DRONE_TAG"
else
BUILD_SOURCE="$DRONE_BRANCH"
fi
if [[ "$DRONE_BUILD_STATUS" == "failure" ]]; then
BUILD_STATUS="❌️ Failure"
fi
message_html='<b>'$BUILD_STATUS'</b> <a href="'${DRONE_BUILD_LINK}'">'${DRONE_REPO}'#'$COMMIT_SHA_SHORT'</a> ('${BUILD_SOURCE}') by <b>'${DRONE_COMMIT_AUTHOR}'</b>'
message_html=$(echo "$message_html" | sed 's/\\/\\\\/g' | sed 's/"/\\"/g')
log_info "Sending report to the element chat...."
response=$(curl -s -o /dev/null -X PUT -w "%{http_code}" 'https://matrix.org/_matrix/client/v3/rooms/'$ROOMID'/send/m.room.message/'$(date +%s) \
-H "Authorization: Bearer "$MATRIX_TOKEN \
-H 'Content-Type: application/json' \
-d '{
"msgtype": "m.text",
"body": "'"$message_html"'",
"format": "org.matrix.custom.html",
"formatted_body": "'"$message_html"'"
}')
if [[ "$response" != "200" ]]; then
log_error "❌ Error: Failed to send notification to element. Expected status code 200, but got $response."
exit 1
fi
log_success "✅ Notification successfully sent to Element chat (ownCloud Infinite Scale Alerts)"