Merge pull request #9616 from owncloud/test-location-metadata-shares

[tests-only][full-ci] adding test for listing drive items with new metadatas in share space
This commit is contained in:
Sawjan Gurung
2024-07-23 17:16:40 +05:45
committed by GitHub
2 changed files with 156 additions and 1 deletions

View File

@@ -313,6 +313,150 @@ Feature: propfind extracted props
And user "Alice" has uploaded a file "filesForUpload/testavatar.jpg" to "testavatar.jpg" in space "new-space"
When user "Alice" gets the file "testavatar.jpg" from space "new-space" using the Graph API
Then the HTTP status code should be "200"
And the JSON data of the response should match
"""
{
"type": "object",
"required": [
"image",
"location",
"photo"
],
"properties": {
"image": {
"type": "object",
"required": [ "height", "width" ],
"properties": {
"height": {
"const": 480
},
"width": {
"const": 640
}
}
},
"location": {
"type": "object",
"required": [ "latitude", "longitude" ],
"properties": {
"latitude": {
"const": 43.467157
},
"longitude": {
"const": 11.885395
}
}
},
"photo": {
"type": "object",
"required": [
"cameraMake",
"cameraModel",
"exposureDenominator",
"exposureNumerator",
"fNumber",
"focalLength",
"orientation",
"takenDateTime"
],
"properties": {
"cameraMake": {
"const": "NIKON"
},
"cameraModel": {
"const": "COOLPIX P6000"
},
"exposureDenominator": {
"const": 178
},
"exposureNumerator": {
"const": 1
},
"fNumber": {
"const": 4.5
},
"focalLength": {
"const": 6
},
"orientation": {
"const": 1
},
"takenDateTime": {
"const": "2008-10-22T16:29:49Z"
}
}
}
}
}
"""
Scenario: GET extracted properties of an audio file (Shares space)
Given user "Brian" has been created with default attributes and without skeleton files
And user "Alice" has uploaded a file "filesForUpload/testaudio.mp3" to "testaudio.mp3" in space "Personal"
And user "Alice" has sent the following resource share invitation:
| resource | testaudio.mp3 |
| space | Personal |
| sharee | Brian |
| shareType | user |
| permissionsRole | Viewer |
When user "Brian" gets the file "testaudio.mp3" from space "Shares" using the Graph API
Then the HTTP status code should be "200"
And the JSON data of the response should match
"""
{
"type": "object",
"required": [
"audio"
],
"properties": {
"audio": {
"type": "object",
"required": [
"album",
"artist",
"genre",
"title",
"track",
"year"
],
"properties": {
"album": {
"const": "ALBUM1234567890123456789012345"
},
"artist": {
"const": "ARTIST123456789012345678901234"
},
"genre": {
"const": "Pop"
},
"title": {
"const": "TITLE1234567890123456789012345"
},
"track": {
"const": 1
},
"year": {
"const": 2001
}
}
}
}
}
"""
Scenario: GET extracted properties of an image file (Shares space)
Given user "Brian" has been created with default attributes and without skeleton files
And user "Alice" has uploaded a file "filesForUpload/testavatar.jpg" to "testavatar.jpg" in space "Personal"
And user "Alice" has sent the following resource share invitation:
| resource | testavatar.jpg |
| space | Personal |
| sharee | Brian |
| shareType | user |
| permissionsRole | Viewer |
When user "Brian" gets the file "testavatar.jpg" from space "Shares" using the Graph API
Then the HTTP status code should be "200"
And the JSON data of the response should match
"""
{

View File

@@ -4106,7 +4106,18 @@ class SpacesContext implements Context {
*/
public function userGetsTheDriveItemInSpace(string $user, string $file, string $space):void {
$spaceId = ($this->getSpaceByName($user, $space))["id"];
$itemId = $this->getFileId($user, $space, $file);
$itemId = '';
if ($space === "Shares") {
$itemId = GraphHelper::getShareMountId(
$this->featureContext->getBaseUrl(),
$this->featureContext->getStepLineRef(),
$user,
$this->featureContext->getPasswordForUser($user),
$file
);
} else {
$itemId = $this->getFileId($user, $space, $file);
}
$url = $this->featureContext->getBaseUrl() . "/graph/v1.0/drives/$spaceId/items/$itemId";
// NOTE: extracting properties occurs asynchronously
// short wait is necessary before getting those properties